Steven Gordon's Home

Welcome to my home page! I am currently living in Pathumthani, Thailand, working as an Assistant Professor in Sirindhorn International Institute of Technology, Thammasat University. Here you can find information about:

  • My research and teaching activities in the area of Telecommunications, the Internet and Computer Science at Thammasat Uni.
  • Some personal information about me including photos and articles on living in Pathumthani (part of greater Bangkok), diaries from past holidays in Africa, South East Asia and Canada, recipes and some computing stuff

Feel free to contact me if you have any questions.

Driving from Bangkok to Siem Reap in Cambodia

When Mum and Dad visited we visited Angkor Wat/Siem Reap in Cambodia for a few days. Instead of paying the $AU400 per person round trip flights offered by Bangkok Airways (the only airline flying Bangkok to Siem Reap), we went by car. I drove my car from Bangkok to Aranyaprathet (on the Thai side of the border), then we crossed over and caught a taxi to Siem Reap. The following is how we did it. I collected a lot of this information from Tales of Asia and the ThaiVisa forum.

Bangkok to Aranyaprathet

We left Pathumthani at about 6am on Thursday 12 August. This was the first day of a 4-day long weekend in Thailand (Queens Birthday), so the early start was to avoid potential traffic jams as people left Bangkok, as well as arrive at the border in time to avoid long queues at immigration. We took the Rangsit-Nakhon Nayok Road which is 2-lane (in one direction) all the way to Nakhon Nayok. Then we turned right onto No. 33, which goes all the way to Aranyaprathet. This road us 2-lane most of the way, except with two sections (probably about 40km) of 1-lane road. Overall it was an easy drive: the 240km plus couple of toilet stops taking 3.5 hours.

I had read on ThaiVisa that a secure car park is available at the border. As you drive directly towards the border check point, the large Rong Klua market is on the left. On the right (as well as on the left just past the entrance to the market) are several car parks. As our car slowly passed the turn to the market the attendants run towards the car trying to get is to enter their car park. At this stage there was little traffic around. I turned into the first on the right, called Getaway. It had shade clothe covering parking spaces, plus a large, clean toilet block. Price was 100 Baht a day, and yes, the car was their in tact when we returned 5 days later.

Crossing the Border

As we organised our bags at the car, two "helpers" came spoke to us, offering to help (with bags, visas, getting across the border, taxis on other side). After reading the great info about the Aranyaprathet/Poipet border crossing on Tales of Asia I had a good idea of what we needed to do and declined their help. However they did offer us a Cambodia arrival form which I declined but should've taken as filling it in at Cambodia immigration was a headache. Anyway, from the car park it was a 50m walk to Thai immigration for departure.

The Thai departure building is on the left. There were spaces to queue outside, but at about 10am noone around. Inside the building was a queue of about 10 foreigners in front of us. It took about 10 minutes to get through for Mum, Dad and I, except Wan didn't have her departure card and had to return to the end of the line, adding another 15 minutes.

Once out of Thai immigration we proceeded across the bridge to enter Cambodia. There is a big Angkor style arch way, then on the left some small buildings and a tent for a health check. Spotting the foreigners a guy at the health check tent (two small tables and some chairs) directed us in to complete the simple forms. Then he showed us the way to Cambodia immigration (on the right side of the road, about 150m walk past the several casinos which many of the Thais are going to).

Note that we already had our visa – an E-Visa I obtained online about a week beforehand. This E-visa was simple and quick. You visit the website, provide the details of the people travelling, upload a passport photo, pay $US25 with credit card (the payment is handled by a third party, perhaps PayPal, and supposedly safe) and then they email you a PDF of the E-Visa that you print (two copies) and take with you. I received the email the day after applying. On mine there was a mistake in my name (I think I made the mistake). After letting them know in a response email they quickly corrected and sent me the updated PDF. The benefit of an E-Visa: no need to get a visa on arrival before passing Cambodia immigration (saving time on potentially long queues, and avoiding the need to pay extra 'tea money' to the officials). The cost: an extra $US5 processing fee (official price on arrival is $US5, but higher prices may be quoted). Although I didn't experience the hassle of getting a visa on arrival first hand, I would recommend getting the E-Visa to others.

Back to Cambodia immigration. It was a small building with about 10 foreigners lined up at two windows inside. An immigration office was handing out arrival forms – this is where it would be nice to already have this form as filling in passport details and hotel addresses while writing on your knee is not much fun. Note that our 'helper' from the health check was still with us, and lent us a pen. The entire process of filling in the form, queuing and waiting for the immigration officer to check us in took about 30 minutes. There was no request for extra money, except the officer handing out arrival forms (for a price he said we could avoid the queues).

