wnd's weblog

November 2014
Mo Tu We Th Fr Sa Su
27 28 29 30 31 1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30

Stockholm, August 2009

28 November 2014 20:16:18 photos, travel

Vasa warship, Stockholm, Sweden Extremely minimal set of photographs from Stockholm, Sweden. If it weren't for Vasa, I suppose there photos could be from anywhere. You have been warned. See the few photos here.

Permalink | Comments (0)

N900/Fremantle and Iodine

15 June 2014 09:11:31 maemo, software

Grab a minimal-dependency iodine client start up script from here.

Long story short: I've rewritten iodine-client-start to have minimal dependencies and to run with standard Bourne shell. The only additional packages this script should require are iodine and iproute.

Back in the days when Nokia N810 was my main and only "internet tablet", I discovered iodine, a IP-over-DNS tunneling... thing. I set up my own server and tried to set up the client with provided iodine-client-start script. Things didn't work out-of-the-box and I soon discovered number of dependencies. Because I was keen to see iodine in action, I quickly built a package with all necessary dependencies in it. If my memory serves me right, I had to strip down things like ipcalc to run on Diablo, and compile some others. Eventually I got Iodine to work, and never bothered to properly package things.

When I finally got a N900 of my own, I tried to set up Iodine client for it as well but failed. Life being busy and all, I never get around to get things working. Until two weeks ago. I was walking back home from downtown and being nice and sunny day, I stopped to sit on a bench. I can't remember what I was going to check online, but in any case I tried to establish an internet connection using an open AP that happened to be there. It turned out it was one of those that requires a login. One thing lead to another, and by the time my head hit the pillow that night, I had a nice little script ready for field testing. Much to my surprise it worked without a hitch - except that the routing to my own subnet was broken from my iodined.

Permalink | Comments (0)

Vim and long lines

4 December 2013 18:29:11 rant, software
highlight LongLines ctermbg=red ctermfg=white
match LongLines /.\\%>81v/"

Some months ago I switched to i3 window manager after discovering a Vim option to highlight column 81. As silly as it may sound, not easily spotting long lines was one of the biggest reason for not switching earlier. However, colorcolumn option wasn't perfect. It messed up using X11 to paste text from Vim.

When I first grew tired to colorcolumn and loads and loads of unwanted whitespaces in pasted text, I figured I'd use X resources to configure rxvt to draw column markers. These markers would obviously be completely separate from actual text buffer. After struggling to introduce X resources in rxvt, I realised my plan also was flawed; this wouldn't work properly with Vim's windows.

When the time to have a Christmas party at work arrived, I realised I'd have quality time to work on this again. I patched rxvt with a private set of VT escape sequences to manage a list of column markers. Adding this functionality was surprisingly simple and the unminimised patch (without partially implemented X resources) was just 145 lines. The next step would be to create a Vim script, or in worst case scenario, patch Vim to send required sequences to set the markers.

When I was testing my fancy little patch, I came across some settings in Vim configuration file I had added for highlighting redundant whitespaces a decade earlier. That's when I realised I could use exactly same thing for highlighting long lines. It wouldn't be exactly as pretty as my fancy little patch, but there would be no patching and no compiling.

The next time I think I need to patch some piece of software, I really need to sit on my hands and think if it's really the only way. That would have a lot of time.

Permalink | Comments (0)

Linux, SD card readers and HAL

4 September 2013 17:59:31 for future reference, Linux

If your copy of GNU/Linux can't find your SD card in a reader, try running lshal (which can be found in package hal in Debian) and then check again.

Earlier today I was trying to copy the stuff from an micro SD card, but failed miserably as the kernel log didn't mention a thing about the card when it was inserted. Puzzeled, I inserted the card in my cheap Chinese Android tablet and behold, the stuff was there. I then tried the same card with a Linux laptop with no success. Baffled, I also tried other SD cards (regular and micro) with my desktop. None of the cards worked. The card reader appeared as /dev/sdg and that's all there was for it. At the same time using an USB adapter for the micro SD card worked perfectly fine.

After asking the almighty Google about this, someone suggested running lshal as a mean to investigate remotely similar problem. After installing HAL, running it and grepping the output I saw the card was now available through /dev/sdg1. dmesg now also mentioned this "newly" attached device.

Obviouly I've fallen behind after introduction of DEVFS and udev, as I didn't even think of HAL. In fact, I don't even really know what HAL is. I've known what it stands for, I've known that for quite some time, but that's about it. I still find it odd that dmesg didn't list the device until hald was started (upon running lshal). Also, if HAL was so crucial part of the system nowadays, why is it marked as optional in Debian? My understanding here is rather limited, but why did things work so differently for "plain" USB sticks?

Oh well, immediate problem solved. Perhaps I educate myself about all this later.

Permalink | Comments (4)

i3 window manager

6 June 2013 09:36:23 rant, software

I'm in love with "i3, improved tiling wm", my current window manager of choice. I can't understand how I managed to live without it for so long.


When I first started using GNU/Linux back in 2000, one of the first choices I made was picking a window manager. I tried an early version Sawmill (Sawfish), Enlightenment, Fvwm and others. Eventually I settled with Fvwm which could be configured to be near-perfect match for me. Even though I had come from Amiga and Workbench, I absolutely loved focus-follows-mouse, virtual desktops and the pager, the ability to bring windows to front and sending them background by simply clicking the frame and so on. As time went by, I added more obscure commands to move and resize windows and removed all but one widget from the window frame.

fg Even though I was mostly happy with Fvwm and Fvwm2, I often ended up opening far too many terminals for tasks that were only supposed to take seconds. My usual workflow to use several desktops and organise stuff accordinly usually worked well because I only had one or two overlapping windows on each desktop. With one-shot windows, however, I sometimes had to hunt for that one terminal with Vim put in the background. Furthermore, this helped me to form a habit of typing "fg" whenever there was no Vim running on that terminal. Clearly there was something wrong.


Eventually I was introduced to tiling window managers. I loved the idea and tried a few, namely xmonad and wmii. I decided to skip awesome for naming reasons and ion because of the author's attitude. These experiments confirmed that I liked the concept, but could not switch because I was so fixed with having a terminal window limited to exactly 80 columns. This was because I believed (and still do) that no line of code should have to be wider than 80 columns or there was something wrong with it. Yes, even with 8-column indentation. If there wasn't an option to force certain windows to certain size, this would be a showstopper.

As time passed, I came across a Vim option (colorcolumn) to highlight given column. Even though the option made pasting stuff over X a bit more cumbersome (as each line would have whitespaces at the end of each line), I started using this option. Some time later I heard about i3 and decided to give it a go on my home computer. Configuring i3 took almost no time and with this newly discovered Vim option, I was happy. When I realised that I could make certain window classes to always be floating I was even happier. These always floating windows would only be used to very temporary stuff such as showing feedback for keyboard shortcuts that controlled command line applications.

Point of no return

After a few months of running i3 on my home computer, I started using i3 on my work computer as well. This was one of the best choices I had made for quite some time. i3 on dual screen setup was even better than i3 on a single screen. It wasn't just good, it was absolutely brilliant. I could easily change focus between two screens, change the content of either screen without touching the other, move focus between windows intuitively and efficiently, open a persistent "scratch" terminal anywhere and hide it again - all with a single keyboard shortcut. I could still sends number of Vims in the background, but now there was little need to do so. Right now my only regret is not trying this earlier.

I'm sure my honeymoon period with i3 will have to come to an end, but right now I couldn't be happer with my decision. Much like with Ruby, all the pros easily outweight the cons. Do yourself a favour, have an open mind and give i3 a go.

Permalink | Comments (0)