Internet Connection Sharing with NetworkManager

Configuring internet connection sharing in GNU/Linux normally involves modifying several configuration files and issuing several commands. You need to at least:

  • Give Linux kernel the permission to forward network packets;
  • Set up DHCP service;
  • Set up firewall and route the network packets properly;
  • Set up DNS forwarder.

This is definitely not user-friendly for beginners or for those who just want to set up a simple network.

Luckily, since version 0.7 of NetworkManager [projects.gnome.org], shipped with Ubuntu 8.10 and later, includes a very simple GUI for you set up a simple NAT network.

Suppose that you want to set up the following network:

Connecting Ubuntu to Mobile Broadband

I just bought a 3G mobile broadband package and used my Sony Ericsson handphone as a 3G modem (save money!) to go online. It is so simple and straightforward to set it up now especially if compared with how I did a similar task two years ago.

I have these:

  • Xubuntu 9.04
  • Sony Ericsson K770i
  • Mobile Broadband by Celcom Malaysia

Influenza A(H1N1) -- Current Situation

Last Updated: 03-Jul-2009

The threat of Influenza A(H1N1) is not over yet. I have created the charts below to illustrate the current situation, and will update them regularly with my scripts (That's why I put this post under 'Programming' too, and see below if interested).

Other important updates:




Source: WHO updates on Influenza A(H1N1) [www.who.int]

I use Gnuplot [gnuplot.info] to generate the charts with the help of a script and a data file. I have also written a python script to automate the entire update process: Fetches the latest updates from WHO website, parses the page, generates the latest data file, generates the charts, and finally uploads the charts.

Rude Driver! (Rushing to Toilet?)

There are many rude car drivers on the road and I just encountered one!

I was driving and my car approached a cross-junction with traffic lights. I was lucky as the light was green for me, so I just continued to drive, lowered my car speed a bit to make a smooth right turn, and continued to drive. The light did not turn yellow soon yet so nobody needed to rush. I have made such a routine turning in cross junctions for thousand times without errors and I was just about to make another one.

But then, there was this rude and 'buttock-follower' driver just behind my car, and gave me a long horn just before I made my turn. I was blanked for a few milliseconds to find out what happened, but then realized that he was rushing to turn so he horned me rudely! Why so rush?? I did not know what I can do for him so I continued at my usual speed. I made another right turn in a T junction soon after that, he passed by my car from the left side, slowed down a bit, and gave me yet another longer horn!!

What the hell!? It's foolish and dangerous to horn such a brainless driver back and fight with him. Oops! I made a mistake by not taking down his car plate number and probably take some action later... (If there's a 'Death Note' for cars, I may write his number down?!) What can I do? I can only 'hope' he will drive 'very carefully'... hehe... Hey buddy, even you have diarrhoea, or were with your concubine just caught and currently being chased by your wife, it's all your fault and don't blame me okay?! I just saw a serious car accident last night, and an ambulance was called to fetch somebody heavily injured. Guys, be rational and drive with patience!

2009 Resolutions

Here comes my 2009 resolutions.

  1. Work out more, be healthier. Health is always important.
  2. Revive my analytical thinking. I am happy with my brain now but I must do more intense mental workouts, otherwise it will get rusty. Solve difficult mathematical puzzles or problems, play board games, or anything that is mentally challenging.
  3. Organize my belongings properly. Must organize my belongings better. E.g., I don't know where I have kept my collection of classical music CDs now!
  4. Write a program making use of existing utilities or libraries to calculate the positions of all planets and Pluto in our solar system. Wanted to do this in 2008, but no time. Still hope to do it.
  5. Extend my program for Astrological charts. When my program is able to calculate planet positions, it is just a step away from producing Astrological charts. Astrological interpretation? Not sure. If time permits, I may study it and see how much I can do.
  6. Improve my piano playing. I have started this since early November 2008 following the 3-level Alfred's Basic Adult Piano Course. I am in the middle of level two now. The skills and pieces are getting challenging. I aim to complete the whole course along with other pieces (such as the studies by Czerny) by the end of 2009. I can then play a lot of nice pieces.
  7. Learn more about investment. Hmm... Can I make some good money out of it? I am especially interested in technical analysis.
  8. Improve my program to make money. I have written one for my secret project in 2008. But I want to improve it further.
  9. Read at least ten new books. Any book less than 100 pages is not counted. Must read at least two detective stories and crack the cases!
  10. Improve computing knowledge. This is good for my job.

