Friday, September 24, 2010

how to find router ip address for any router of any OS

type tracert google.com from commandline

For example as in Ubuntu:

The first IP address is your computer's IP. 10.1.1.1 is the router's IP

Saturday, September 18, 2010

/etc/hosts file format

The format of /etc/hosts is:

How to find out the format?
type man 5 hosts in terminal

why 5?
5 is the section number of a man page, it means file formats
ref:http://en.wikipedia.org/wiki/Man_page



Extra:

The etc/hosts file specifies the hostname or computer name your current shell is running.
In my case, my computer name is zhang-laptop and my login name is zhang, so my bash looks like:

zhang@zhang-laptop:~$

And my etc/host file is:
zhang@zhang-laptop:~$ cat /etc/hosts
127.0.0.1 localhost
127.0.1.1 zhang-laptop
    #added
    #127.0.0.2    domainhound
    #127.0.0.2    zhangmichael.com

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

how do you file the hosts file format?


Ref:
http://www.freebsd.org/doc/handbook/configtuning-configfiles.html
http://www.freebsd.org/cgi/man.cgi?query=hosts&sektion=5

Friday, August 13, 2010

/etc/alternatives/-->Debian alternatives system

Where is location of java on ubuntu?
Finding out the answer is not just use "whereis java" or "which java":

The alternatives directory lead to the alternative concept. when you type java, it could refer to a different real java location if a new version has just installed.
Eg. I was using java 5, typing java would start JVM 5; after installing java 6, type java would start JVM6.

Intuitively, I think having this extra level of indirection is useless...

Saturday, August 7, 2010

burst.net vps outrage counter

I have purchased the cheapest VPS from burst.net and I think it is the cheapest around.
However, there had been at least three outrages during the last three month. When I say at least three outrages. Because each time I type top, the uptime is different, there had been three occasions.

Now I am going to keep a record of outrages, every time when i type top, if system had been done, i would put a record here.

08/Aug/10 top - 04:42:16 up 3 days,

swap on VPS(OpenVS)

I have problem starting java virtual machine on my VPS. The cause is there is not enough heap to be allocated for JVM.

$ java
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.
The fix for me is that my java is OpenJDK, so I uninstalled it and reinstalled the Sun implementation and fixed the problem.



Related stuff:
This came down to my VPS has only 500mb memory. I want to try if adding more swap can solve the problem. And ended up finding out Swap is not allowed on OpenVS. from this link. http://forums.vpslink.com/linux/1567-how-create-swapfile-your-vps.html

When I tried to create swap file according to https://help.ubuntu.com/community/SwapFaq  I get:

   swapon failed: Operation not permitted
Burstnet suggested me to increase my memory.
I would want to if there are other solutions..

Friday, July 23, 2010

hulu

Monday, June 21, 2010

Clang to analyze IPhone Project

After learned how to use xcodebuild from previous post then using scan-build is easy

Just append scan-build in front of "xcodebuild command " eg

for me the command is:

~/Desktop/Application/checker-234/scan-build xcodebuild -configuration Debug -sdk iphonesimulator4.0

And you can view the output as it instruct:

Now, I have 21 bugs need to be fixed.
Publish Post