Linux Network Basic

Display all the interfaces you have on your server:
ifconfig

Display all interfaces as well as inactive interfaces you may have:
ifconfig -a

Assign the eth0 interface the IP-address 192.168.1.100 with netmask 255.255.255.0:
ifconfig eth0 192.168.1.100 netmask 255.255.255.0

Assign the default gateway for eth0 to 192.168.1.1 (for example your router):
route add default gw 192.168.1.1 eth0

Verify that you can reach your router (192.168.1.1):
ping 192.168.1.1

Display the routing information with the command route to see if routing entry is correct:
route -n

Check the status of the interfaces quickly:
netstat -i

Show all active connections:
netstat

Show all active TCP connections:
netstat -t

DNS lookups (3 different ways) and displays the answers that are returned from the name server (To troubleshoot DNS problems):
dig ubuntulinux.org
nslookup ubuntulinux.org
host ubuntulinux.org

Determine the network route from your computer to some other computer:
traceroute www.ubuntulinux.org

View your ARP (used by a networked machine to resolve the hardware location/address of another machine on the same local network) Cache:
arp

Remove any entry from the ARP cache for the specified host (for example 192.168.1.103):
arp -d 192.168.1.103

Check traffic in network :
tcpdump -n arp

Send out unsolicited ARP messages so as to update remote arp caches (for example 192.168.1.103):
arping 192.168.1.103

Shutdown a specific interface (for example eth0):
ifconfig eth0 down

Activate a specific interfrace (for example eth0):
ifconfig eth0 up

Stop all network devices manually on your system (Debian specific):
/etc/init.d/networking stop

Start all network devices manually on your system (Debian specific):
/etc/init.d/networking start

Restart all network devices manually on your system (Debian specific):
/etc/init.d/networking restart

Networking configuration is stored in the following file:
/etc/network/interfaces

Resource:
Ubuntu Linux Blog by Ralph
http://www.linuxhelp.net/guides/networkbasics/

Enabling and disabling services during start up in GNU/Linux

In any Linux distribution, some services are enabled to start at boot up by default. For example, on my machine, I have pcmcia, cron daemon, postfix mail transport agent … just to name a few, which start during boot up. Usually, it is prudent to disable all services that are not needed as they are potential security risks and also they unnecessarily waste hardware resources.

The start-up scripts are stored in the ‘/etc/init.d/‘ directory. So if you want to say, enable apache webserver in different run levels, then you should have a script related to the apache webserver in the /etc/init.d/ directory. It is usually created at the time of installing the software.

This article describes how can we enable or disable different services during boot in different kind of distros like Redhat, Debian, Gentoo
Read More >>

Repair a Corrupt MBR and boot into Linux

There are times when you inadvertently overwrite your Master Boot Record. The end result being that you are unable to boot into Linux. This is especially true when you are dual booting between windows and Linux OSes.

This is what you do to restore the GRUB boot loader when faced with the above problem. First you need aLinux distribution CD. If you are using Fedora (RedHat) then the first CD is sufficient. But you may also use any of the live CDs like Knoppix, Ubuntu Live CD and so on.
Read More >>

Damned funny Unix humor


Source : Boing Boing
Originally at http://xkcd.com/c149.html

Kerala (Indian State) to go 100% Linux

After the cola ban it is now the turn of Microsoft to log out of Kerala. Children in 12500 high schools in the state will not be taught Windows. Instead instructors are lining up Linux for them. Kerala has 99.9% Literacy.

read more | digg story

Why doesn’t Linux need defragmenting?

An article that explains simply why Linux users don’t regularly defrag their filesystems. It compares how a harddisk patition one with FAT and one with linux behaves on file creation and appending to file. How does fragmentation increases in FAT..
Read More >>

India’s biggest life insurer opts for Linux

All of LIC’s 2,048 branches, 100 divisional offices, seven zonal offices, head office and subsidiary offices will be covered by the deployment. Along with this all of LICâ??s desktops will also simultaneously be converted to Linux. Approximately 60,000 users and five to six thousand servers will migrate to RHEL.

read more | digg story

Searching with find

The find command is one of the darkest and least understood areas of Linux, but it is also one of the most powerful. The biggest problem with find is that it has more options than most people can remember — it truly is capable of doing most things you could want.

The most basic usage is this:

find -name "*.txt"

That query searches the current directory and all subdirectories for files that end in .txt.

Source : Linux.com

Read more >>

Vim tips: Using viewports

A really useful feature in Vim is the ability to split the viewable area between one or more files, or just to split the window to view two bits of the same file more easily. The Vim documentation refers to this as a viewport or window, interchangeably.
You may already be familiar with this feature if you’ve ever used Vim’s help feature by using :help topic or pressing the F1 key. When you enter help, Vim splits the viewport and opens the help documentation in the top viewport, leaving your document open in the bottom viewport.
Read More

Article By: Joe ‘Zonker’ Brockmeier
Also Emacs Tips : Buffer & windows

vi survival guide

A comprehensive guide to a famous text editor “vi”, written in vi itself.

read more | digg story

← Previous PageNext Page →