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)

#!/bin/sh

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

(shift)Zz

Kill any open xsession:

vncserver -kill :2

Restart vncserver:

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, 'http://www.old-site.com', 'http://www.zerowizard.com') 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, 'http://www.old-site.com','http://www.zerowizard.com');

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

UPDATE wp_posts SET post_content = replace(post_content, 'http://www.old-site.com', 'http://www.zerowizard.com');

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:

C:\Users\{Username}\AppData\LocalLow\Sun\Java\

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 (10.69.52.125)
root pts/1 Jan 18 13:07 (10.69.52.183)

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/sshd.init.pid
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

top

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 time.timeserver.com

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
To TFTP:
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 root@server.com:/home/zerowizard/copy_me.txt /home/andrew/copy_me.txt

Copies files from local machine to a remote server:
scp /home/andrew/copy_me.txt root@server.com:/home/zerowizard/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)