Inproductive productivity

For a while I’ve been stuck in slow speed mode again, not really doing great work, just being on average. It feels weird. Don’t really get much done, but I have on the other hand had a great deal of time to test some “new” technologies, well, new as in only 10-15 years old I guess :-). I’ll get back to that later. Also, I’ve begun a new contract at “a big company”.

This is my first time at a really giant hunk of a company, the biggest I’ve seen before was circa 500 people in all, and it moved slower (the beaurocracy) than this in all honesty. This BigCompany is quite interesting to me. Started off with almost 4 weeks of introductions, courses, and so forth. They have a dedicated TEAM of CM’s, that alone is just… wow :-P. I’ve just been put up to speed and started working a little before this weekend so I might be a bit premature, but I like it so far. The weird part is, things happen, but not as I’m used to it. I’m used to 13+hour days and frentic coding/hacking to get things to happen, everyone here eschews away with their 8 hour days — only working overtime at very special occasions — yet slowly things get done, new functionality gets added and so forth.

Another thing that kind of amazes me — and worries me to some extent — is the kind of planning that is done. I’m used to small scale projects with workpackages or task based development, where no workpackage should ever take more than 4-5 days to implement. This place uses a workpackage development structure where each package takes up to 6-7 weeks for 6-10 people to implement. We’ll see how it works out — at least their “stand-up meetings” works :-).

All that being said, I had the time to write quite a bit of python which is a first, then I’ve looked into d-bus architecture which is also a first, and I also looked into Bluetooth and how to use it — some test applications running, fetching services and graphically displaying info about all units it finds etc. The complexity of Bluetooth is rather saddening imho, it’s a horrible protocolstack to work with in some senses, even though I was really impressed by how much python does for you.

I’ve been unused to the whole concept of python before this, and just a tad sceptical. Mainly because of all the problems with version matching that you always wind up having to do, to make anything work properly (try getting scons, trac and wamp, and some more tools working on a win32 machine some day for some fun).

Anyways, I always figured there has to be an upside, and there really is — python is hackfriendly 🙂 . In less than 3-4 hours I went from writing my first simple helloworld to having a scratch written class based graphical (tkinter) interface implementing some very fundamental bluetooth commands. In my world, thats not bad at all ;).

I’ve also had time to learn a lot of new tools at work. I’ll comment on those some other day as I havent seen much other comments on some of them (some is imho very expensive crap with a nice wrappings, while some are completely awesome). Sidenote, I simply adore the systems we are working on 4 xeon with 4cores and 64 gig ram.

I’ll get back later :-).

Work? What work?

January 27, 2009 by · 1 Comment
Filed under: Configuration Management, Linux 

So, just a brief update. I’ve recently (a few months back *cough*) taken over our Linux “education” group at work, and it’s interesting. The sad part is, we mostly only see people who already knows what Linux is as we’re working internally in a world where most people are rather Computer savvy as it is. It’s given me a few new viewing angles though, and I’ll get back to that at a later point.

Currently working on some Trac guidelines for our Change Management process as well. Working from home today to actually get something done with it, as most of the days I wind up getting too many disturbing calls, talks and discussions to be very efficient. Our first two tries at making a decent workflow winded up a bit messy, and I think we really must get this down properly this time.

There are some other things I react on, and want to fix, for example, as it looks now, every single project sets up their own bugtracking/ticketsystem, and every project uses a different system (trac, mantis, clearcase, dimensions, etc). Preferably, this should be centralized in some fashion, and if possible I’d love to get a bit more homogenized environment. As it is, I try to tell people “look, here’s a system for handling your day to day tasks, use it!”. First time, the workflow got overly complex, second shot was also overly complex, and people where put off by all the choices and steps to take. This problem mainly stems from project/change management criterion.

My latest and greatest (yeah yeah) workflow should alleviate some of these problems by making some of the choices less visible to normal users. Ie, we have one task management system and a problem and change management system baked into one, but normal users (programmers) only use the task management system, while the project manager, tech project manager and CM also have the ability to handle problems and changes in separate workflows.

We’re also adding the ability to have supertickets, where a single problem report can contain several tasks. This is a pseudo development so far, as we’re not actually adding the whole deal right now, we’re just adding the idea of it, not bounds checking or views/reports of it. Basically, every ticket can have a superticket (we add a numeric field to the ticket), which can point to another ticket, which is the “parent” ticket. This makes it possible to handle a large and complex bug in several smaller tickets. Anyways, the idea is there, but it’s not fully implemented. If our management likes it, and the others like it, we could implement it for future usage. I’m worried it’s too complex however. At the same time, one complex system might be better than 6 alltogether different systems as it allows for longer time to learn? Kind of like… well, unix for example. Once you find ls, its a darn good bit faster than having to click your way through a whole heap of paths to find the specified file list.

