rpm and yum rescue tips on Fedora

April 22nd, 2008 mysurface

You have to be careful when you run yum update and yum install, DON’T force kill it, kill -9 or pkill -9. Those action are consider very dangerous, may lead you to losing certain files. Seriously, I hate yum, when I really wanna cancel the process in the middle, by hitting ctrl+c doesn’t really work! So, I do pkill -9, and I bare the consequences!

Some binaries are missing although the rpm query indicates those packages are successfully installed; some icons are missing, and I have no idea what’s wrong, I almost lose hope to reinstall everything. Thanks to my comrades Kagesenshi guiding me through finding the cause and I eventually fix it. Now, I share what I have done during the rescue.

Read the rest of this entry »

Posted in Admin, awk, rpm, which, yum | Hits: 60791 | 2 Comments »

Listen audio player: webradio, lyrics, podcast and last.fm all at once

April 17th, 2008 mysurface

Listen, a feature rich audio player allows you to enjoy the most fun out of music! You can listen to the webradio, I have tried on www.shoutcast.com, it works as expected. It support last.fm social networks. It allows you to download album art from amazon ( it doesn’t work at the moment) as well as from google image. You can add you podcast feed. Yes, the lyrics can be fetch automatically from leoslyrics.com and lyrc.com.ar and searching album, artist info from wikipedia.

feature rich audio player

I am currently experiencing with listen version 0.5. Okay, you hear enough of the features, now talk about its limitations. You should expect me compare listen to Amarok. Amarok is a well known feature rich kde audio player, not to mention, it is still the best audio player for me.

The UI looks weird to me at first, I find listen looks like notice board to me, various stuff scattering into one board. There are some limitations on the context menu when I right click on the now playing playlist, It doesn’t allow me to edit the mp3 tag, I have to edit it from another block. I can’t navigate my current playing track, if I wanna listen to the track in the middle, I can’t, I need to start it from the beginning. (updates! I tried on ubuntu, the same version 0.5, it works! By the way, the control named as slider.) Odd, listen don’t have STOP button, it allow me to toggle between PLAY and PAUSE but not STOP. It doesn’t support external device like iPod, I am not sure whether it can play audio CD or not, I only tested with MP3.

Don’t get me wrong! I like this audio player very much, just I feel listen still have much room to improve and I look forward to it. Did I mention this audio player was written in python? Yeah!

You can download listen from HERE. or simply get it from your linux distro repository, enjoy!

Posted in listen, Misc | Hits: 32407 | 4 Comments »

yum, can it be faster?

April 16th, 2008 mysurface


Recently I install fedora to my laptop instead of ubuntu or any debian based distro, the application that I concern the most is yum. I have bad experience on yum previous during fedora core 5, which I find it extremely slow. Therefore I search for some guidelines from my friend Kagesenshi who are extremely active in Malaysia Fedora Community.

First question I throw to him is, Can yum be faster? He throws me back lots of tips over the IRC. Yeah! there are many tips indeed to make yum run faster, he wrote a post reviews all his kungfu on yum, don’t miss out his post, click here. Yum support plugins, one of them is Fastest Mirror, what this plugin does is it scan for the nearest mirror and pick the fastest one for you.

One of the yum’s shortcomings that bothers me so much is the latency of package searching, to search for available package, let say kmess, I do this:

yum search kmess

To do the same thing under apt, I do this

apt-cache search kmess

Seriously, apt-cache really out performs yum. One of the ‘feature’ that yum provides me is ‘intelligently’ do cache update when I ask for package searching. I really don’t understand the reason of such design. Why would it want to do the cache update when I just instruct it to do the package searching?

Read the rest of this entry »

Posted in Admin, yum | Hits: 35538 | 11 Comments »

A Grammar Checker for Open Office

April 13th, 2008 mysurface

The spelling checker is installed by default in Open Office, but what’s missing is grammar checker. For those who are weak in English, grammar checker is really a handy tool which it exist in Microsoft office version 97, or even earlier but not in Open Office.


Well, recently I discover a language tool plugin for open office written in java which does grammar checking. You can check out this language tool at here, installation is simple and straight forward, I have tried it on open office 2.3 and it works well for me.

