Thursday, January 31, 2008

fun with linux: fun with KBluetooth pt1

Kde comes with a framework that provide a set of software to be used with bluetooh, it is called kbluetooth. It is actually comes with kubuntu by default.

One interesting tools in it is, kbluelock. Basically it is a program that lock the screen, when bluetooth signal from a designated phone disappeared.

You can call it, by right click on the kbluetooth, which is on the system tray,
Right click on it, you should see a few program, Select KBlueLock,

It really don't do much at first, just select the right option will prompt KBlueLock to search for your phone. I just select both. And the phone.

What really cool is, my friend didn't really saw this type of program on windows before, which to me really cool. Someway to show off, linux

One thing is, it is dead easy to configure, another is, well, it take sometime to lock and unlock the screen. And can be a bit limiting

Monday, January 28, 2008

OpenID on yahoo

It's been sometime since yahoo have announce OpenID support, for the last few days, it is not open for registration.

Getting it is easy, just go to select your identifier, which include your flickr account home page, as your identifier.

What make it cool, it it is able to use, flickr account as my OpenID identifier. Which make me easy to remember my identifier. Now that, yahoo support OpenID, I don't really need to register another account to use OpenID enabled sites

Friday, January 25, 2008

fun with linux: virtualization with virtualbox

running virtualbox in normal mode

Virtualbox, is a virtualization software, from innotek. Which is their own virtualizer, so it is not based on xen or qemu. And have support for HVM, which I read from some forum, it is better leave as is, than enable hardware support.

What cool is there is an open source edition(or the OSE on their website), and free in price version. The difference is the OSE version don't have the USB emulation, built in rdp, and using iscsi as a virtual disk, Since I got some USB device I opt for the OSE version.

The OSE version is in ubuntu repository, and probably other distro repository too.

What is really-really cool is that, they provided package for different linux, which is rare among proprietary software company, and repository for ubuntu too. Which is way cool. Since I am lazy. You can get it here.

For those who used other virtualization software before, you will noticed that, it provide most features that a virtual machine have, like sound support, able to use usb device, probably not build in rdp support. So using it is not hard, except, you need to get use to the interface a little.

the msn messenger and yahoo messenger is
not runnning on wine, it is in a VM, in seamless

Another cool thing is, there is seamless windows integration which means that, you maybe run a program on virtual machine, but you see it on your desktop. And you can share the clipboard too. This is a totally cool feature.

You also can setup a shared folder that is shared between virtual machine and host machine. On vmware, it means that you need to have a samba server to do so. But on virtualbox, you can do that without need a samba. To windows, or linux, it is a windows shared folder, but you don't need to install samba.

Other thing, include, sharing clipboard, HVM support(but it seems experimental, probably not yet, slower than just running virtualbox alone), able to support the host sound server, which it can use pulse audio,

I think this is quite a nice product, like most commercial product, easy to use. Unlike commercial product it is free, in price, and for certain part in rights too. And unlike more well known product, it have features unique enough(aka seamless integration), to standout on its own. So far it run quite fast, but then I have a gig of ram. To run a virtual machine make sure you have more RAM, anything above 512 Meg is nice. But 1 gig is good enough, 2 gig is much nicer, a gig for linux, a gig for windows virtual machine

Malaysian Wireless Broadband shootout, redux

New info, looks my the celcom don't provide a modem, which is bad, not wonder it is cheaper. And yeah the modem it self cost RM799, but celcom sell it for RM1299

Izzi broadband, need me to pay upfront, since I don't have a credit card. Which is expensive,

And seriously I don't really like maxis. Until the fix up their QOS. But it is cheaper.

Wednesday, January 23, 2008

Malaysian Wireless Broadband shootout,

Turn out that my server project going to be shutdown for the time being. I need the internet but there is no way I can ask streamyx to bring the network, to the dorm. So the next best thing is, wireless broadband. Which is surprisingly competitive, in term of pricing, compared to adsl broadband. The price is not that far apart. Since I'm either in selayang or KL, So the coverage should be there.

There is a few option
3g Internet
There is 2 main provider for 3g internet service, Maxis and Celcom. I used maxis, at home, in Selayang. The service is not that great, the uptime, is ok, but sometime, there is not service for half a day. And it is not that good. But price wise, it is competitive, you get Rm 68 per month for a 384k, RM98, for 3.6meg. The usb terminal, cost RM138, per month but can get 3.6meg of bandwidth, but it depends on the area. My friend test in the dorm, it is quite lousy, and the service at my home is lousy too, can take half a day for them to fix up connection issue.

