Month: July 2014

A little bit better – Showing the MBR

A little bit better – Showing the MBR

Showing MBR bytes
Showing MBR bytes

Here is the java code to read MBR out:

package com.peterswing.mbr;

import java.io.FileInputStream;
import java.io.InputStream;

import org.apache.commons.io.IOUtils;

import com.peterswing.CommonLib;

public class ReadMBR {

	public static void main(String[] args) {
		try {
			InputStream in = new FileInputStream("/Users/peter/workspace/GKD/vm/dlxlinux/hd10meg.img");

			in.skip(0x1be);
			for (int x = 0; x < 4; x++) {
				byte partition[] = new byte[16];
				IOUtils.read(in, partition, 0, 16);
				printPartitionTable(partition);
			}
			IOUtils.closeQuietly(in);
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}

	public static String getPartitionTable(byte partition[]) {
		String s = "";
		s += "status         : " + partition[0] + "\n";
		s += "chs (first)    : " + hex(partition[1]) + " " + hex(partition[2]) + " " + hex(partition[3]) + "\n";
		s += "partition type : " + hex(partition[4]) + "\n";
		s += "chs (last)     : " + hex(partition[5]) + " " + hex(partition[6]) + " " + hex(partition[7]) + "\n";
		s += "lba (first)    : " + hex(partition[8]) + " " + hex(partition[9]) + " " + hex(partition[10]) + " " + hex(partition[11]) + "\n";
		s += "no. of sector  : " + hex(partition[12]) + " " + hex(partition[13]) + " " + hex(partition[14]) + " " + hex(partition[15]) + "\n";
		s += "size           : " + CommonLib.convertFilesize(CommonLib.getInt(new byte[] { partition[12], partition[13], partition[14], partition[15] }, 0) * 512) + "\n";
		return s;
	}

	public static void printPartitionTable(byte partition[]) {
		System.out.println(getPartitionTable(partition));
	}

	public static String hex(int x) {
		return Integer.toHexString(x & 0xff);
	}
}

read count : 263

We should mix 4K and 4M Page

I was fixing the PSE and PAE page table display for GKD, I found out Linux using 4M page to map large address space and it uses 4K page to map broken space. So advance OS should mix use of 4K and 4M page.

how linux use 4k and 4m page together

 

Now GKD supports PSE=1 (4M page)

4M page

read count : 595

I think i am under dns attack

I think i am under dns attack, in my /var/log/message i keep seeing these. Someone is using over 2000 ip to lookup my dns server.

Jul  8 07:14:39 petersoft named[3263]: client 65.254.249.169#31655: no more recursive clients: quota reached
Jul  8 07:14:39 petersoft named[3263]: client 32.44.116.12#45668: no more recursive clients: quota reached
Jul  8 07:14:39 petersoft named[3263]: client 23.247.81.239#32733: no more recursive clients: quota reached
Jul  8 07:14:39 petersoft named[3263]: client 36.234.182.148#65128: no more recursive clients: quota reached
Jul  8 07:14:39 petersoft named[3263]: client 32.253.30.9#24067: no more recursive clients: quota reached
Jul  8 07:14:39 petersoft named[3263]: client 83.10.132.93#10355: no more recursive clients: quota reached
Jul  8 07:14:39 petersoft named[3263]: client 124.12.88.39#20033: no more recursive clients: quota reached
Jul  8 07:14:39 petersoft named[3263]: client 16.251.239.11#3843: no more recursive clients: quota reached
Jul  8 07:14:39 petersoft named[3263]: client 15.105.18.26#12012: no more recursive clients: quota reached
Jul  8 07:14:39 petersoft named[3263]: client 35.145.149.224#56066: no more recursive clients: quota reached
Jul  8 07:14:39 petersoft named[3263]: client 72.250.71.141#55169: no more recursive clients: quota reached
Jul  8 07:14:39 petersoft named[3263]: client 16.40.135.80#42400: no more recursive clients: quota reached
Jul  8 07:14:39 petersoft named[3263]: client 108.147.217.226#45322: no more recursive clients: quota reached
Jul  8 07:14:39 petersoft named[3263]: client 8.108.103.84#30252: no more recursive clients: quota reached
Jul  8 07:14:39 petersoft named[3263]: client 91.206.27.44#53448: no more recursive clients: quota reached
Jul  8 07:14:39 petersoft named[3263]: client 94.243.234.26#42498: no more recursive clients: quota reached
Jul  8 07:14:39 petersoft named[3263]: client 120.167.243.44#57980: no more recursive clients: quota reached
Jul  8 07:14:39 petersoft named[3263]: client 115.168.23.42#64634: no more recursive clients: quota reached
Jul  8 07:14:39 petersoft named[3263]: client 14.85.197.38#57296: no more recursive clients: quota reached
Jul  8 07:14:39 petersoft named[3263]: client 8.198.131.140#37656: no more recursive clients: quota reached
Jul  8 07:14:39 petersoft named[3263]: client 1.74.160.47#41155: no more recursive clients: quota reached
Jul  8 07:14:39 petersoft named[3263]: client 106.144.248.143#52145: no more recursive clients: quota reached
Jul  8 07:14:39 petersoft named[3263]: client 101.189.35.99#60637: no more recursive clients: quota reached
Jul  8 07:14:39 petersoft named[3263]: client 121.251.93.58#20274: no more recursive clients: quota reached
Jul  8 07:14:39 petersoft named[3263]: client 24.104.44.88#23336: no more recursive clients: quota reached
Jul  8 07:14:39 petersoft named[3263]: client 119.150.51.199#8437: no more recursive clients: quota reached
Jul  8 07:14:39 petersoft named[3263]: client 92.12.35.97#55673: no more recursive clients: quota reached
Jul  8 07:14:39 petersoft named[3263]: client 66.70.220.236#24442: no more recursive clients: quota reached
Jul  8 07:14:39 petersoft named[3263]: client 18.247.171.123#53097: no more recursive clients: quota reached
Jul  8 07:14:39 petersoft named[3263]: client 107.205.171.181#33105: no more recursive clients: quota reached
Jul  8 07:14:39 petersoft named[3263]: client 78.48.204.24#26234: no more recursive clients: quota reached
Jul  8 07:14:39 petersoft named[3263]: client 73.52.107.198#64558: no more recursive clients: quota reached
Jul  8 07:14:39 petersoft named[3263]: client 15.69.210.99#61165: no more recursive clients: quota reached
Jul  8 07:14:39 petersoft named[3263]: client 39.47.93.102#43460: no more recursive clients: quota reached
Jul  8 07:14:39 petersoft named[3263]: client 5.65.55.240#16498: no more recursive clients: quota reached
Jul  8 07:14:39 petersoft named[3263]: client 68.18.205.222#21508: no more recursive clients: quota reached
Jul  8 07:14:39 petersoft named[3263]: client 128.236.221.133#56671: no more recursive clients: quota reached
Jul  8 07:14:39 petersoft named[3263]: client 77.72.147.216#11370: no more recursive clients: quota reached
Jul  8 07:14:39 petersoft named[3263]: client 49.212.253.82#24316: no more recursive clients: quota reached
Jul  8 07:14:39 petersoft named[3263]: client 66.254.251.100#32610: no more recursive clients: quota reached
Jul  8 07:14:39 petersoft named[3263]: client 91.74.37.67#55767: no more recursive clients: quota reached
Jul  8 07:14:39 petersoft named[3263]: client 112.102.110.83#19745: no more recursive clients: quota reached
Jul  8 07:14:39 petersoft named[3263]: client 85.165.163.23#19555: no more recursive clients: quota reached
Jul  8 07:14:39 petersoft named[3263]: client 14.136.98.212#32228: no more recursive clients: quota reached
Jul  8 07:14:39 petersoft named[3263]: client 67.97.28.244#41398: no more recursive clients: quota reached
Jul  8 07:14:39 petersoft named[3263]: client 60.217.137.235#415: no more recursive clients: quota reached
Jul  8 07:14:39 petersoft named[3263]: client 41.120.87.227#43219: no more recursive clients: quota reached
Jul  8 07:14:39 petersoft named[3263]: client 31.28.113.137#44481: no more recursive clients: quota reached
Jul  8 07:14:39 petersoft named[3263]: client 105.44.182.212#34606: no more recursive clients: quota reached

read count : 375

New way to do VM migration

To migrate VMs to different compute node is easy, simply hold your ctrl key and select VMs, drag & drop them to a new compute server. But now it support more feature, when you release the mouse, it will popup a windows to select “migrate now” or “thru titan script”. If you select titan script, it popup a windows for you to select the script you want to execute before/during migration. The titan script can do many things, such as filter out the VM based on some dynamic parameters (network usage/cpu usage/etc…), execute additional process during migration. This help people to group repetitive migration tasks in one single titan script, provide some automations.

Drag & drop - migration
Drag & drop – migration

read count : 403

Openstack 4th birthday party in cyberport

Openstack 4th party, i got a counter to demo Titan, thanks Cyberport. Titan language will be demo after September. People seems more interested in Titan management tool rather than the Titan portal.

 

Openstack community director - Mr Ben
Openstack community director – Mr Ben
Thanks Cyberport !!! I got a free counter for demo :-)
Thanks Cyberport !!! I got a free counter for demo 🙂

openstach-4th-party-2014-07-04-16.00 openstach-4th-party-2014-07-04-15.48

It has wireless
It has wireless

openstach-4th-party-2014-07-04-16.26-3 openstach-4th-party-2014-07-04-16.26-2

Ubuntu server
Ubuntu server

openstach-4th-party-2014-07-04-16.26

read count : 421