Well I tried to make some silly grammar mistakes and try out this language tool, but it fails to detect the mistakes. It seems that this Language Tool still have room to improve, you can help to improves it by helping them writing the rules in XML, check out their development page here.

Language Tool can be use outside open office, check out the usage here.

By the way, did you discover any alternatives for grammar checking?

Posted in Misc | Hits: 28752 | 8 Comments »

a stupid way of internet sharing between two laptops

April 6th, 2008 mysurface

I always want to find an easy way to do an internet sharing between my two laptops. Well I figure out a way, which is really stupid! but well, for some extend, it works. I know there should be a proper ways to do that, but with the limited knowledge of networking, this is only what I can come out for the moment.

If you are a super linux admin user and reading this, try not to think in the perspective of admins, but try to put yourself as a layman, as I doesn’t know much about hard core network stuff, but I know ifconfig and ssh, which is some how efficient to make a “fake” internet sharing works.

Okay! lets look at the scenario I have. I have a new laptop (L1) that have wireless capabilities as well as wired installed with fedora 8. And another old laptop (L2) which only have LAN port installed with kubuntu. Obviously I want to share my internet connection from L1 to L2, well is a bit easy for me, because both of them are running linux.

I use wlassistant to connect myself to wireless LAN because fedora 8 Network Manager is so “intelligently” switch to wired when i plug in my LAN cable. After L1 is hook up to the internet wirelessly, i setup my eth0 with root privilege.

ifconfig eth0 netmask up

Okay L1, is done, lets look at L2, same way i setup my eth0 at L2.

ifconfig eth0 netmask up

Connect both LAN ports with LAN cable, and then do ping from L2!


Okay! Now let me reveal the stupid but working way using ssh. I do this at L2.

ssh -Y mysurface@ konqueror

Haha! konqueror start up and now you can surf the net from L2!

Eh! wait what is -Y option of ssh? and Why it works?
If you read up the ssh manpage, you will get this line

-Y Enables trusted X11 forwarding.

Yeah, I am loading L1′s browser and run it at L2, you can try to save a files from the internet. It will save it in L1 instead of L2, therefore this is not a real Internet sharing!

Well, I still figuring how to do an internet sharing across the LAN cable.

Do a bridging at L1 between wireless and wired interface? Then do a dynamic tunneling from L2? I tried and it doesn’t seems to be working.

Play some trick in iptables to do ip forwarding? emm may be I should try this out.

Dear Admin, do you have any suggestion?

Posted in Admin, ifconfig, ssh | Hits: 45467 | 8 Comments »

Cool Ajax irc client that can be embed into your blogs

April 4th, 2008 mysurface

This is not a ‘LINUX’ application, not a command line or any tools that only runs under linux platform. But this is too cool that lure me into writing this post to introduce this COOLEST Ajax apps to you!

As a linux user, I find my friends, oss communities and getting help through IRC, especially freenode.net. And we have a channel in freenode.net open to anyone who wants to chat with those lonely souls. You can click on the IRC icon (smiling face) to access to us! Or simply click the link here :P


To learn up linux, get support on difficulties on installation, your really need irc client for you to access the channels. It is hard to understand, some linux distro do not even installed with irc client by default. Sometimes, certain places even blocks the IRC port, throw your out of irc. But mibbit have solve these problems for you. You do not even need to install any irc client, you can hook yourself at any kiosk and get access to irc channels through Ajax irc client!

Read the rest of this entry »

Posted in mibbit, Misc | Hits: 30012 | 4 Comments »

Python: Threading Callback Timer

March 27th, 2008 mysurface

It is very common that we need to run certain routines periodically, thats why in *nix environment we have cron and in windows OS we have task scheduler. But there comes a time, we may need to execute certain routines finite times within our scripts. Under certain circumtances routines may need to run at background, probably the interval is as short as 0.1 seconds. That is the time we need a threading callback timer.

I have wrote a threading callback timer class for python, you can get it from HERE.

class ttimer takes in few parameters, they are:
interval – interval callback periodically, in sec
retry – execute how many times? -1 is infinity
cbfunc – callback function
cbparam – parameter in list