At the same time, both me and PM are a bit tired of Trac’s shortcomings, maybe change to Mantis for example? My general thought to this however is, we need to stick it out i’m afraid… one more system will just make the normal user less interested in the new tool and hence taking even longer to learn. As it is, people use it at a bare minimum cause they dont know it, give them time to learn it properly, and they might come to like it. Comments on this line of thinking?

For now, tata. Back to writing.

Christmas ending

January 4, 2009 by · Leave a Comment
Filed under: Hardware, Linux 

So, christmas and new years holidays is coming to an end. A long and arduous autumn/winter at work has ended, and an equally joyful christmas holiday is ending. This has been the year of working for my part, and the experience has been incredible. In all honesty, I’ve never had the opportunity to work in such a stimulating environment as I have the last few months, and I’m very happy for it.

Me and the girlfriend had the bad habit of buying an Xbox 360 for ourselfs this christmas, which made us realize we have a really small tv, so within 5 days we bought a new one. Then, we realized how bad speakers we have, so we winded up buying a set of bose speakers and new spdif cables within 2-3 days as well. This in turn, and the fact that I finally had some spare time, lead to me spending a lot of time finally getting the HTPC configured and working.

The entire HTPC is worth mentioning since I’ve put it together from parts, and installed/configured everything on my own. My opinion is that mythtv and ubuntu (mythbuntu) has come a long way as a platform for end users, but they still have a long way to go I’m afraid. My biggest annoyance is still the same it was 12 years ago unfortunately, and I think it’s to some extent become even worse over time. Graphics and Sound drivers…

I personally have fairly new nvidia card which I want 3d graphics on, and all the hardware accelerations etc, in other words I’m stuck with the nvidia drivers. You would think it would be easy with the proprietary hardware drivers stuff in Ubuntu, but it’s not. It’s actually worse than some years ago when I last handled these setups, then all you had to do was compile and install drivers in the correct kernel modules directory. Now you have to fight with umpteenth other installers which crashes and overwrites eachothers and so forth, and then when you do an update, all of a sudden you overwrite your working drivers with nonworking versions and you’re stuck trying to figure out just what happened. Also, the choice of good graphics cards has become smaller imho. If you want something powerful, you’re stuck with nvidia or ati. Both drivers are completely horrible to get working. I’m hoping the rumours I’ve heard lately will turn true here, and we’ll finally see better support for open source software from both companies, at least if they could make a single decent installer for the proprietary drivers in the common Linux distributions.

And my final gripe, which isn’t so large as the other ones, the sound drivers. Sound was absolutely horrible back in the days with OSS, whatever soundcard I tried to install, I winded up with either having to run the trial OSS drivers, or choosing between no sound and buying the OSS drivers. This has become much better happily. It’s still not working flawlessly as I just found out (SPDIF took a few hours to get working, and I still haven’t gotten 5.1 output to work correctly over SPDIF).

These are critical areas of an OS (you expect sound and graphics to “work out of the box” these days, not having to screw around with settings/drivers/installers as soon as you deviate by a single micron from the specifications.

On top of this, I had some more serious issues with my iMON PAD remote, once again after reinstalling the system. That I can live with, but it’s a serious annoyance. For some reason, the configurations shipped with mythbuntu had a bunch of codes that where off by a few numbers every here and there, and then there was a lot of buttons not connected between lirc to mplayer and mythtv.

Apart from this, I’m very happy with the setup by now. The basic functionality is there, but it’s made for tweaking and having fun, so there’s still a lot of things I’m interested in doing on it :-).

By now, I’m mainly waiting for work to start again, I feel rested, I’ve gotten to fiddle with some hardware and software, and I got new energy for the new year. I just need to try and get working on my webpage and stuff like that a little bit more so I can finally finish it. Like all IT projects, it’s running very late ;-).

Mednafen configuration for Logitech Precision

October 29, 2008 by · Leave a Comment
Filed under: Linux, Ubuntu 

As I’ve already stated partially, I got an HTPC at home running MythTV on ubuntu. One of the things I’ve wanted to do for a long time was to get some games running on it. Supertuxkart was simple and was installed in less than 3-4 minutes once I understood the basics of the MythGames plugin (typing with a on-screen keyboard and a remote control is slow).

Anyways, I did have some problems getting a NES emulator, or any emulator at all as a matter of fact, running on it, and I also had some problems getting input from the right devices to them properly. I finally decided on mednafen as it seemed the easiest to understand.

