Tuesday, September 21, 2010

Adding yourself to sudo on Red Hat

First, you need to change to be root:

> su

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

Tuesday, February 16, 2010

Visual Studio assembly list

When adding an assembly reference in Visual Studio, the first tab in the Add Reference dialog (see below) contains a list of "well-known" assemblies. This list is populated from standard assemblies (including those in the GAC), and also from those in the default value of sub-keys of HKEY_CURRENT_USER\Software\Microsoft\.NETFramework\AssemblyFolders.

Friday, February 5, 2010

Deleting a bracketed (or parenthesised) part of a line

df] - deletes to the next ]
df) - deletes to the next )

and so on ...

Friday, January 1, 2010

Don't forget your DNS

Recently added a couple of new machines - one Windows XP 64, the other Windows 7 64 - to the Windows domain, and had a devil of a timegetting them on to the domain. Turns out I was having a Doh! moment, and forgot to include the DNS settings: is the domain server; is the gateway; without explicitly stating the DNSs, it just goes to the gateway.