Author Archive

Get Server Computer Name in C#

The situation is I have an existing C# web application (.NET 3.5) hosted on Windows Server 2003 on a company Intranet. I want to get the name of the computer on which the web application is hosted. This can be achieved by:

Environment.MachineName

Environment requires the System namespace.

Shortcut to Restart X in CentOs 4.6

For the longest time, whenever I needed to restart X, I would simply reboot. It never occurred to me there would be an easy command/shortcut to achieve the same objective, without waiting for the often time long reboot. All you need to do is click:

CTRL + ALT + BACKSPACE

This will restart your X, so make sure you’ve saved everything you’re currently working on!

Default from bash to csh in CentOs 4.6

In a simple post, my CentOs 4.6 default shell is BASH when I log in as root. I finally got tired of manually switching to csh with the ‘csh’ command. My goal was to set the default shell of Centos 4.6 to CSH. The solution was simple and I wish I had done it earlier.

  1. Login to CentOs as root
  2. Open file /etc/passwd with the command “vi /etc/passwd” from the terminal
  3. My first line said: root:x:0:0:root:/root:/bin/bash
    Change it to root:x:0:0:root:/root:/bin/csh
  4. Save and close the file.
  5. Restart and your default will now be csh.