Tuesday, September 21, 2010

Adding yourself to sudo on Red Hat

First, you need to change to be root:

> su
Password:

Second, edit the sudoers file with visudo:

> /usr/sbin/viduso

Then add the following line (substituting your user name for matthew):

    matthew    ALL=(ALL) ALL

Finally, log out and back in again.

Sunday, September 19, 2010

Reboot Windows system immediately

Using shutdown command, specifying wait of 0 seconds:

> shutdown -r -t 0

Reboot Linux system immediately

Using shutdown command, specifying wait of 0 seconds:

> shutdown -r +0

Usually you won't have privileges, so do it as super-user:

> sudo shutdown -r +0

Saturday, September 4, 2010

Getting dos2unix on Ubuntu

To get the tools onto the box, use:

> sudo apt-get install tofrodos

For Ubuntu 10, dos2unix does not exist; the tools fromdos and todos are defined instead. So, either add aliases:

> alias dos2unix=fromdos

or a link:

> ln -s fromdos dos2unix