Posts

Linux networking issue #1

Change route     $ sudo route Delete default gateway     $ sudo route del default Add new default gateway     $ sudo route add default gw xxx.xxx.xxx.xxx Bring up/down interface     $ sudo ifconfig up/down Config network     $ sudo vi /etc/network/interfaces Restart/Stop/Start network     $ sudo /etc/init.d/networking restart/stop/start Release IP from dhcp     $ dhclient -r Get Fresh IP from dhcp     $ dhclient Ref:Japman, InfraGuy.

Check partition type in linux

Just     $ df -T -h or     $ sudo fdisk -l ref :  http://www.cyberciti.biz/faq/linux-how-to-determine-find-out-file-system-type/

Dig in google-chrome #1

I tried to find why I can't type in input-textbox on some website (known later that has flash 11.3 included). Not sure but the problem gone immediately after I disable flash (some pepper version). So I decide to use flash 11.2r202 from adobe website. In tar.gz type, I discovered that google-chrome not just store files in ~/.config/google-chrome but in /opt/google/chrome as well. Seem like this is the truth solution but not event close, because my chrome does not seem to feel a new plugin (libflashplayer.so). So I try to put it in /usr/lib/mozilla/plugins. From doing this, it's work. That's it. ** Download install_flash_player_11_linux.x86_64.tar.gz from adobe web. After untar we'll get - libflashplayer.sh - readme.txt - usr folder **** you should follow the instruction in readme.txt

Python re module's stuff # 1

When you do something with aws, then you need only ip-address from something like this $ ec2-1-2-3-4.ap-southeast-1.compute.amazonaws.com I used to deal with it like split something then concat with something. Now I just found something cool in python's re module. >>> import re >>> ec2_ip = re.search(r'ec2-(\d+)-(\d+)-(\d+)-(\d+), ).groups() so I get >>> print ec2_ip '1.2.3.4' yaha, love this.

The combination of xargs

Assume that you : Have folder "mylist" that contain a lot of files such as "a.php", "uud.php", "ad.py".... You want to : Add new extension ".du" to any files in this folder I can do : ~/mylist$ ls | xargs -I f mv f f.du             # god bless -I :o Or I can do : ~/mylist$ find . -name '*.py' | xargs -I f mv f f.du        # just add new extension for *.py * aha , i think that a lot of combination could made :) ** next time, it should be rename extension not add it. (my eng is suck)

Create file with size for testing purpose

Have you guys even need to have some file with size and its content not neccessary! Here it is $  dd if=/dev/zero of=output.dat bs=1024 count=10240 now we get file -- name : output.dat -- size :1024 * 10240 -> ~10mb Thanks for ( http://linuxcommando.blogspot.com/2008/02/create-file-of-given-size.html )

ShortCut for KDE Desktop

It's from linux mint, but it's work :) http://community.linuxmint.com/tutorial/view/47