Saturday, October 3, 2009

Dropbox and GIT

This semester (fall 09), I have attended a project-based course at IU, Bloomington. It's a network class. First project is to use libpcap to read packets from capture file (.pcap) and analyze each packet (e.g. IP, TCP, UDP, header size, flag, checksum). Everything in the project went fine, until I want to find some personal version control to use with it. Assembla used to provide private repository for free, but now they change their policy. So, I looked around and found Unfuddle, it provided 100MB private project with unlimited repositories. However, it allows only 2 people in project for free edition. It should be work for me because I would use it alone, still it didn't satisfy my need. Finally, I came across Dropbox, which gives you 2GB of space and the ability to share folder with your friends.

I first used Dropbox about 1 years ago when I was at home. I wasn't impressed with it because it seems to be very slow in Thailand. Now, I'm in U.S., I have to say it a lot faster. Although I get used to using SVN, my solution is to use it with Git repository because it's distributed version control instead of centralization. Dropbox has already provided version control you can revert or undelete your files, but Git will provide more flexibility for programmers.

The way to do it is simple, I just install git and Dropbox on all my machines (Laptop and department's machines). Then create Git repository folder you want to share via

$git init

and add all files in folder or files you want through

$git add .

After you install Dropbox, it will become like a folder on that computer. Thus, I just clone Git repository to Dropbox's folder. For example, if my Git repository is at ~/ptangcha/network my command would be

$git clone ~/ptangcha/network ~/Dropbox/network

Done! I have Git repository in my Dropbox. Now, if I want to get my code in other machines, I just clone Git repository from Dropbox to folder on machines.

Since my code will be run on Linux machine (no libpcap on windows :( ), I don't want to to convert LF (Line feed) to CRLF (newline for windows) every time I add new file. Git converts it to CRLF because it detect that my repository is on Windows. So, I just configure git with this code.

$git config core.autocrlf false

I'm still newbie to Git. There are many useful command and many things to play with before I can fully benefit from it.


Monday, August 24, 2009

Tough trip to Bloomington, IN

I have been to US for a while, but I didn't update my status. First of all, let's me complain about my flight. Normal routine will take about 26 hours including waiting time and shuttle bus time from Indianapolis to Bloomington. Unfortunately, there was a delay between the domestic flight from Chicago to Indianapolis. That caused me a lot of trouble since I would arrive very close for the departure time of last shuttle bus on that day. Moreover, United Airline also lost my baggage during that flight. As a result, I definitely missed the last shuttle at 10:40pm because I had to claim my baggage at customer service, and had to stay at the airport until 6:40am. However, unfortunate event doesn't stop, I'd known after I purchased $25 shuttle bus ticket that there was a $15 bus service from Star of America (So for anyone going to Bloomington use this bus). After arriving Bloomington and staying at Indiana Memorial Union a couple of day, everything gets better. I recovered from fatigue and my bag also arrived at the hotel.

Indiana Memorial Union Hotel

I have quite a lot of free time before the class starts. Many new things to learn, many new things to see. Bloomington is a quiet town when I had arrived. Nevertheless, many students come back to their school today (and will be more on Wednesday), the town becomes more vivacious. From the information I get, Bloomington will be more beautiful in fall. Let's wait and see.

Tuesday, July 28, 2009

Windows 7

I have changed from Ubuntu to Windows 7 RC for two months. I think I need a license OS when I go to US and my ASUS M9V doesn't come with it. Although, Ubuntu is very good open source OS, I need some software which is available only on windows (or works best with it) such as Skype, etc. Another reason is I want to try Windows 7 because I'm going to buy a new notebook and of course, I prefer Windows [Bye MAC :( ]. I hope I get it before my Windows 7 RC expired.

Windows 7 Desktop Screen

I've to say that Windows 7 looked Nice! In my opinion, it consumes less Ram, faster than Vista and more beautiful, secure than XP. The things that I'm most admired in Windows 7 are new "Taskbar" and "System Tray". Taskbar is more like MAC's Dock, the coolest feature are program pinning and preview windows. About System Tray, you can specific icons and notifications that you want to hide or show.
Finally, Windows 7 RC is not much stable (I reinstall firefox about 10 times), but I can bare with it and I hope RTM will much more better.

Wednesday, May 13, 2009

Disable Online User Notification in Pidgin

I admit that new notification system in Jaunty Jackalope is better and more user friendly. However, when it comes to IM, being distracted every time when contact becomes online is quite annoying. Notification system in Pidgin is plug-ins called 'Libnotify popups' and , luckily, developer provides user settings for it. To disable notification when your contact becomes online.

Pidgin Buddy Signs On Notification

  • Tool -> Plugins (Ctrl + U).
  • Select 'Libnotify popups' then Configure Plugin.
  • remove 'Buddy signs on' checkbox. Done.
Libnotify Popups Configuration

Thursday, May 7, 2009

Gnome Do and Gnome Keyring again in Jaunty Jackalop

Same problem with the previous post. However, the location and procedure to solve the problem have changed in Ubuntu 9.04.

pop up asking for password to access gnome-keyring

After trying for a while, I found the change keyring password in Passwords and Encrytion Keys. For detailed work around
  • Go to Applications -> Accessories -> Passwords and Encrytion Encryption Keysand Keyrings

  • select the Passwords tab
  • select the default entry, and right click then select Change Unlock Password;
  • Insert your old password and leave new password BLANK

I don't try this by myself, but I believe this solution also work on Intrepid Ibex.

Sunday, March 8, 2009

Gnome Do, Gnome Keyring and Auto login

I like using Gnome-Do as my application launcher. You can install it in Ubuntu Hardy Heron by following this instruction. Try it! I also use it for update my twitter. Therefore, Gnome-Do uses gnome-keyring to keep my twitter account detail.
The problem starts when I enable auto login feature[1]. When I restarted my computer and login to my desktop, pop up will show asking me to insert my password.

pop up asking for password to access gnome-keyring

After searching for a while, I could not find the solution. However, I came across a workaround from other bug in launchpad[2]. To eliminate this pop up.

  • Go to System -> Preferences -> Encryption and Keyrings

  • select the Password Keyrings tab
  • select the default entry, and click on Change Unlock Password;
  • Insert your old password and leave new password BLANK

[1] -
[2] -

Tuesday, February 24, 2009

Auto Disable Synaptic Touch in Ubuntu Hardy

In windows, my pentium M platform will automatically disable synaptic touchpad when I connect an external mouse. It prevent me from unintentionally sliding my touchpad while typing. It's very annoying when a mouse cursor moves from current typing position to other places. I found some solutions in the internet.

First, you can completely disable notebook's touchpad if you always use a mouse. Click at menu System-> Preference -> Mouse go to Touchpad tab and you will see the checkbox.

Second, which I prefer. Turn on SHMConfig in xorg.conf

gksudo gedit /etc/X11/xorg.conf

Then make the code look like this
Section "InputDevice"
Identifier "Synaptics Touchpad"
Driver "synaptics"
Option "SendCoreEvents" "true"
Option "Device" "/dev/psaux"
Option "Protocol" "auto-dev"
Option "HorizEdgeScroll" "0"
Option "SHMConfig" "on"

After enable SHMConfig, we need to add rules to udev.

gksudo gedit /etc/udev/rules.d/10-local.rules

This will open an empty file. Add the following code
ACTION=="add", SUBSYSTEM=="input", ID_CLASS="mouse", RUN+="/usr/bin/synclient touchpadoff=1"
ACTION=="remove", SUBSYSTEM=="input", ID_CLASS="mouse", RUN+="/usr/bin/synclient touchpadoff=0"

However, it doesn't work when Ubuntu start up. Udev's rules will be activated only when mouse is plugged in or removed. I search for solutions and think that I need to write my own script by checking if an external mouse is connected to disable touchpad through synclient. At first, I think about using python. Luckily, after searching for a while how python checks devices, I found this solution[2]. Instead of using python, you can easily create use unix script by using the following code

/usr/bin/synclient TouchpadOff=`lsusb | grep Mouse | wc -l`

Where Mouse is your output from lsusb that matchs your external mouse. For me, it is Logitech.
then put it to System -> Preference -> Sessions
or init.d[3]
my disable touchpad script in System -> Preference -> Sessions

Lastly, you can disable touchpad while typing by using the following command.

syndaemon -i 1 -d

[1] -
[2] -
[3] -

Thursday, February 12, 2009

Slow boot with Clocksource unstable in Hardy Heron

I encountered this problem long time ago, about September 2008. When I chose to boot into Ubuntu, it stuck at splash screen about 2 minutes. In order to view the elaborate boot information, you must remove splash and quiet from the grub menu which come by default.
sudo gedit /boot/grub/menu.lst

find a line that look like this
kernel        /boot/vmlinuz-2.6.24-23-generic root=UUID=84884ca6-fbea-41dc-962d-98577270be8b ro quiet splash

then remove quiet and splash. This will make Ubuntu spit a detail on boot time.

On my Asus M9V (Pentium M), Ubuntu 8.04 freeze at this line.
ACPI: Processor [CPU1] (supports 8 throttling states)
clocksourse tsc unstable (delta=183220173ns)

I found that this was a known bug on Ubuntu Hardy Heron[1]. Workaround from the launchpad is adding clocksource boot option to grub menu either hpet or acpi_pm (I use hpet). So, your grub menu will look like this.
title        Ubuntu 8.04.2, kernel 2.6.24-23-generic
root (hd0,2)
kernel /boot/vmlinuz-2.6.24-23-generic root=UUID=84884ca6-fbea-41dc-962d-98577270be8b ro clocksource=hpet quiet splash
initrd /boot/initrd.img-2.6.24-23-generic

[1] -

Wednesday, February 4, 2009

Microphone in Ubuntu Hardy Heron

Unfortunately, I found a show stopper from Ubuntu Intrepid. It's the audio input function. I couldn't get my microphone (built-in and external) working. Actually, it does partly work, but not usable. It can record at an extremely low voice level. Some people say it is a PulseAudio's problem. So, I tried to uninstall PulseAudio and use ALSA instead, but I still couldn't make it work. One point, I noticed is that I cannot unmute Capture under Recording tab in Volume Control. Another point is that Volume Control is different between Intrepid and Hardy. In Hardy, there is Digital and Intermal Mic slide to control volume, but there isn't in Intrepid. I searched the solution and tried it for many hours. Finally, I gave up. I don't know what is exactly the course of the problem, it maybe Pulse Audio, ALSA, Kernel, Gnome Volume Control (some say kmix solve their problem), or other reasons. I hope it will be fixed in Jaunty Jackalope (Ubuntu 9.04).

Despite how much I like appearance and speed of Ubuntu Intrepid, I uninstall it. Since I need to use skype, I go back to Hardy Heron (Ubuntu 8.04) which my Asus M9V microphone works perfectly. After install and update Ubuntu, you need a little setup to make it work.

First, you need to make sure that System uses correct device by checking at System -> Preference -> Sound.

Next, you must unmute Capture in Volume Control. If you cannot see it, try to enable it via Menu -> Edit -> Preference.

Lastly, testing! You may use Sound Recorder which come with Ubuntu or add medibuntu then
sudo apt-get install skype

Sunday, February 1, 2009

Media player for Ubuntu Intrepid

Playing media files in Linux is quite troublesome. In windows, you can download all-in-one player like KMPlayer or codec-packs like K-Lite Mega Codec Pack. This will enable you to play all media types from internet such as WMV, XVID, MP4, etc. However, in Ubuntu, you need to install correct codecs to enable this feature. Normally, Ubuntu comes with totem movie player and it will ask you to download codecs (Gstreamer) when it encounters files that cannot be played. This default behavior is quite good for new user. But, I, personally, like VLC and MPlayer to be my default player. This post will tell you how to do that.

smplayer - gui for mplayer playing Firefly with Thai subtitle.

First, you need to setup Medibuntu as one of your repositories because you can get most update from it. Installation and setup note[1] should be available in their website. After, add it to sources.list file, do the following command in Terminal. (you can use other GUI players instead of smplayer)
sudo apt-get install vlc mplayer mozilla-mplayer smplayer w32codecs

I, also, recommend uninstalling totem.
sudo apt-get remove totem totem-common
totem-gstreamer totem-mozilla totem-plugin

After finishing install, Smplayer can play a movie mediately, but it requires a little configuration for Firefox. Finding some video test page, I google and use this page[2]. In my computer video doesn't show up, I have to change video output to x11 by right click on grey background -> configure -> x11 from Video Output drop down list. Done, you have nearly perfect movie player with Ubuntu Intrepid.

mplayer playing in firefox with video output setup to x11.

[1] -
[2] -

Saturday, January 31, 2009

Ubuntu Mirror in Thailand

Default repository for Ubuntu's updates and programs if you set your location to Thailand is I don't know where this server is but, it's quite slow on my opinion. I got 20 - 30 Kb/s with 3 Mbps True Internet package. Therefore, I suggest thai people who use Ubuntu change their mirror site.

In Thailand, there is a Thai National Mirror which serves as open sources software repository including Ubuntu. Due to public advertisement and word of mouth news, it became slow on peak times such as 8.00PM - 10.00PM (or I fortunately downloaded something when they updated servers).

So, I suggest using Kasetsart Linux Mirror site instead. Of course, it's very fast for me (I live in Bangkok). You can download sources.list from their website or edit it by yourself. Using the following command in Terminal.
sudo gedit /etc/apt/sources.list
then, insert your admin password and add following lines to the file (you should comment other repositories for faster update).

#####KU apt <> Main,Restriced Update#####
deb intrepid main restricted
deb intrepid-updates main restricted
deb intrepid-security main restricted

#####KU apt <> Multiverse,Universe Update(Optional)#####
deb intrepid multiverse universe
deb intrepid-updates multiverse universe
deb intrepid-security multiverse universe

#####KU apt <> Source File Main, Restriced (Optional)#####
deb-src intrepid main restricted
deb-src intrepid-updates main restricted
deb-src intrepid-security main restricted

#####KU apt <> Source File Multiverse,Universe (Optional)#####
deb-src intrepid multiverse universe
deb-src intrepid-updates multiverse universe
deb-src intrepid-security multiverse universe

[1] -

Thursday, January 29, 2009

Ubuntu 8.10 Intrepid Ibex on Asus M9V

Today I install Ubuntu 8.10 on my notebook 'Asus M9V' which is three years old. I used Ubuntu 8.04 (Hardy Heron) on my notebook last year during August and November. Due to my preparation for GRE and game 'Team fortress 2' (later one has more weight), I decided to install windows xp which is more compatible with GRE test prep software and games. I don't want to use a virtual machine on Ubuntu mostly because it can't handle heavy 3d games like TF2. However, GRE Exam passed and games became boring, I switch to linux again and I choose Ubuntu because Ubuntu 8.04 used to work perfectly on my M9V.

Gimp on Ubuntu 8.10 on ASUS M9V

It took about 20 minutes to install Ubuntu included formatting old windows partition. I prefer Intrepid's wallpaper to Hardy's wallpaper. Everything seems nice, wireless, bluetooth, logitech V450 nano, video, and sound.

However, when I played it about 10 minutes, my computer freezes except the mouse pointer. This discourages me because I used to have the same problem on Edgy Eft (Ubuntu 6.10) with my PC which has Nvidia FX6600 card and that time I gave up. I google this problem and found that it might be connected with a video card driver. So, I updated my ATI driver using proprietary driver and other updates as well ( 226 updates need after installing Ubuntu from CD). Now, I played it about 5 hours and it works smoothly.

There will be a lot of upcoming blog about installing driver and software to customize Ubuntu as I need.

Wednesday, January 14, 2009

How to disable autorun in windows XP

Nowadays many viruses, malwares, spywares, and worms often spread themselves from an infected computer to other computers via usb drive. By using Autorun.inf file ,which automatically detect and run in windows, they can copy and execute themselves into a victim computer. Therefore, using autorun on usb drive in windows isn't a wise decision. Here's how to turn it off.
  1. run gpedit.msc using run command (start button -> run). This will open group policy windows.
  2. under Computer Configuration, click Administrative Templates then System.
  3. find Turn off Autoplay Setting on the right panel and double-click it. Then, choose enable. It will allow us to edit bottom area. Choose all drives from 'Turn off Autoplay on' drop down list. Finally click apply or ok.

Another good way to help preventing viruses without additional programs. However, this method works only in windows XP professional edition.

[1] -

Tuesday, January 13, 2009

How to turn on automatic logon in windows XP

Normally, when I install a new windows, I create only an account without a password for myself. This make windows automatically logins to my account when restarting computer. However, after installing .Net framework 1.1, it will create aspnet_wp or ASP.NET Machine Account which turn off automatic login. You can easily delete the created account in user accounts in control panel and make your only account be automatic log on again. But, for the windows machine with multiple accounts or programmers who develop using .Net framework, deleting an account doesn't work. I offer two options.

First, using registry editor to add the following string values at key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon
DefaultUserName : your username
DefaultPassword : your password
AutoAdminLogon : 1

Second, run 'control userpasswords2' using run command (start button -> run). Remove "Users must enter a user name and password to use this computer" from check box and click apply.

[1] -
[2] -