GOOGLE Search

Google
 

Thursday, January 31, 2008

Linux Tip No. 9: Setting your hostname

Setting your hostname

File: /etc/sysconfig/network

[root@proxy sysconfig]# more network

NETWORKING=yes

HOSTNAME=localhost.localdomain

Example:

Edit the file

[root@proxy docadmin]# cat /etc/sysconfig/network

NETWORKING=yes

HOSTNAME=proxy.jepoy.net

[root@proxy docadmin]# /sbin/service network restart
Shutting down interface eth0: [ OK ]
Shutting down interface eth1: [ OK ]
Shutting down loopback interface: [ OK ]
Disabling IPv4 packet forwarding: net.ipv4.ip_forward = 0
[ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0: [ OK ]
Bringing up interface eth1: [ OK ]

[root@proxy docadmin]# hostname

proxy.jepoy.net

Tuesday, January 15, 2008

Linux Tip No. 8: Tcpdump to capture traffic

Using tcpdump to capture the traffic

[root@proxy /]# /usr/sbin/tcpdump -i eth0 port 80
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes
09:17:49.575590 IP proxy.jepoy.ph.56790 > nxdomain.guide.opendns.com.http: S 583111147:583111147(0) win 5840
09:17:49.755526 IP nxdomain.guide.opendns.com.http > proxy.jepoy.ph.56790: S 1378975104:1378975104(0) ack 583111148 win 16384
09:17:49.755592 IP proxy.jepoy.ph.56790 > nxdomain.guide.opendns.com.http: . ack 1 win 1460
09:17:49.756126 IP proxy.jepoy.ph.56790 > nxdomain.guide.opendns.com.http: P 1:248(247) ack 1 win 1460

Monday, January 7, 2008

Linux Tip No. 7: Print System Info

uname - print system info

Example:
[admin@proxy ~]$ uname -a
Linux proxy 2.6.11-1.1369_FC4 #1 Thu Jun 2 22:55:56 EDT 2005 i686 i686 i386 GNU/Linux

Sunday, January 6, 2008

Linux Tip No. 6: Creating a Logical Link

Create a File as a Logical Link to Another File

[root@mail admin]#ln -s existingFile newFile

Example:
Link the maillog to your home directory

[root@mail admin]#ln -fs /var/log/maillog .
[root@mail admin]#ls -al
lrwxrwxrwx 1 root root 16 Jan 7 14:48 maillog -> /var/log/maillog

Wednesday, January 2, 2008

Linux Tip No. 5: Determining the uptime

[root@mail admin]# uptime
10:45:52 up 89 days, 10:26, 1 user, load average: 0.00, 0.02, 0.00