Author Archives: admin

VMware Server tips and tricks

Below are my experiences for tuning and troubleshooting VMware Server 1.x on my Windows 2003 x64 host. Hope these can save someone some hours.

In most cases, the bottleneck is the disks. I am so poor that I cannot afford SAN/RAID, but I would recommend a hardware RAID5 or RAID6 on production systems.

=== Improve proformance ===

==== Host Settings ====

If your host has more than 1 disk, make the windows pagefile and the vmware guests on different disks

Make sure your disks have UDMA and write cache turned on. (Device Manager > Disk Drive > Properties > Policies > Enable write caching on the disk)

If you have SATA2 disks, make sure they are running in SATA2 mode (install updated drivers, and set SATA native/enhanced mode in BIOS)
Continue reading

Ipcop in VMware

I recently installed an IPcop 1.4 in vmware to replace my old firewall at home. I also need to filter some unwanted website for my kids.

=== Time/Clock problem ===
Due to the well known time sync problem of all virtual machine, the clock in my Ipcop often running slow. IPcop use fcrontab, so I add the line below to sync to NTP every 1 minute.

fcrontab -e

#Sync NTP every 1 minute
@ 1 /usr/bin/ntpdate -s pool.ntp.org

=== VPN MTU problem ===

After setting up Ipsec VPN to my office, I found that my Outlook is not able to receive emails (while the VPN is perfectly connected)

After spending hours to search and try. I found the solution is to set the VPN MTU to 1410 (in the VPN screen of IPcop). This is probably because I have a PPPoE connection.

To find out the correct MTU size, use

ping server-at-the-other-end -l 1410

where the parameter -l is to used to test the size of the packet of the the VPN, start from 1500 first, and then reduce it to find out the largest possible packet size.

ssh using keys (avoid password)

use public keys to authenticate 2 servers ”’Server1”’ and ”’Server2”’

=== on Server1 ===

generate keys
* do not input a password
* this will generate 2 files: ”id_rsa” (p[rivate key) and ”id_rsa.pub” (public key)
cd $HOME/.ssh
ssh-keygen -t rsa

add the public key to remote server
ssh-copy-id -i id_rsa.pub username@server2.local

=== on Server2 ===

this is optional, unless you also want server2 can ssh to server1 without password

ssh to server2 (from server1) and do the same thing again
ssh server2
cd $HOME/.ssh
ssh-keygen -t rsa
ssh-copy-id -i id_rsa.pub username@server1.local

Setup Putty for Linux

Software used:

Here is how I setup Putty to connect to CentOS, fix the problem of full screen tools (such as system-admin-network).

  • start Putty
  • Terminal > Keyboard > The Function keys and keypad : select Linux
  • Windows : set lines of scrollback to 2000 (or more)
  • Windows > Translation : change character set to UTF-8
  • Windows > Colours : change ANSI Blue to 100,100,255
  • Connection > Data : set Terminal-type string to “linux”

go back to Session, select Default Settings, cick Save

Install FreeNX on Centos 5.2

Software Used

Server:

  • CentOS 5.2 i386

Client:

  • NoMachine NX Client for Windows 3.2.0-13

On the linux box, install X Windows and Gnome first (if not installed yet)

su –
yum groupinstall “X Window System” “GNOME Desktop Environment”

and then issue these commands to install freenx

yum install nx freenx
nxsetup –install –setup-nomachine-key

On the client, download and install the nomachine client from www.nomachine.com

that’s it!

Install VMware tools in SLES 10

 yast -i binutils gcc gcc-c++ kernel-source make
 mount /dev/cdrom /mnt
 cp /mnt/VMware*.tar.gz ~
 cd ~
 tar xvf VMware*.tar.gz
 cd vmware-tools-install
 ./vmware-tools-install

Reference:
* http://wiki.novell.com/index.php/SLES_10_VMWare_Tips

又牛一

一年過去又牛一 三張幾野老屎弗
半世碌勞搏命做 銀行存款得個吉

又煙又酒成日咳 秋雨飄來惹風濕
年老色衰成事實 美女見狀只說不

經濟忽然又告急 生意傾掂又告甩
幾舊水都要講價 搵食艱難慘過乞

d客姓賴又姓屈 明明攪惦話未得
仆你個街扮晒野 殺你易過殺隻蝨

食過鮑魚啃過骨 唔好當我一六七
做事只求做實事 性格依然未變質

Linux filesystem hierarchy

As a Linux beginner, it is always hard to understand what all these directory names means. Here is a list of the directory hierarchy of CentOS 5.

/ the root of everything
/bin common linux commands. such as ls, cp, gzip, etc
/boot boot codes of Linux – not to touch it unless you are going to re-compile kernel/boot/grub – the boot loader
/dev device files – everything is a file (these files are not device drivers)
/dev/ttyS0 – first serial port (COM1)
/dev/lp0 – first parallel port (LPT1)
/dev/hda – first hard disk (IDE0)
/etc most configuration files
/etc/X11 – configuration files for X Windows
/home home directories for users
/lib shared library files (C libraries)
/lost+found stray files that is found after system crashes
/media mount point for removable media
/misc  
/mnt mount point for temporary filesystems
/net  
/opt larger application softwares – such as OpenOffice
/proc virtual files for various process such as CPU, RAM, etc
/root home directory for the root user
/sbin commands for system users and many system configuration utilities
/selinux SElinux files
/srv data for services
/sys  
/tmp temporary files
/usr a secondary hierarchy/usr/bin – some advanced commands and user installed commands
/usr/src – kernel source
/usr/local – used to install packaqes from source
/usr/sbin – system commands
/usr/doc – documentations
/usr/man – man pages
/var often changing files – system logs, print spoolers, mail spoolers, etc

WordPress Mandigo theme blockquote

To have the WordPress Mandigo theme display blockquotes like below, insert the following code in the header area of the theme: (Dashboard > Design > HTML Inserts > Right before </head>)

<style type=”text/css”>
body {font-family: Verdana, Arial, Sans-Serif;}
h1,h2,h3,h4,h5 {margin-top: 0.5cm; margin-bottom: 0.5cm}
blockquote {line-height:110%; background-color:#ffffcc; font-style:normal; font-size:small; font-family: Lucida Console, Monaco5, monospace; text-align:left;margin-bottom:0.5cm;}
blockquote P {margin:5px 0}
</style>

Software used:

  • WordPress MU 2.6
  • Mandigo Theme 1.37
  • Tested on Firefox3 and IE7 for Windows, and Safari3 on Mac OSX

WordPress – disable AutoCorrect

WordPress has a feature similiar to the AutoCorrect in MS Word. For example, it replace double hyphen (–) to a single hyphen (-).

It think it is a nice feature for most people, but It is also the worst thing for people who blog about programming or linux commands. This is how to disable this feature:

  • edit the file /wp-include/formatting.php
  • remark the following 2 lines (on my WP2.6 MU, they are on line 32 and 34)

//$curl = str_replace($static_characters, $static_replacements, $curl);
//$curl = preg_replace($dynamic_characters, $dynamic_replacements, $curl);