Sometimes, even after cmd "dhclient eth0", the machine still cannot ping outside machines.
Then, I use cmd "route" to check the current route, and get sth like this:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 * 255.255.255.0 U 0 0 0 ra0
So there is no default gatway. Next I use the following command to add a default route:
"route add default gw 192.168.2.1 eth0"
(The IP of the gateway could be the current IP address and change the last number to 1.)
Ref:
http://www.cyberciti.biz/faq/linux-setup-default-gateway-with-route-command/
Thursday, December 29, 2011
Tuesday, December 27, 2011
A complete guide to RPM and source RPM
Maximum RPM
http://www.rpm.org/max-rpm-snapshot/
List all the rpms, etc:
http://www.cyberciti.biz/faq/howto-list-installed-rpm-package/
http://www.rpm.org/max-rpm-snapshot/
List all the rpms, etc:
http://www.cyberciti.biz/faq/howto-list-installed-rpm-package/
Wednesday, December 21, 2011
Thursday, December 15, 2011
Linux command line history tricks
Command Line Tricks: How To Identify Date and Time of a Unix Command Execution
http://www.thegeekstuff.com/2009/10/command-line-tricks-how-to-identify-date-and-time-of-a-unix-command-execution/
15 Examples To Master Linux Command Line History
http://www.thegeekstuff.com/2008/08/15-examples-to-master-linux-command-line-history/
http://www.thegeekstuff.com/2009/10/command-line-tricks-how-to-identify-date-and-time-of-a-unix-command-execution/
15 Examples To Master Linux Command Line History
http://www.thegeekstuff.com/2008/08/15-examples-to-master-linux-command-line-history/
Wednesday, December 14, 2011
Tuesday, December 13, 2011
git discard changes to a file
git checkout -f -- "filename"Note, there is a space between -- and "filename".
Other methods:
git checkout -f
=========================================
To discard local commits:
git reset --hard origin/master
Monday, December 12, 2011
PXE boot DOS
PXE Booting your M200 to DOS using a Windows Server
http://home.allegiance.tv/~joem298/
Universal TCP/IP Network Bootdisk
http://netbootdisk.com/building.htmMaking PXE boot disks
http://www.pantz.org/software/pxe/makepxebootdisks.html
Teledata boot disk
http://www.tdonline.com/bootdisk.htm
Friday, December 9, 2011
Tuesday, December 6, 2011
bash commands shortcuts
http://www.gnu.org/software/bash/manual/bashref.html#Commands-For-History
alt+ctrl+y
yank-nth-arg (M-C-y)
alt+ctrl+y
- Insert the first argument to the previous command (usually the second word on the previous line) at point. With an argument n, insert the nth word from the previous command (the words in the previous command begin with word 0). A negative argument inserts the nth word from the end of the previous command. Once the argument n is computed, the argument is extracted as if the ‘!n’ history expansion had been specified.
yank-last-arg (M-. or M-_)
- Insert last argument to the previous command (the last word of the previous history entry). With an argument, behave exactly like
yank-nth-arg
. Successive calls toyank-last-arg
move back through the history list, inserting the last argument of each line in turn. The history expansion facilities are used to extract the last argument, as if the ‘!$’ history expansion had been specified.
alt+-
Monday, December 5, 2011
__releases and __acquires macros in Linux kernel
Is used for sparse (a static analysis tool) to check the lock unlock mismatches.
http://lists.linux-foundation.org/pipermail/linux-pm/2006-May/008346.html
use netcat to transfer files between two machines
netcat is a very useful small program to communicate between two machines. If you just want to simply upload a file from one machine to another one, without setting up ftp, ssh server, then you can use netcat (it has many other functions).
commands:
1) listen on a port:
nc -l -p 2222 > log.txt
2) send file:
cat /etc/passwd nc 192.168.0.50 2222
Friday, December 2, 2011
Thursday, December 1, 2011
Subscribe to:
Posts (Atom)