Let say I define a function to callback,

def dummy_cbf(param=[]):
    print "hello world"

In order to call dummy_cbf() for 10 times with interval 1 sec, here is what I do:


ttimer will run dummy_cbf() in a thread. The thread will died if you script end, therefore you will need to stop the thread manually before your app exit. If in the middle of something, you want to stop the timer, you can call Stop(). And if you want to check whether the timer is stop, you can call IsStop().

I do includes the sample main function in ttimer.py, you can download and execute it like this:

python ttimer.py

Posted in Developer, python | Hits: 72302 | 5 Comments »

gcore: Obtain core dump of current running application

March 24th, 2008 mysurface

Core dump is always developer’s friends and can be admin user’s nightmare. Developer’s can always get some clue of what’s going wrong through the core files, given that the apps is compiled with -g.

In order to get core dump generated, we must enable the core through ulimit. Generate coredumps to help developer for debugging introduce you how to enable core dump as well as how to access the info through gdb.

Sometimes, the app may hangs there, reject to response. This is really headache for the programmers to debug without looking into its internal, investigate whats going wrong. You may choose to debug it directly through gdb. Or maybe you would like to generate the core file and send it to your development team. You can choose to abort it and collect the core file.

But what if abort is not the case? and you still want your apps to run, but wanna take a snapshot of current running apps into a core file?

Thanks to W.G. that leaves me a comment introducing gcore to us, that consider a godsend, and I think this command is really useful. Yes, a simple command that allow us to get core images of running processes.

Let say I am running an app call matrix (a simple ncurses sample app that emulates the words flow). I can obtain the process id by using pgrep and pass to gcore like this:

gcore `pgrep matrix`

The core file you obtain will be core.pid format like this:


A tiny nice option gcore support you change your output core file’s name with -o

gcore -o matrix `pgrep matrix`

The line above will produce the core file as below:


Freebsd provides a better gcore, it does allow you to temporary STOP the running process while gathering the core image, and resume it when done.

gcore -s `pgrep matrix`

Posted in Admin, Developer, gcore, gdb, pgrep | Hits: 68531 | 5 Comments »

umask: create new files with specified file mode

March 8th, 2008 mysurface

Did you realized that every time we create a new file in Linux, it always been set with certain file mode?

Lets see this:

touch testing
ls -l testing
-rw-r--r-- 1 mysurface mysurface 0 2008-03-08 01:14 testing

Refers to the chmod examples post, read, write and executable permission value is 4, 2 and 1. In this case, the file mode value of testing is 644.

Executable mode will not enable by default, lets enable it.

chmod +x testing
ls -l testing
-rwxr-xr-x 1 mysurface mysurface 0 2008-03-08 01:16 testing

As you can see now, the file mode is 755.

To control the file mode for every newly created file, we can use umask. umask is the inverse of the file mode you want it to be, let say you want your file mode always 774 (-rwxrwxr–) , your umask will have to be 003. How to get it? 777 – 774 = 003.

To check the current umask we are having, just type:


The value padding 0 in front indicate that is octal value, therefore our current file mode is 755, because the executable is not enable by default, it then become 644 when the file was newly created.

Read the rest of this entry »

Posted in Admin, touch, umask | Hits: 44842 | 2 Comments »

Experiencing with iPython

March 5th, 2008 mysurface

What is iPython? Is it something to do with Apple Macintosh? as stylish products like ipod and iphone? If you are enjoy coding python like me, yes ipython is a stylish and very interactive python interpreter.

Auto Complete
ipython support auto complete, which is the very first reason I use it. With auto complete features, it increase the fun of learning the python lib by reducing the steepness of learning curve. If you try, you understand why.


Support shell commands
I have been using ipython for awhile but why I didn’t write about in the first place? I’ll been using it’s auto complete feature for to learn and test the libs while coding it. Until one day, I accidentally type ls and press enter. Eh! how come it works? So I further try others command, cd, pwd OMG! it works!

Read the rest of this entry »

Posted in Developer, ipython, python | Hits: 61228 | 3 Comments »