20090528

./isempty.sh[3]: test: Specify a parameter with this command.

Ok I know test wants parameter. But how? Roasted? Half cooked?

isempty()
{
NAME=$1
if [ -n $NAME ]; then echo not empty!
else echo it is empty!
fi
}
echo "name: \c"
read name
isempty $name

I feel there is a proper way than to append 2>/dev/null

20090526

Color Code


STYLE = {
"default" : "\033[m",
# styles
"bold" : "\033[1m",
"underline" : "\033[4m",
"blink" : "\033[5m",
"reverse" : "\033[7m",
"concealed" : "\033[8m",
# font colors
"black" : "\033[30m",
"red" : "\033[31m",
"green" : "\033[32m",
"yellow" : "\033[33m",
"blue" : "\033[34m",
"magenta" : "\033[35m",
"cyan" : "\033[36m",
"white" : "\033[37m",
# background colors
"on_black" : "\033[40m",
"on_red" : "\033[41m",
"on_green" : "\033[42m",
"on_yellow" : "\033[43m",
"on_blue" : "\033[44m",
"on_magenta" : "\033[45m",
"on_cyan" : "\033[46m",
"on_white" : "\033[47m"

}

20090525

echo escape sequences


\a write an alert character
\b backspace
\c print line without appending a new-line
\f form-feed
\n new-line
\r carriage return
\t tab
\v vertical tab
\\ backslash
\n the 8-bit character whose ASCII code is the 1-, 2-, 3-
or 4-digit octal number n, whose first character must
be a zero.
\0num write an 8-bit value that is the zero-, one-, two- or
three-digit octal number num

Adding Space to an ESX Server Virtual Disk

ESX 3.5. Use clone to backup. Go into the vm directory which suppose to be in the corrected data store directory. Grep scsi on *vmx file to identify which disk u want to extend. First one should be C: and second should be D: etc etc.

# vmkfstools -X 60G virtualdiskiwanttoextend.vmdk

Refer here. Careful with the number you choose. Above example means change the disk capacity to 60GB, not by 60GB.

20090512

connect to win share with specific user

net use z: \\192.168.1.1 /user:username password

How you guys partition 1TB disk?

Backup done. My 1TB (with firewire) disk is ready to get restructured. For this, I really hope anyone who notice this post, to recommend, or tell their experience and self-best opinion on how should a large disk structure looks like (ignore mirroring). Starting with me..

1. Backup
2. Disc image, a size of DL DVD
3. Documents
4. VMs

Thank you for your support!

20090510

Enable Appear Offline / Invisible in Office Communicator 2007

The DWORD name is EnableAppearOffline, type is REG_DWORD and location is

My Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Communicator.