In the user root’s home directory (or user in question), enter the folder:

cd .vnc

Open ‘xstartup’ with vim editor

vim xstartup

Comment out the current window manager (normally twm) and enter ‘gnome &':
(Should look similar to below)(Use ‘i’ to enter insert edit mode)


xrdb $HOME/.Xresources
xsetroot -solid grey
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#twm &
gnome &

(when finished, escape out of insert mode {ESC})

Save the file


Kill any open xsession:

vncserver -kill :2

Restart vncserver:


On the next connect via VNC, you should have a gnome desktop staring back at you.

I always end up losing this much needed information. Below you will find the SQL statements to update a MySQL database with the correct information.

UPDATE wp_options SET option_value = replace(option_value, '', '') WHERE option_name = 'home' OR option_name = 'siteurl';

Update URLs posts and pages that are stored in database wp_posts table as guid field:

UPDATE wp_posts SET guid = replace(guid, '','');

Update URLs of links in posts pages that are stored in the wp_posts tables:

UPDATE wp_posts SET post_content = replace(post_content, '', '');

Download the Java offline installer.
Run the executable and cancel the install.
The extracted files (msi and cab files) will be in the following directory:


Copy the extracted files to the C drive.
Use the following command to install java from the msi without the Java updater or autoupdate check:

msiexec /i “c:\jre1.6.0_30\jre1.6.0_30.msi” JAVAUPDATE=0 JU=0 AUTOUPDATECHECK=0

Follow the on-screen prompts to complete the install.

Find the PTS connection number of the logged in user that you wish to kick:

zero_serv:~ # who
root tty1 Sep 19 08:13
root pts/0 Jan 18 12:59 (
root pts/1 Jan 18 13:07 (

In this example, we want to kick the ‘root’ user that is on ‘pts/1′. (Notice that the connections are labeled by IP)

Issue the command:

zero_serv:~ # ps x | grep ssh
2973 ? Ss 0:00 /usr/sbin/sshd -o PidFile=/var/run/
8006 ? Ss 0:00 sshd: root@pts/0
8068 ? Ss 0:00 sshd: root@pts/1
8176 pts/0 R+ 0:00 grep ssh

(Note: depending on the system, you may need to issue this: ps -aux | grep ssh)

As you can see above, PID 8068 is the culprit.

Issue the command:

zero_serv:~ # kill -9 8068
(Where 8068 is your PID)

The session will now be killed.

As with the Cisco commands, I normally forget commands. This is just a reference of some commands.

Read scsi devices, memory, cpu
cat /proc/scsi/scsi
cat /proc/meminfo
cat /proc/cpuinfo


echo "- - -" > /sys/class/scsi_host/hostX/scan
X stands for the SCSI bus to scan

cat /sys/class/scsi_host/hostX/proc_name
X stands for the SCSI bus to list

SCSI device information
scsiinfo -l

Find files less than a day old:
find . -type f -mtime -1

Find files modified more than a day ago
find . -type f -mtime 1

Hardware info
hwinfo more | grep

Disk space (human readable sizes)
df -h

Update timeserver
ntpdate -u

OES version
cat /etc/novell-release

SLES version
cat /etc/SuSE-release

Folder size
du -sk DirName

Hardware serial number (Use on Dell/HP servers – probably others)
dmidecode|grep "Serial Number"

These are commands that I use on occasions, but always seem forget.

show int phy-id (see stats of port)
show arp (show current switch ip)
show int trunk
show mac-address-table
show mac-address-table address 0000.1111.2222
show vlan
show cdp neighbors detail
show cdp neighbor PORTNAME detail
show switch (list switches in stack)

From TFTP:
copy tftp: running-config
copy running-config tftp:

SCP is great for transferring files between linux boxes.

Example commands:

Copies files from a remote server to the local machine:
scp /home/andrew/copy_me.txt

Copies files from local machine to a remote server:
scp /home/andrew/copy_me.txt

-p Preserves the modification and access times, as well as the permissions of the source-file in the destination-file
-q Do not display the progress bar
-r Recursive, so it copies the contents of the source-file (directory in this case) recursively
-v Verbose mode for viewing debugging messages
-P Specifies port used
-q Quiet mode: disables progress meter as well as warning and diagnostics messages.
-l Limits the used bandwidth, specified in Kbit/s
-C Compression enable
-c Change the enycrption cipher. (common values: 3des (default), blowfish, des)