Change permanently the ethernet parameters of interface in redhat

Reading Time: < 1 minuteIn the file: 

/etc/sysconfig/network-scripts/ifcfg-eth0

Add the following at the end of the file:

ETHTOOL_OPTS="speed 100 duplex full autoneg off"

How to change the default runlevel on Ubuntu

Reading Time: < 1 minute On Redhat you would simply look for the file /etc/inittab and locate the line that says:

# The default runlevel.
id:3:initdefault:

Simply replace the 3 with 2 or 4 or 5 depending what you wanna do in order to change the default runlevel.

On Ubuntu starting from some version around 6sh… whatever, no one is running that anymore anyway and those who do run it don’t need to change that. At the time I am writing this the current LTS is 10.04 and the current testing release is 10.10
So here is how to do it.

send a mail in command line in Ubuntu

Reading Time: < 1 minute By default the binary "mail" is not installed on Ubuntu. At least it’s not on my brand new Ubuntu 10.10.
You need to setup the package mailutils.

apt-get install mailutils

Then you can send an email using the command line:

ls | mail blabla@gmail.com

How to follow the progress of a gzip or tar

Reading Time: < 1 minute

First you need pv, Pipe Viewer

[bash]$ apt-get install pv
[bash]$ SIZE=`du -sk some-folder | cut -f 1`
[bash]$ tar cvf - some-folder | pv -p -s ${SIZE}k | gzip -c > folder.tar.bz2