Let’s understand the structure. NES and other games are usually downloaded in some image file. Mednafen is installed as a binary. MythGames needs to know about the binary used to launch a NES image, and where the NES images are located. I downloaded mednafen using apt-get install mednafen. Secondly, MythGames needs to know where you will put the images, personally I put them in /var/games/nes/. This is entered into the mythtv configuration using the Setup -> Game Settings -> Game Players. Choose New Game Player and enter

Player name: mednafen (for example)
Type: Other
command: mednafen -nes.stretch 1 -fs 1 -vdriver 0 %s
Rom Path: /var/games/nes

Having a keyboard around when doing this is prefered, using the on-screen keyboard takes ages.

Once this is done, go to Setup -> Game Settings -> Scan for games. This will scan the /var/games/nes directory for all images and add them to the list. To start a game, go to Games. Then get into the “All Games” -> “mednafen” and you should find all the games from /var/games/nes there.

Click one, and the game should hopefully start. The first time mednafen is run, it creates a directory ~/.mednafen/ containing a basic configuration. The following is an example to get my Logitech Precision gamepad running with it:

nes.input.port1.gamepad.a joystick 42190af389429475 00000002
nes.input.port1.gamepad.rapid_a joystick 42190af389429475 00000003
nes.input.port1.gamepad.b joystick 42190af389429475 00000000
nes.input.port1.gamepad.rapid_b joystick 42190af389429475 00000001 joystick 42190af389429475 00000008
nes.input.port1.gamepad.start joystick 42190af389429475 00000009
nes.input.port1.gamepad.up joystick 42190af389429475 0000c001
nes.input.port1.gamepad.down joystick 42190af389429475 00008001
nes.input.port1.gamepad.left joystick 42190af389429475 0000c000
nes.input.port1.gamepad.right joystick 42190af389429475 00008000

nes.input.port2.gamepad.a joystick 42190af389429476 00000002
nes.input.port2.gamepad.rapid_a joystick 42190af389429476 00000003
nes.input.port2.gamepad.b joystick 42190af389429476 00000000
nes.input.port2.gamepad.rapid_b joystick 42190af389429476 00000001 joystick 42190af389429476 00000008
nes.input.port2.gamepad.start joystick 42190af389429476 00000009
nes.input.port2.gamepad.up joystick 42190af389429476 0000c001
nes.input.port2.gamepad.down joystick 42190af389429476 00008001
nes.input.port2.gamepad.left joystick 42190af389429476 0000c000
nes.input.port2.gamepad.right joystick 42190af389429476 00008000

command.exit joystick 42190af389429475 00000006&joystick 42190af389429475 00000007
command.exit joystick 42190af389429476 00000006&joystick 42190af389429476 00000007

Unfortunately, the above changes around a bit from device to device and atm i’m not even sure the i’d will survive from disconnect/connect of the gamepads.

The proper way of doing this is to:

1. Start a game.
2. Press Alt+Shift+1
3. Push the correct buttons asked for on screen to do specified command. (First time you push a button adds it to the command, second time you push the same button marks it “final” for the command sequence. Peculiar, I know. So, to make the game use button 2 and 3 in conjunction to be button A, you’d first press button 2 once, then button 3 twice.
4. hit esc on the keyboard to leave mednafen. The config should now be saved.

I haven’t found a way to create the “command.exit” commands yet. I’ll have to work some more on that.

Linux iMON pad remote controller with lirc

September 11, 2008 by · 2 Comments
Filed under: Hardware, Linux 

In short, the SoundGraph iMON PAD that came with my SilverStone LC20 doesn’t work very well with the default ubuntu 8.04 installation. I’ve previously discussed how to get the VFD running, and am now turning my attention to the remote control and how to get it decently working in mythtv with lirc.

Let’s start by looking at the following image:
In short, red files are “main steps” which the “packets” flow from the remote control, and finally reaching lircd where they are converted from a binary stream into something intelligeble (with the help of the lircrc file, which specifies names for the different hex codes).

blue boxes are configuration files, green boxes are “users” of lircrc — ie, they will connect to lircd and receive all the updates from lircd as needed. Finally, magenta boxes are different things needed to build to get stuff running.

Everything will work out of the (ubuntu 8.04) box more or less, except for the big blobby nice mousepad on the remote control. That one is a mouse — sort of — and doesn’t work at all for me, your mileage may vary however (ie, it didn’t work for me, it might change fast)

Install Xorg, mythtv, mplayer, linux-kernel sources (needed later) and lirc via apt-get or your prefered frontend. Configure the packages, start xorg and make mythtvfrontend start from the .xinitrc if you so wish, and then start via the startx script, or rather make it start up as you feel most comfortable with. I’m an old fart and I like my startx.

Once all this is set up, all things should work, except the remote control, as already said. Most buttons will work, but not the big blobby knob (a.k.a. mousepad).

Well, it’s time to hack the horrible hack I guess. Download lirc-0.8.3 from Also, download the pad2keys patch from

1. Unpack the lirc package.
2. Patch the lirc package with the pad2keys patch (it will most likely fail with some chunks, just look at the patch, and add the code manually, are you a hacker or not?!).
3. Configure and make the lirc package. Don’t install it.
4. run uname -r, note your kernel version (2.6.24-19-server for example).
5. run “locate lirc_imon.ko” (have you updated your locate database? man updatedb, hint hint). If there are more than one in the list showing up, find the one in /lib/modules//blah blah.
6. Copy lirc-0.8.3/drivers/lirc_imon/lirc_imon.ko to the file you found in step 5, and replace the old one.
7. Either reboot, or if you know how to rmmod lirc_imon.ko and modprobe the new one. This might fail if you followed my previous post on islcd=0 etc, if you did, remove that line again.

Don’t forget to edit your lircd.conf with the new IR codes from the webpage. Set PAD key’s to good values, such as this:

Up 0x690281B7
Right 0x688A81B7
Down 0x688291B7
Left 0x6A8281B7

Finally add them to your lircrc in a good way, such as this:

prog = mythtv
button = Up
config = Up
delay = 2
repeat = 1

prog = mythtv
button = Down
config = Down
delay = 2
repeat = 1

prog = mythtv
button = Left
config = Left
delay = 2
repeat = 1

prog = mythtv
button = Right
config = Right
delay = 2
repeat = 1

So, you’re now a hacker of immense proportions. Celebrate with some mead and grow a beard like the rest of the hackers ;-).

Ubuntu 8.04 lirc_imon VFD’s

September 10, 2008 by · Leave a Comment
Filed under: Hardware, Linux, Ubuntu 

I got a silverstone LC20 chassi with a built in iMON vacuum fluorescent display (VFD) and IR remote control. I recently upgraded to Ubuntu 8.04 from 7.10 — yes I know, I am a bit late, but generally you don’t have to deal with kinks like this one when that happens.

Ubuntu 7.10 -> 8.04 changed the behaviour of the lirc_imon module pretty little, yet radically. The old default was to treat all iMON driven screens as VFD’s, but it now defaults to treat all iMON modules as LCD modules instead.

This results in tons of errors being pumped out (10’s-100’s per second), like this one:

Sep 9 21:35:00 fs1 kernel: [ 71.481262] /var/lib/dkms/lirc/0.8.3~pre1/build/drivers/lirc_imon/lirc_imon.c: lcd_write: invalid payload size: 32 (expecting 8)

Also, the VFD will not work. To make a long story short, to fix it, you need to tell the kernel module that the VFD is in fact a VFD and not a LCD, by giving the kernel module the option islcd=0. For example, in /etc/modprobe.d/options:

options lirc_imon islcd=0

I hope this helps anyone out there. I will soon try to have something together on getting the iMON PAD working properly. The basics was simple to get working, but the “mousepad” has been a general pain to get up and running properly.

Qt presentation tomorrow

September 8, 2008 by · Leave a Comment
Filed under: Development, Ubuntu 

So, I’m holding a brief Qt presentation on a demo i made a few weeks back. It’s pretty, and got a ton of stylesheets on it. Going down tomorrow at work. Hopefully people will be a little bit interested at least. It’s not that often I dare get my ass up there behind a podium, or speak up at all for that matter.

To be honest, I don’t know why really, I just hate being in front of people talking and possibly saying anything that might be wrong. Of course, there’s a reason why I’m doing the presentation, and not someone else. I’m the only one with any substantial experience at all of this subject, so why not basically.

Also, I’m feeling horribly stressed as of late. I started on a project last week, and it’s getting to me. Need to take a minute, sit down, and calm down.

Continuous integration and buildserver

So, I finally got around to trying out continuous integration and got a buildserver at home. Ok, not much use on any 1-man projects, but should be good enough for some testing at least. I’m currently using cruisecontrol for it, and so far so good. I’ve got a few points I sincerely react against, but I’ll get back to that a bit later.

For those not knowing what continuous integration is, I suggest reading the above link. Basically, when you run a project, you always run into some “final” integration problems. People have coded each on their own side, and you wind up having to “integrating” the code so that it all works as supposed. In the one extreme, you have everyone coding on their own tree from start to end, and then you finally have an integration session. In this shitty situation, you have no clue how long it will take. On the other extreme, you have “perfect” continuous integration, where every single line of code is tested and checked that it doesnt screw things up.