Getting to Siem Reap

After getting through immigration and officially in Cambodia, about 10m away was a waiting area for free buses to the International Transport Centre where we could get taxis (or a bus) to Siem Reap. Our helper got on the bus with us and within 5 minutes we were at the transport centre, which had a couple of buildings and plenty of Toyota Camry's ready to take people to Siem Reap. Our helper said the price was $US12 per person (it was also written on the window of the taxi ticket booth). I asked for $US40 (there was 4 of us) and he said ok, but that we shouldn't forget his tip. I paid for the ticket (with $US100 note that I wanted to break up) and 5 minutes later we were on or way. I gave our helper 100 Baht. Even though I knew what was coming and could have done everything without him, he was nice and took us to all the right places (not trying to scam us) making things a little less stressful.

The drive to Siem Reap took about 2 hours. The taxi driver, who didn't speak any English, made it an interesting trip though. Firstly, it was a right-hand drive car driving on the right side of the road. Especially leaving Poipet where there was a lot of traffic, it was pretty stressful for Dad, sitting in the front seat, as the driver started to pull into the centre of the road to pass cars. The driver couldn't see oncoming traffic, but Dad sure could. On top of that the driver kept his hand on the horn. Any car, motorbike or pedestrian on our side of the road received about 5 toots to warn of our arrival. Even the cows were warned. We later realised Cambodia drivers use the horn for warning much more than in Thai (and in Australia), but still this driver was over the top.

As expected, as we got into Siem Reap even after showing him the hotel, the driver took us to a small street and stopped near some tuk-tuks. The driver got out and another guy poked his head in saying that he is not allowed to go on any further, so we have to catch a tuk-tuk to the hotel. We get in the tuk-tuks, along with a tout who tried to get us to book him for touring Angkor. We declined his offer and gave him 50 Baht (too much) when we were dropped at the hotel.

Return to Thailand

The night before we were to leave I asked a tuk-tuk driver outside our hotel if he could organise a trip to Poipet for us. He said his brother had a Camry – price $US25. We agreed and had a peaceful trip back. Actually gave him $US30 as he had some interesting stories, drove safely and only used the horn 5 times in the whole trip.

Getting back into Thailand was easy. Firstly on the right side near the large roundabout in Poipet was a small building were we got our Cambodia exit stamp. No lines, no wait. Then walked passed the casinos again and into Thailand. About 10 minutes in Thai immigration and we were finished. Went to the car, drove into Rongklua Market for some shopping then back to Bangkok.

If travelling to Cambodia (Siem Reap) again I would take this overland option, rather than flying, again. Although stressful crossing into Cambodia, there were no major hassles. The 2nd time should surely be much easier.

Using apcupsd to Trigger Ubuntu Shutdown from UPS

At work they just gave everyone a UPS for their office: APC BK650-AS. It comes with a cable that plugs into a USB port on your computer allowing the status of the UPS to be used to trigger a shutdown (or other actions) of your computer. Also included was a free version of the APCs PowerChute software for Windows and MAC. Supposedely there is a Linux version of PowerChute, but a quick search reveals apcupsd provides all necessary features for Linux.

Heres what I did to configure apcupsd after plugging in the cable.

  1. Install the software:
    > sudo apt-get install apcupsd
    
  2. Configure the daemon by editing /etc/apcupsd/apcupsd.conf:
    UPSNAME SteveUPS
    UPSCABLE usb
    UPSTYPE usb
    # DEVICE
    
  3. Allow access on localhost by editing /etc/hosts.allow:
    apcupsd: 127.0.0.0/255.0.0.0
    
  4. You can check that the UPS is detected by looking at system messages:
    > tail /var/log/messages
    Aug 26 12:49:24 ginger kernel: [ 3456.772911] generic-usb 0003:051D:0002.0005: 
    hiddev96,hidraw0: USB HID v1.10 Device [American Power Conversion Back-UPS CS 650 
    FW:817.v6.I USB FW:v6] on usb-0000:00:1d.0-1/input0
    
  5. Restart the daemon:
    > sudo /etc/init.d/apcupsd restart
    
  6. Check the status:
    > apcaccess status
    

Mum and Dad 2nd Visit to Thailand