Celcom provide similar package, but it is RM66 per month for 384k of bandwidth, which is pretty useless to me. Or another package is you get 3.6meg, which is RM98 per month. Which is suprisingly ok. But seriously, didn't really try it, so can't really compare the QOS. The thing is, their website, didn't show their 3g coverage, so i can't really sure, it is available at my home in Selayang. And it only show gprs, coverage. seems a lot though.

On the other hand, celcom own website shows 2 conflicting information, the main page, says it offer 3.6 meg unlimited usage, with RM98 per month, but their other pages shows that, it only offer unlimited usage for 386k, for RM66 per month which is true?

The alternative

Iburst, which is pre-4g, either way, izzi broadband offer it for one meg for rm 66 per month, but that is for the pcmcia card version, which my laptop don't have. or RM 98 per month for the usb version still 1meg.

Price wise, it really not worth it, but since my home is covered, it seems not a bad deal, imagine we have iburst how cool is that(it's a geek thing)

set default java version on ubuntu

I runs on a 64bit ubuntu, which one problem, for some reason there is no 64 bit version of java plugin for firefox. It is not in the repo. So I took the opportunity to test iced tea. A java that is based on the java source code, since java is open sourced. But for some reason it doesn't work.

I was trying to use tcgui, like from this howtoforge guide. The tcgui program, doesn't work on icedtea, not sure why. One solution was to remove it.

Another is assuming that you have a sun-jre. Is by running this command, in terminal:
sudo update-java-alternative -s java-6-sun
To check whether you have the jre from sun
update-java-alternative -l
this will list out the jre, that is available. When you see, "java-6-sun", then you have it.

p.s This I assume that you install java from repository, because not sure whether it will work if you install manually.

Friday, January 18, 2008

fun with python: been twitter'ing with python

I'm not sure why, but python developer seems have ways to write python modules, to integrate with web service. Which to me interesting. There is one from google to integrate, google service. There is one for flickr, which I covered. Etc. Even twitter have one.

The twitter python binding can be found in
Before you install it, you need to install simplejson.

To install simplejson, it is just get the tar.gz file. Then uncompress it,
Then in the same directory
On ubuntu:
sudo python install
on other linux as root:
python install
same on windows. just:
python install

The process of installing the python-twitter is the same cycle of python

There is a few standard thing we can do with the python-twitter module.

here I assume that, you run it, in a python shell, it is just a follow along tutorial here, and the >>> is not shown:
before that, import the module
import twitter
start using it, you need to authenticate yourself, using your twitter username and password.
to view public time line
for s in status:
print s.text
or you can just
print [s.text for s in status]
to view a user status, just replace user with the username of the user
then read it by
print [t.text for t in userStatus]
Here is the important one, to post your own status using the python-twitter module
posting=apt.PostUpdate("your status")
There you go, few way to use python to interface with twitter. You can use this with a gui front end, or integrate with django, etc.

Wednesday, January 16, 2008

One thing about facebook apps

Just realize that, my facebook have more than 45 apps. Which I check, what does it really do anyway?

Then really, the application really do nothing, except cluttering my profile. Still, interesting phenomenon. But it all ends up in my extended profile.

p.s Actually playing dopewar on facebook is quite fun!!!!

Sunday, January 13, 2008

Saturday, January 12, 2008

turn out kde 4.0 is not kde 4, my bad
Been a bit harsh on kde 4.0. But turn out that, kde 4.0 is not kde 4. SO wait I will. Will be interesting to see how kubuntu, ship kde 4 in april.

p.s That explain a lot!!!!!!!!! SORRY!!! :-(

kde 4 on kubuntu gutsy

Yesterday, kde 4, officially launch. Was downloading it in the morning. And spending the rest of the day, figuring it out.

I install it by using the resource here

So it could be different, than what you see on your distro.

What happen, first thing first, there is many changes in kde it self,
visible changes:
1) The kmenu have been replaced with kickoff. which is official menu in the newer suse version. Have extra features like search bar, menu changes etc.

2) there is a small button on the upper rights. That have a button to
control the widgets called plasmoid.

3) The icons, looks like plasmoid, aka the kde 4 widgets. Actually it is a widgets.

The not so visible one:
1) There is actually desktop effect on kde 4. Many looks ok, not all work. Seriously I prefer compiz more.

2) If you use the widgets on linux, like superkaramba, and desklets, you can change the orientation of the widgets.

3) This counts, as invisible I put it here anyway. Basically there is also many changes in term of the internal, and the library. So It nice to see a revamp.
The good:
1) Everything look nice, the oxygen theme, make it looks beautiful.
2) The widgets aka plasmoids, mix the desktop quite nicely, and there is a few customization too.
3) Desktop effect is nice, and we don't really need extra dependency like compiz to make it work.
4) Kickoff, make the KDE menu easy to work with