Happy Ox Year!

2008 Review

I have set my a year ago. Let's see how much I have done.

  • Work out more, be healthier. Not much progress for this one, too bad. Worst, when I want to resume my Yoga practice, the Yogazone runs into financial problem and has ceased operations! Anyway, I must find some ways to work out more... Score: 0.0.
  • Organize my belongings properly. I have organized a lot of them, but there are still things not that organized. Score: 0.8.
  • Produce a human-digestible English text-to-speech rules and learn them. Haven't done it yet, too bad. May not include it in 2009 resolutions as I have more important things to do. Score: 0.0.
  • Revive my analytical thinking by playing chess games. Not really restarted it yet. However, I have tried a bit on Go (Wei Qi) and find it rather interesting. Score: 0.1.
  • Extend my solar system simulation program to be able to calculate the positions of all planets and Pluto in our solar system. Didn't do it yet. It's probably better to do this on top of some existing programs or libraries instead of reinventing the wheel. Score: 0.0.
  • Extend my program for Astrological charts. Oh no, didn't do it yet due to the above. Score: 0.0.
  • Read at least ten new books. Achieved this. Score: 1.0.
  • Write a program to help earn some money, if I am lucky! Intended to write one for a purpose, but later changed my mind to write a different one but for the same purpose. Still keep it as a secret first. Score: 0.8.
  • Write computer-related articles for general public. Still did not do it yet! Score: 0.0.
  • Organize this home page better. Have done a bit, but still not that good. Score: 0.2.

Total score: 2.9 ?? Ha, this is hardly acceptable!

Anyway, my life has changed a lot this year. Most notably, I have quit my previous job and work 'freely' now. Besides, I am picking up two interesting skills these days:

  • Investment. I like figures and this interests me. I'm still learning it and hope that I can make some good money out of it.
  • Piano. I know several musical instruments but only suddenly got interested in Piano. Heard about many people spend many hard years with tears to learn it, and such stories scare me. But when I try to start it I find it not that bad, probably due to my musical background and my good teacher! I think I am progressing at a good rate and I'll track my progress on my home page. I have started for 2 months and I'm learning to play a music with two-part writing now.

So if I add these two 'bonuses', I'll give myself a score of 4.9 / 12.0. :)

Discouraged from Taking Meats: How Much Fated?

I don't like to eat meats since I was a kid as I really don't like their taste, while my family members are ok with them. I vomited a few times trying to take meats. Wonder if this is fated? I recall an interesting incident many years ago that might probably tell.

One day, my family went to buy satay to eat together at home. We hardly had satay at home in my hometown, and this is in fact the only time I also ate together as I can remember. (I just enjoy chewing the satay but not really its taste. Odd huh?) Something interesting then happened. Well, you normally will not find any bone from satay, unless the hawker had missed it accidentally. Now the incident:

We bought 20 satay sticks altogether. I took 4 sticks to eat, and I found real 'genuine' chicken bones (later examined by my family members too) in 3 out of that 4 sticks! While they didn't find any bone in other sticks! I swear that I did not choose them purposely as I didn't see the bones before I eat them. I treat it as a sign that I was fated to be discouraged from taking meats, ha... So now the mathematical questions:

  • There are 20 satay sticks, and bones are found in 3 of them. What is the probability that, when you choose 4 of them randomly, you picked up the 3 sticks with bone?
  • Given the same scenario, what is the probability if you choose only 3 of them randomly but happened to picked up all the 3 sticks with bone? (I might have picked those 3 too if I only choose 3 of them. Unfortunately this cannot be verified now.)

Check below for the solution. Think first if you can!

Syndicate content