On August 10 Mum and Dad arrived in Bangkok for their 2nd visit to Thailand. They have 2 weeks here, and plan to hang around Bangkok, travel to see Angkor Wat in Cambodia, and perhaps spend a few days in Kanchanaburi. They flew direct from Melbourne to Bangkok via Jetstar (after driving from Mt Gambier to Melbourne, with a stopover in Ballarat for 1 night). Coming from the Mount, you can choose to fly either via Adelaide or Melbourne. They were quoted about $AU2600 (return for both people) from a travel agent (either via Adelaide and Singapore, or via Adelaide and Sydney). But in the end they tried Jetstar for a total of $AU1600. The $AU1000 saved is spending money for the next two weeks. I was a little worried recommending Jetstar to them, but the with a comfort pack (blanket and video unit) they found it a pretty good flight, mainly because of the no stopovers. Maybe I will try Jetstar next time ...

Photos from their stay in Thailand and Cambodia are in the gallery.

Pete and Ally in Thailand

With Mum and Dad's visit to Thailand upcoming, I got around to finally uploading photos from Pete and Ally's trip in May this year. They had 3 weeks here. Together we visited Bangkok (avoiding the red-shirt protests, but not curfews), Chiang Mai and Kanchanaburi. At the end they went to Koh Samui and a couple of nights in Singapore. Maybe I'll add more about some things we did later, but for now check out the photos.

Pete and Ally at Royal Palace in Bangkok

Interview on China Radio International

I was interviewed earlier this week for the People in the Know news and affairs program for China Radio International. CRI is one of the three state-run media organisations in China (the other 2 being China Central TV and China National Radio). Its main purpose is to broadcast China related content to rest of the world. Hence it is similar to Radio Australia, BBC World Service and Voice of America.

The topic was the new project in China for integrating their TV, telephone and Internet into one network. The interview was aired on radio today (Wednesday 7 July) and also can be listened to online.

The Effect of Delay/Jitter on Streaming Video

Here is a quick guide for demonstrating the impact of delay and jitter on streaming video across a network. I used this as a demo in ITS323 and ITS413.

Requirements

You need to two computers, with at least one running Ubuntu (or other Linux-based operating system). VLC must be installed on both computers - it is is as the video streaming server and video player at the client. To introduce extra delay/jitter into the path from server to client, tc is used. This is available in Linux - it can be installed from repositories using apt-get. I'm not sure of an equivalent free application in Windows operating systems, hence the reason that one computer must run Ubuntu. The two computers must be connected together via some network. To avoid problems with firewalls and NAT, and achieve reasonable speed, I suggest using a direct connection (Ethernet cross over cable or adhoc wireless LAN) or LAN (Ethernet or wireless LAN). Finally, I assume you have a video file to stream, e.g. an AVI encoded using XViD.

VLC as the Video Player on the Client