The bad:
1) The panel, on bottom of the screen, need a GUI, it doesn't have it yet. But It will be in KDE 4.1, which I think will be soon
2) Call me crazy, why can't I create new folder using dolphin, on kde 4. Or it is a kubuntu issue
3) Some of the widgets not working yet.
4) Hope to see more application move to kde.
5) It's bit crash'ish. Need to delete the kde4 config directory a few times. To restore the panel, and kde 4 itself.
6) Would be nice that, gtk apps, can be made to look nicer under kde 4. Because it is ugly

What I can say on KDE 4, is well, if you can wait, wait for 4.1. Hopefully by then it will be more polished. On the other hand, most of the infrastructure is there already. So it should not be long.

What is interesting now, is seeing how the kubuntu guys, integrate kde 4 with ubuntu

Tuesday, January 08, 2008

Manage process interactively with htop

Sometime when running linux, when we have a run away process, or process that either take away too memory or ram. We have to kill a process, in linux or any unix, it's pretty easy to do.

The most common way is to, first
ps -aux
instead of ps, you can use top, just type top in terminal
to identify the process, a get the id
kill -9 process-number
Which can be a bit repetitive. On the other hand, there is a nifty utility call htop, which is like top , just more interactive and colorful, and more details. And also more action. For example:
  • you can scroll up and down to see all the process, something you cannot do with top
  • you can set the niceness, or kill a process. This you can do by pressing the key indicated on the bottom of the htop. which cannot be done in top too, for example to kill a process, just scroll to the process, then press f9 key, then it prompt then enter again
  • it have more information to display, for example, it will show the cpu utilization for each core, if you have dual core, it will display it, work quite well for my quad core server. also it display the ram and swap utilization.
To install on ubuntu, it is
sudo apt-get install htop
on fedora core,
yum install htop

Why use this, don't linux have gui for this? Not sure about gnome, but kde have Ksysguard, which is more GUI oriented. Which have about the same functionality, but different interface.

But sometime a program on your linux desktop misbehave and hang the desktop, access the virtual terminal trick helps, meaning by press ctrl-alt-f1, to access the command line interface, which should work, then use htop to kill the process, then after that, ctrl-alt-f7 to go back to desktop. Things should be back to normal. If you can still access the virtual terminal, things should work.

Sunday, January 06, 2008

Fun with linux: Pulseaudio, a advance sound server

In windows vista, there is one feature, Per Application Volume, which to me is very useful, imagine, because sometime I play simple games and listen to music in the same time. I don't want the game interfere with the music.

In linux, there is such thing as well, it is Pulseaudio, a new comer in the sound server world. It have Per Application volume control, it also have the ability to stream across network, integrate with avahi, the linux zero conf networking server. And few others. It is currently the default sound server for fedora core 8. And ubuntu have it in repository, but is not the default sound server, on the other hand, it is not hard to install.
Based on the links, it is just a matter of
sudo apt-get install libasound2-plugins "pulseaudio-*" paman padevchooser \
paprefs pavucontrol pavumeter

So the links would work very well for everyone.

For 64 bit user, there will be problem using flash, just follow the advice here. Basically you need to download the file in the first post and install it.

After all the work, you will have a feature similar to windows vista, and ability to stream across network, which vista don't have, as well.

Saturday, January 05, 2008

a site with a list of linux commands

here is a site of a list of linux command.

something like a dictionary and very useful

the day when Advertlets mess up the blog

It turn out that advertlets, have forget to update their domain, which I cannot believe it.

Either way I temporarily remove it from the blog.

Fun with linux: get system info with /proc(/proc filesystem)

One fun thing on linux, in a way, is that, it is easy to access system information. And even write script to read it.

The way to see this is via the proc file system. Which is in /proc.
/proc file system is a virtual filesystem that reflect kernel states.

like any filesystem you can "ls" in it. First thing you see is a set of numbers, that is actually the process of the system. And a few thing as well. One thing about the /proc filesystem is that, some make sense to human, other is not quite.

Take an example, inside /proc, have cpuinfo.
cat /proc/cpuinfo
You should see the cpu information.
Another is
cat /proc/uptime
the information is not quite obvious.

Just now I show one can do with it already. In /proc, files act like files, text file to be precise, which is editable, but not recommended, it can mess up the system. So you can cat it, you can write script to read it. For example, in python
for l in f:
print l
And it applies to all other programming language that run linux, and can read files. So you can write program for it. Or get system information. For example, to get cpu temperature for a laptop, in my case, it runs a amd64 x2, I do something like this
cat /proc/acpi/thermal_zone/tsz0/temperature
And some desklets use this to get system info too.

Friday, January 04, 2008

