Saturday, September 10, 2011

Some useful command to save my time



In Linux Ubuntu, the command line ifconfig to configue network interface dynamically:
sudo ifconfig eth0 192.168.0.1 netmask 255.255.255.0 mtu 1500 up

In Linux Ubuntu, the command line ifconfig to configue network interface statically:
sudo vim /etc/network/interfaces, add info and restart network service 
(sudo /etc/init.d/networking restart), for example:
auto eth0
iface eth0 inet static
address 192.168.0.1
gateway 192.168.0.254
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
mtu 1500

In Linux Ubuntu, the command to update "locate db" is
sudo updatedb

In FreeBSD, the command to update "locate db" is
/usr/libexec/locate.updatedb

In Linux Ubuntu, the command line to watch clock time is
watch -n 1 -t date

In Linux Ubuntu, the command line to make a patch is
diff -Naur linux-<version>/net/ipv4/tcp_probe.c linux-<version>net/ipv4/tcp_probe_update.c > patch.txt



Reference:
Howto: Ubuntu Linux convert DHCP network configuration to static IP configuration
FreeBSD IP Alias: Setup 2 or More IP address on One NIC

No comments:

Post a Comment