VLC is a great media player supporting many different codecs and available for a variety of operating systems. On the client computer (you could use Windows OS, but I'll give instructions for Ubuntu) VLC will be used to play the received video. You have two options to open the network stream:

  1. Via the command line, run:
    vlc udp://@CLIENTIP:1234
    

    where CLIENTIP is the IP address of this client computer. You can find it using the ifconfig command.

  2. Open VLC and from the Media menu select Open Network Stream then specify the protocol as UDP and the IP address as your computers address. Port 1234 is chosen by default. Then press play.

As the server hasn't started, nothing will be displayed yet.

Streaming Server

In addition to being a media player, VLC can act as a streaming server. A command line interface (with no GUI) is available using cvlc. Your server computer should be running Ubuntu. Assuming the video file you want to stream is video.avi start streaming it:

cvlc -vvv video.avi --sout '#std{access=udp,mux=ts,dst=CLIENTIP:1234}'

Again, CLIENTIP is the IP address of the client computer that is going to receive the stream. The '-vvv' option gives verbose output on the terminal. The 'access' option specifies UDP is to be used as the streaming protocol. The 'mux' option specifies the format to encode the data. 'dst' specifies the destination host and port number. Note that as an alternative to the command line, you can start a streaming server via the Media->Streaming... menu in the VLC GUI.

Now on the client you should see the video playing.

Adding Delay/Jitter using tc

In Linux, tc is a traffic control application. It allows you to control packets being sent by your computer. We will use it on the server computer to introduce additional delay/jitter/loss into the path from server to client. You need to be an administrator to make changes with tc, i.e. use sudo in Ubuntu. Without explaining how tc works, here are some example commands you can use.

To add a random delay of between 90 and 110ms (average 100ms) to every packet your computer sends do this (assumes you are using your Ethernet interface eth0):

tc qdisc add dev eth0 root netem delay 100ms 10ms

To remove this delay, use the del option, i.e.:

tc qdisc del dev eth0 root netem delay 100ms 10ms

To change the jitter, simple change the 2nd time interval (10ms above). You can also drop, for example 1% of the packets (randomly):

tc qdisc add dev eth0 root netem loss 1%

And again you can remove it by replacing add with del. Also you can change existing commands by using change instead of add and del.

With tc you can now vary the additional delay/jitter/loss in the network path and investigate how that effects the quality of the streaming video.

Getting Mobile Broadband Working on Ubuntu 9.10

A couple of weeks ago I was on holidays, tried to access the Internet on the laptop using my mobile phone as a modem and nothing worked. It had previously worked fine, but turned out my "upgrade" to Ubuntu 9.10 actually downgraded the capabilitys of the Ubuntu Network Manager to connect. Finally, I have found a work around. This is what I did.

Install wvdial and the corresponding Gnome GUI for it, gnome-ppp. You can install via the Synaptic Package Manager or the command line:

sudo apt-get install wvdial gnome-ppp

These will be used to create the point-to-point (PPP) connection via the modem (i.e. the mobile phone) instead of the default Ubuntu NetworkManager. So delete your existing Mobile Broadband connection that you may have already created (right click on the network icon in the top desktop menu, select Edit Connections..., go to the Mobile Broadband tab and then delete your connection).

Now configure wvdial and gnome-ppp:

gnome-ppp

Select the Setup button and then Detect you modem (make sure your mobile phone is plugged in to the laptop). It may take some time or multiple attempts to detect - mine eventually found the modem at device: /dev/ttyACM0. Yours may be slightly different.

Close the Setup window and you are returned to the main Gnome PPP window. For my service provided (AIS - see the details) I require the information:

  • Username: internet
  • Password: internet (in fact, I think the password doesn't matter)
  • Phone number: *99#

Then Connect and after some time the connection is established. Open your web browser and you should have Internet connectivity!

Becoming a Monk during Songkran

After our trek up Khao Sam Yot in the morning, on Monday afternoon a party was held for a neighbour that was about to become a monk. It is common for young guys to enter the monkhood, at least for a couple of weeks. Before he enters everyone in the village gives him some sort of farewell party. He sat on the back of a pick-up with a few elder people and they slowly drove from his home around the village. There were probably close to 100 people following on foot as they left his home and passed Wan's home (about 50m away). At the tail of the procession was another pick-up truck loaded with a 2 metre wall of speakers blaring popular music. Everyone was dancing, drinking and soaked with water. As they passed each house the inhabitants would throw buckets of water on the procession and then join in.

I think a combination of extra long public holidays (many young people returned home to their village), Songkran (throwing water on everyone) and the guy becoming a monk made this one big, fun party. Sort of like a mini festival. However, like the Big Day Out or the hill at the cricket, take a a group of young men drinking in a summer festival atmosphere and eventually there will be a fight. The crowd of young children through to grandparents quickly dispersed to the nearby houses as the pushing and shoving started. There were some punches thrown but nothing too wild. For most people that ended the party - we walked about 75m home - although I guess the monk to-be continued on to the wat.

It turned out there were similar street parties in the following days, but in these cases it was a group of people making an offering to the local Wat. They were much smaller (50-100 people), but still good fun. I joined one and managed to make it to the Wat this time (despite a fight breaking out on the way). Unfortunately there are no pictures as I didn't want my camera to get soaked.

Khao Sam Yot

Khao Sam Yot, Phu Pa Man
This morning was the first real day of exercise. We trekked up Khao Sam Yot ('Three Peak Mountain' in Amphoe Phu Pa Man) at about 10:30am. Over New Years I went up to the first lookout, which took about 45 minutes from the bottom temple/car park. This time we drove up to the top temple, saving about 20 minutes walking/climbing, and walked all the way to the Buddhist lookout near the top of the mountain. It took about 90 minutes. The trek is not too hard, however the temperature of 35+ degrees meant I was drenched with sweat within the first 5 minutes. As we got close to the lookout the track become a set of ladders and platforms, partly made of bamboo. The lookout is set on the face of the mountain and looked slightly dangerous, but we ventured forward. In fact there is a large cave where the lookout is built, with several statues of Buddha inside, as well as more ladders up inside the cave to a room for the monks. It was a peaceful location, with an excellent view of the nearby villages.

After some snacks and photos we made our way down. I thought it was easy until I slipped. Some grazed arms, sprained fingers, bruised bum and nervous legs for the rest of the way down was the outcome. Although that dampened my spirit a bit, it was worth it. It is nice to explore the various mountains that create the valley containing 5 or 6 villages in the area.

Photo gallery

Syndicate content