smb4k: a kde utility to connect windows share on linux

When you use linux, there is a few problem, one of it is, using windows share folder. While many distro have bundle plugin for their default file manager, like kde's konqueror, and dolphin, and gnome's nautilus. At least, ubuntu have did that.

Sometime, it just nice to have utility for browsing windows shares. smb4k is one such utility. It's a utility that is used to browser windows shares. It features, a network browser, a search function, and a configuration manager for your samba. And yeah did I tell you, It mount shares. Meaning, once you are connected to a network, it will automatically, mount the shared folder, you can access it, like any folder.

Let say, I think it's refreshing to have another way to access a shared folder, than to use the default file manager. And comes with the nice features too.

Fun with python: web development with Django: part 2, a little overview

Like many framework like, ruby on rails. Django have a set of utilities.

First thing first,
- This is the main admin utilities, it have everything from start a project synchronize database, generate sql, shell, run the server.

just call it in shell
this will show, the set of options and parameter startproject name
this will start a project. Which will generate a directory, with the settings file, which map url to your application, and

- This is another admin utility, I didn't see much difference detween this and but in most django tutorial, we manage our project, with
in the project directory, in shell
it will show a set of option, similar to

to create new application
python startapp application-name
this will create your application, the stub of models in, views in

Thursday, January 03, 2008

the userdir apache module

By default, the apache webroot, in ubuntu, or most distro. Is in /var/www. Which is not really a big deal, except, it's a pain to finish writing a php script, then as root, or sudo to cp to /var/www.
If it's just a server, it's perfectly fine, for a development machine, it's a pain.

On the other hand. There is a userdir, module in apache. What it does basically, is it enable you to put your file in your home directory, then apache will serve the file there. By default, apache will search in /home/youraccount/public_html, or /home/useraccount/www or /usr/www. To access the file, you just need to call by http://yourserveraddress/~youraccount, with a browser.

To make it easy for me to write stuff into, i just use the form in my home directory. The implication is that, you can redirect your ide to use the directory as your work space.

To do it on ubuntu, inside, /etc/apache2 have a mods-available directory, another is mods-enabled directory. The former is the modules available, the latter is just a symbolic links, to the modules in mods-available.

To enable userdir, in /etc/apache2
run the following in a shell
sudo ln -s mods-available/userdir.load mods-enabled/
sudo ln -s mods-available/userdir.conf mods-enabled/
and don't forget to create, public_html in your home directory.
to test it just call your browser direct to http://localhost/~yourusername

Or do it properly, we can start a small web hosting business
, or have friends to share a web space, on your server. etc.

Wednesday, January 02, 2008

Fun with python: web development with Django: part 1 setup

After setup my database, install the ide(the openkomodo post). Now, the next step is to start a project. And I decide to play with python, and django is in my list, because 1) it's python, 2) it's works on gutsy, where as turbogears don't. 3) I kinda like the django's own ORM.

First thing first, installation is dead simple,
1) get django

get tar file, It just happens I use that.
2) untar it somewhere,

3) run the command in the directory you untar'ed
python install
So nothing special.

One note here is, you will need a extra web server. It turn out that, django assumes that, there is a separate server, other than it's own server, serving media like image and file. And it is a pain that to create a links etc. It's actually easier to just enable userDir in apache. and put in the picture in public_html directory, in your home.

I need userdir because, it need a directory that can be written into. And since a ubuntu user account cannot directly access the apache root, which is in /var/root.

Now you have a web framework, that have a few interesting feature, and a internal server for development purposes

Tuesday, January 01, 2008

being a dictator syadmin: finding bandwidth usage for each host

Yesterdays post, revolve around blocking sites. One of the reason, someone up above, insist that filesharing sites are a source of virus, worms and their friends. So they throttle the network, until I fix it, by blocking it.

Another reason, is we are using a thin pipe, and we are using quite a lot of bandwidth. Which I think we are student, there is not much we can do. Either way, I have not much of a choice, but to track it.

Webmin have a utilities to gather bandwidth usage statistics, which have one problem, take s a lot of cpu cycle, and slow down a server and I have to kill it. Until I figure out how to reconfigure it.

MRTG can do that too. except, to check out each host, you need to have snmp agents install on them. Which I can't because it is a dorm, and the computer is private property. So here, mrtg is monitor the server only. Life is so simple, when this is a work space.

On the other hand, linux have a few utilities for this as well. The one I use, is iftop. Best describe as top for network. It is in repository for most distro. It can be used to check bandwidth usage of each host.

To call it, just type
iftop -i ethx
you should get all the data from that interface. In a ncurse interface.

But the data don't stay, when you restart the program it will start again. Nevertheless, still useful. For someone who can't use snmp for the task.