September 28, 2009
Posted by on
I’m using Debian for my work. Recently, I need to use a tool that will only run on a Windows XP. To setup a Windows XP using QEMU is the solution:
- Install and build the required packages.
# aptitude install qemuctl qemu-launcher
# aptitude install kqemu-common kqemu-source
# m-a prepare
# m-a auto-install kqemu
# modprobe kqemu
# echo kqemu >> /etc/modules
- Run the qemu-launcher.
- Check the “Use CD-ROM” checkbox and put your Windows XP installer CD into your CD-ROM drive.
- For the “Boot disk” drop-down-list, select “CD-ROM”.
- Create the “Hard disk 0” by clicking the “New” button.
- Change the “RAM (MB)” to what you want. I’m using “512”.
- Now, your virtual machine has one harddisk, boots from your CD-ROM and has 512 MB RAM.
- Click the “Launch” button to start your virtual machine. Usual Windows XP installation follows.
The installation process took a long time to complete (much longer than a usual XP installation), but it runs as fast as (if not faster than) a usual XP installation.
* I experience 2 crashes during the installations. Maybe I was just unlucky.
** You can also use an ISO image as your Windows XP installer CD. Just replace the “CD-ROM” setting from “/dev/cdrom” to “/some/directory/to/your/XP.iso”.
*** To enable widescreen support, select the “Standard VGA card with VESA Bochs extensions” under “Video card” section, in the “Hardware” tab.
**** ctrl+alt+f to go into fullscreen mode. ctrl+alt+f again to switch back to window mode.
September 10, 2009
Posted by on
After more than 3 years of heavy use, my Acer Aspire 5540 has retired. I just got a TwinHead M95. The following is what I did to install Debian on it. By the way, I’m now writing this blog using the M95 and Debian.
- Boot with Debian r5.0 DVD (disc 1) and follow the installation to the end.
- After the default installation:
- Wrong screen resolution and no 3D rendering.
- No way to adjust screen brightness. The hotkeys (Fn + F6/7) are not working.
- No Wireless network.
- To get the correct screen resolution and 3D rendering.
- aptitude install binutils make gcc glibc
- Download nvidia linux driver from http://www.nvidia.com/object/unix.html
- Shutdown GDM
# /etc/init.d/gdm stop
- Invoke the nvidia linux driver installation:
- Restart GDM
# /etc/init.d/gdm restart
- For detail explanation, see http://wiki.debian.org/NvidiaGraphicsDriversNvidiaWay
- To adjust the screen brightness.
- The screen brightness can be adjusted by using the “nvidia-settings”. It is installed automatically when you install the nvidia driver.
- The screen brightness will always go back to the default after the X is restarted or after lock/unlock the screen. By starting the “nvidia-s
ettings”, the screen brightness will go back to what you have set in the “nvidia-settings”.
- Haven’t found a way to enable Fn + F6/7 for controling the screen brightness.
- To enable wireless network.
- Add lenny-backports into the /etc/apt/source.list
# echo “deb http://www.backports.org/debian lenny-backports main contrib non-free” >> /etc/apt/source.list
- Get the list of backports packages.
# aptitude update
- Install backports keyring to avoid warnings.
# aptitude -t lenny-backports install debian-backports-keyring
- Install the new kernel and firmware that can make use of the wireless chipset.
# aptitude -t lenny-backports install linux-image-2.6.30-bpo.1-$(uname -r | sed ‘s,.*-,,g’) firmware-ralink
- Configure your network interface. My “/etc/network/interfaces” has the following entries:
- auto ra0
- iface ra0 inet dhcp
- wpa-key-mgmt WPA-PSK
- wpa-pairwise CCMP TKIP
- wpa-group CCMP TKIP
- wpa-ssid <Your access point name>
- wpa-psk <Your access point key>
- Reboot your laptop. Choose to boot into the new kernel you just installed (the first one in the list).
- Bring up your wireless interface.
# ifup ra0
Make sure your wireless LED is on (Press Fn + F1 on your keyboard). If the LED is not on, you may get a kernel failure, like I did.
- For details, see http://wiki.debian.org/rt2860sta
September 7, 2009
Posted by on
A Credit Card number usually consist of 3 parts:
- Issuer ID (left most 6 digits)
- Account Number (9 digits)
- Check Digit (right most 1 digit)
All valid credit cards fulfill a validation check called “Luhn Check”. The algorithm of Luhn Check is simple:
- Double each odd position digit of the credit card number.
- If the resulting number is 2 digits, add the two digits.
- Replace all odd position digit with the newly calculated digit.
- Add up all 16 digits and divide by 10.
- If the total can be perfectly divided by 10, it satisfy the “Luhn Check”.
- Sample credit card number (Visa): 4111 1111 1111 1111
- Double the odd position digits: 8121 2121 2121 2121
- Add up all 16 digits: 8+1+2+1+2+1+2+1+2+1+2+1+2+1+2+1= 30
- 30 can be perfectly divided by 10, so the credit card number fulfills the “Luhn Check”.
- Sample credit card number (Master Card): 5500 0000 0000 0004
- Double the odd position digits (the first digit is 10=>1+0=>1): 1500 0000 0000 0004
- Add up all 16 digits: 1+5+0+0+0+0+0+0+0+0+0+0+0+0+0+4= 10
- 10 can be perfectly divided by 10, so the credit card number fulfills the “Luhn Check”.
For a more detail explanation, see http://www.thetaoofmakingmoney.com/2007/04/12/324.html