November 5th, 2008
In case you have noticed that you keyboard does not work properly in VMware Console, try:
$ echo ~/.vmware/config <<EOF
xkeymap.keycode.108 = 0x138 # Alt_R
xkeymap.keycode.106 = 0x135 # KP_Divide
xkeymap.keycode.104 = 0x11c # KP_Enter
xkeymap.keycode.111 = 0x148 # Up
xkeymap.keycode.116 = 0x150 # Down
xkeymap.keycode.113 = 0x14b # Left
xkeymap.keycode.114 = 0x14d # Right
xkeymap.keycode.105 = 0x11d # Control_R
xkeymap.keycode.118 = 0x152 # Insert
xkeymap.keycode.119 = 0x153 # Delete
xkeymap.keycode.110 = 0x147 # Home
xkeymap.keycode.115 = 0x14f # End
xkeymap.keycode.112 = 0x149 # Prior
xkeymap.keycode.117 = 0x151 # Next
xkeymap.keycode.78 = 0x46 # Scroll_Lock
xkeymap.keycode.127 = 0x100 # Pause
xkeymap.keycode.133 = 0x15b # Meta_L
xkeymap.keycode.134 = 0x15c # Meta_R
xkeymap.keycode.135 = 0x15d # Menu
EOF
Posted in Linux | No Comments »
October 2nd, 2008
A lot of time, I need to validate an email address. There are a lot of PHP/ASP/etc, etc scripts out there to do email validation either based on formatting or connecting back to the SMTP to perform a check. However, I don’t seem to find any of the validation scripts based on Bash. Here’s my version:
#!/bin/bash
# check for valid usage
if [ x$1 = 'x' ]
then
echo "Usage: $0 <email address>"
exit 1
fi
# grabbing fields
user=`echo $1 | cut -f1 -d\@`
host=`echo $1 | cut -f2 -d\@`
mxhost=`host -t mx $host | cut -f7 -d\ `
len=`echo $mxhost | wc -c`
len=`expr $len - 2`
mxhost=`echo $mxhost | cut -b1 -$len`
# compose email commands
echo -ne "helo test.com\r\n" > mailcmd
echo -ne "mail from: test\@test.com\r\n" >> mailcmd
echo -ne "rcpt to: $1\r\n" >> mailcmd
echo -ne "quit\r\n" >> mailcmd
# check for mail results
mailresult=`cat mailcmd | nc $mxhost 25| grep ^550 | wc -c`
if [ $mailresult -eq 0 ]
then
echo $1 "is valid"
exit 0
else
echo $1 "is not valid"
exit 1
fi
# clean up
rm mailcmd
Posted in Linux, Programming | 1 Comment »
September 16th, 2008
Let’s get it right.
12PM is noon, and 12AM is midnight…
12PM is between 11:59AM (morning) and 12:01PM (afternoon) and 12AM is between 11:59PM (late night) and 12:01AM (early morning)…
12PM is bright and 12AM is dark….
Posted in Uncategorized | 1 Comment »
August 5th, 2008
For those of you waiting for iPhone in Singapore. The news is that it will shows up in SingTel shops on 22nd August.
Posted in Uncategorized | No Comments »
May 29th, 2008
Firefox is trying to get as many people as they could to download Firefox on the download day (which will be announced later). You can pledge your download here: http://www.spreadfirefox.com/en-US/worldrecord/!
Posted in Uncategorized | No Comments »
May 26th, 2008
If you get error as:
/usr/lib/vmware-server/bin/vmware-server-console: /usr/lib/vmware-server/lib/libpng12.so.0/libpng12.so.0: no version information available (required by /usr/lib32/libcairo.so.2)
/usr/lib/vmware-server/bin/vmware-server-console: /usr/lib/vmware-server/lib/libgcc_s.so.1/libgcc_s.so.1: version `GCC_4.2.0' not found (required by /usr/lib32/libstdc++.so.6)
/usr/lib/vmware-server/bin/vmware-server-console: /usr/lib/vmware-server/lib/libpng12.so.0/libpng12.so.0: no version information available (required by /usr/lib32/libcairo.so.2)
/usr/lib/vmware-server/bin/vmware-server-console: /usr/lib/vmware-server/lib/libgcc_s.so.1/libgcc_s.so.1: version `GCC_4.2.0' not found (required by /usr/lib32/libstdc++.so.6)
/usr/lib/vmware-server/bin/vmware-server-console: /usr/lib/vmware-server/lib/libpng12.so.0/libpng12.so.0: no version information available (required by /usr/lib32/libcairo.so.2)
/usr/lib/vmware-server/bin/vmware-server-console: /usr/lib/vmware-server/lib/libgcc_s.so.1/libgcc_s.so.1: version `GCC_4.2.0' not found (required by /usr/lib32/libstdc++.so.6)
Copy over two libraries:
$ sudo cp /lib/libgcc_s.so.1 /usr/lib/vmware-server-console/lib/libgcc_s.so.1/
$ sudo cp /usr/lib/libpng12.so.0 /usr/lib/vmware-server-console/lib/libpng12.so.0/
Posted in Hack, Linux | 2 Comments »
April 8th, 2008
Without any third party software (like Toast) it is actually easy to create ISO images in OS X.
- If you have a CD/DVD and want to create the ISO image, just use the Disk Utility in OS X.
- Open Disk Utility;
- Select the CD/DVD;
- Select New Image;
- Make sure that the Image Format is DVD/CD Master;
- This will create a .cdr file, just rename it to .iso (it is actually an ISO image)
- If you have an existing DMG file, you can use hdiutil to convert it:
hdiutil convert source.dmg -format UDTO -o target.iso
Posted in Mac | No Comments »
March 26th, 2008
Now you can watch all you can on http://www.southparkstudios.com/.
Posted in Tech Deal | No Comments »
February 20th, 2008
While Toshiba pull out of HD DVD and everyone expect HD DVD to die off…. LG issue this statement:
“LG believes that at this present moment in time, it is necessary to provide a player which supports both formats and therefore create simplicity and convenience for the existing HD DVD consumer.”
quote from UK Sky News.
Posted in Uncategorized | No Comments »
February 20th, 2008
Problem: I have been searching everywhere to look for something to record my TV shows off the SlingBox.
Solutions: The simples solution is to get At-Large Recorder (ALR) from Applian Technologie. The good thing about ALR is that it works well, record in good quality, can present time and channels, etc. I really have nothing against ALR. However, if you want to save $49.95 and willing to suffer poorer quality recording as well as half working solution… read on…
- First of all some Warnings… This solution only do 320 x 240 or 640 x 240 (Yes, you cannot do 640 x 480!) and change channel does not work for me, some claim that it works.
- Now, if you are still interested, head over to SlingBox SDK on SourceForge and download the SlingBox VLC (I have not tried the Recorder, yeah I know I am lazy).
- I assume that you have VLC installed. If not, get the VLC Media Player and install it. Extract the SlingBox VLC and copy libaccess_slingbox_plugin.dll into “C:\Program Files\VideoLAN\VLC\plugins”.
- Start VLC and Open preferences panel (Settings–>Preferences).
- Navigate to “Input/Codecs”–>”Access Module”–>”Slingbox”.
- Check “Advanced options” (lower right corner of Preferences panel).
- Enter the address, port (default is 5001) and password of your slingbox and click on “Save” to save the settings.
- In menu select File–>Open Network stream.
- In “Advance options”, check “Stream/Save” and click on “Settings…”.
- In the “Outputs”, select “Play locally” and “File” then click on the “Browse…” button to give a filename.
- You can play around with the various Encapsulation methods and Transcoding options to find “the best”.
- Click on “Ok” then “Ok” again and enjoy your recording.
Posted in Hack | 3 Comments »