random entry parser

I’ve written a small perl script to parse random entries from the extremely usefull website. Quoting from their site:

Command-Line-Fu is the place to record those command-line gems that you return to again and again.

The script code is very “clean”. I can almost say that it’s written in a very python-ish way.
Sample output:%./
CMD: for (( i = 0; i < 100; i++ )); do echo "$i"; done
URL= Title=Perform a C-style loop in Bash.
Description: Print 0 through 99, each on a separate line.
CMD: rsync -av -e ssh user@host:/path/to/file.txt .
URL= Title=Synchronise a file from a remote server
Description: You will be prompted for a password unless you have your public keys set-up.

You can get it from here: random entry parser perl script

As far as I’ve tested, it works out of the box on default perl installations of Debian, Gentoo and Mac OS X.

Severely degraded harddisk performance on sata_sil by athcool

I am writing this post to provide some statistics on athcool + sata_sil usage. The results are horrible.

Athcool is a small utility, enabling/disabling Powersaving mode for AMD Athlon/Duron processors.
The homepage of the utility has a big fat warning as well:

WARNING: Depending on your motherboard and/or hardware components, enabling powersaving mode may cause:

* noisy or distorted sound playback
* a slowdown in harddisk performance
* system locks or instability

The Gentoo ebuild also has these warnings:

ewarn “WARNING: Depending on your motherboard and/or hardware components,”
ewarn “enabling powersaving mode may cause:”
ewarn ” * noisy or distorted sound playback”
ewarn ” * a slowdown in harddisk performance”
ewarn ” * system locks or unpredictable behavior”
ewarn ” * file system corruption”
ewarn “If you met those problems, you should not use athcool. Please use”
ewarn “athcool AT YOUR OWN RISK!”

Ignoring all these warning I was using athcool for years on my old desktop box filled with 2 IDE disks. Never had any real problem at all, except for a some performance loss. The problem appeared when I first used a sata disk on motherboard’s, Gigabyte GA-7VAXP-A Ulta, sata controller which uses the sata_sil module.

Convert greek characters from latin1 mysql database fields to pure utf8

The Problem
To sum it up, the case is this: many many many web applications were programmed so that they used latin1 collation for their fields inside mysql databases. But most users now use utf8 from within their browsers. What happens is that utf8 characters are getting stored inside latin1 fields, which in return produces chaos! A huge web application that used that kind of madness was WordPress. Luckily (or not) WordPress now uses utf8 everywhere. I’ve known many many many people that got so frustrated when they tried to move from their old WordPress installation to a newer one because all their greek posts couldn’t be exported “easily”, I won’t say “properly” because there are always solutions to problems like this, but all the solutions were not straightforward at all, that they finally dumped the idea of moving the posts and started a new blog.

This is a HUGE problem for many greek (and not only) users and I hope I now have an elegant(?) solution to it.

How much can misconfigured wordpress plugins stall your server’s performance

A couple of days ago I’ve met a guy who has a high traffic blog about tech stuff. The guy was telling me that he has hosting problems and that his blog is getting slower and slower by the day. I’ve offered to help him by providing hosting for him in one of the servers that I administer. After making the transition from his old hosting to my server, which was not an easy thing to do due to latin1 to utf8 conversions that had to be made – it deserves a post of it’s own, I started to notice increased load on my server. Sure his blog had heavy traffic…but could it be that bad ?

Applications Meme

Following the request of comzeradd

answer the following questions with less than 50 words each (mind, only desktop/gui applications):
1. which desktop manager do you use more often ?
2. which desktop application you would not like to see implemented again on linux? and why?
3. which desktop application you definitely would like to see implemented on linux? describe it briefly or point out to a similar application.
4. write the name of the last project (not the very best, the last!) that made you wish to thank their developers so you can thank them now! 🙂

5.(optional) Link the blogs of 1-3 people you’d like to take part to this meme. (no more than three). you can skip this question if you like.

and here are my answers:

1. fluxbox
2. Audio players
3. I don’t have a single desktop application that I use on any other OS and I think it needs implementing on Linux, sure there are applications like CAD and serious audio/video editing for professionals missing, but I am sure that from the psychological point of view, if MS Office worked on linux a lot of people would feel much more comfortable switching to it. Just like what happens with MacOSX.
4. keepassX: excellent cross-platform tool to manage one’s passwords
5. stsimb, agorf, adamo

macports error

While trying to update the installed progs, I got errors like:

Error: Target returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_textproc_libiconv/work/libiconv-1.12" && make CC= -f Makefile.devel && make all " returned error 2
Command output: O lib/genaliases.c -o genaliases
make: O: Command not found
make: [lib/aliases.h] Error 127 (ignored)
./genaliases > lib/aliases.gperf 3> 4>
/bin/sh: ./genaliases: No such file or directory
make: *** [lib/aliases.h] Error 127

The reason was that I was using an old macports version, 1.6.0 instead of 1.7.0. A supo port selfupdate fixed the problem. I hope that in the future macports will be upgradable through normal upgrades like gentoo’s portage and debian’s apt-get tools do so we don’t need to “selfupdate” every once in a while…