A buildserver such as cruisecontrol is an excellent tool for doing “good” continuous integration. What it does is as follows, it connects to your central code repository, checks for any changes. If there was changes, it downloads them, and then rebuilds the project(s). If you have done it properly, you also have a ton of tests that you can run on the project. This is then reported or output in several different ways. Did it fail, did it succeed, and so forth.

I might be able to convince my new project manager to use a cruisecontrol server for the project I am working on at the moment, and he sounds like he likes the idea. We just need to consider everything for this project, and I need to figure out just how it works and how to configure it etc etc etc =) . Either way, I think it will be interesting to find out more about this type of development, and to see if it actually changes the development in any large way.

Oh, yes, I currently got two things I need to figure out with cruisecontrol. If I got it right, it doesn’t support GNU Make. Not supporting make seems… well, to be honest, totally stupid. It’s been one of the biggest make systems for 20 years or more, so there’s bound to be like 500000+ projects out there already running Make. I know it’s an old system, but it works, and it’s there already.

The second thing, I’m not totally certain of this, but subversion support seems to be abysmal. I need to look more at it however to find out the lay of the land or something.

Iptables-tutorial explained

August 29, 2008 by · 8 Comments
Filed under:, Iptables, Linux, Netfilter 

So, time to explain whats happened to the iptables-tutorial, it’s been rather dead for a long time now. This is kind of meant as an explanation on what and why things has gone downhill with it, but also kind of a try to define for myself what went wrong back then.

By now, it’s almost 8 years since I started writing on it. It all started as a short term project, a real tutorial if you wish. Due to the demand, I was rather amused at keeping it up, writing more material and so forth, but with time it took more and more effort to keep up to date and to add all the material I wanted in it. While the tutorial was at it’s high, I had 25 000 unique visitors per month on the main iptables-tutorial site alone, and all that traffic generated questions, and lots of them. At times, I received 70+ e-mails with questions per week, which required hours of attention. Also, Apress contacted me at this time asking me to write a book on iptables for them.

Having that burden on top of a project that was originally intended to have fun, learn and to get more experience makes a project much less appealing. Also, at the same time, me and my then girlfriend broke up, leaving me in devastation. In a sense, I lost my muse at the same time as I was the least interested in writing. I spent several weeks trying to get somewhere, but didn’t manage to get 2 pages out of me. This is where I dropped the tutorial the first time. I pretty much went MIA.

Either way, after a while (a bit over 2 years to be precise), I decided to give it another try. I had for a long time wanted to start writing again, and got around to it as I had the time and will. To make a long story short, I got too much to do with school and work and life in general for a while, but managed to get version 1.2.0 out before this happened. Another year later, I managed to get 1.2.1 out, and finally 1.2.2 which was the first printed version at Due to several minor problems, which turned out to become pretty large problems imho, I later decided to pull down the print version while getting my life together again so that I could focus on what needed doing again.

This is where the iptables tutorial is at this time and date. I’m not really sure what I’m hoping to accomplish with this post really, more than generally give people an idea what’s been going on around the iptables-tutorial and try to explain why it’s been … well, not keeping up with developments in iptables and netfilter.

I’m not exactly certain what will happen in the close future with the iptables tutorial. I’m currently working on a few other projects which are better defined and that should hopefully be possible to “finish” properly.. Ie, once I’ve done them, they should stay done. Once those projects are done, I might get back to the whole iptables-tutorial.

Keeping promises

August 25, 2008 by · Leave a Comment
Filed under: Linux 

Well, I did. I did write today again. Hah! 🙂

All work and no play makes jack a dull boy,
All play and no work makes jack a mere toy.

Working again, working on a report of some kind, how to do an embedded linux project properly. It’s hard to define. I know how I would love to have it, but defining it in words is not. I know it should not be hard, but it is. A paper that is very good imho, Tips for planning an embedded Linux project. It gets all the errors down that we made, but it doesnt really define what makes a embedded Linux project great, or even good for that matter.

I also read anatomy of a hack earlier, it’s some interesting stuff, but I’m not sure this is what I would give out to people who really needs it. I’ve tried handing that short thing to a few relatives, we’ll see if anyone of them gets it.

Also, this is the real kicker today, I love Ted Dziubas writing, it’s the best tech stuff I’ve read in quite a while :-). For an example, read his Cloud computing: A catchphrase in puberty.

I’m turning into a real blogger, ain’t I? 😛

« Previous PageNext Page »