Posts Tagged ‘Erlang’


Sunday, March 25th, 2012

Woho! Not only a great week at work, but I also managed to squeeze in some other activities as well.

Managed to execute two test cases (yes, that’s a little slow, but there were mitigating circumstances, so all in all I am not too worried, and I did learn from it so it’s all good), got a small lecture in a subsystem (which made me want to tinker with Erlang and mnesia again), went swimming after work one day, and spent Thursday evening at an OWASP event, listening to a very entertaining dude named Jim Manico

There was a change in plans, so the talk wasn’t about Web Application Access Control Design but instead about the ten most critical web application security flaws found on the “OWASP Top Ten Project”-list.

Learning interesting stuff AND having fun at the same time? Oh wait, when I put it like that it just sounds like any other (work)day in my life, but you get the point. Great event, looking forward to the next :)

And Friday evening was spent hanging out with Rikard, Zara and Alfred. All in all, a rather good week.

I did have some trouble with tmux, not all of which I managed to solve.

There were actually two issues, and only one of them have been “solved”, and I use that word pretty lightly because I don’t find the solution particularly good, although it is probably the solution.

  1. Scrolling backwards (up) in an terminal inside tmux is painful. C^b [ sets you in the mode you need to be to enable PgUp to work, but that is not nearly as easy as my muscle-memory-bound Shift-PgUp (plus this also means I need to exit that “cut-mode” or whatever it is called when I’m done scrolling
  2. tmux doesn’t seem to interact all that well with a mouse. I admit, that probably wasn’t high on the priorities, but if I don’t have vim bindings (visual-mode, yank) the mouse is by far the easiest way to copy text from a terminal. Click and hold mouse1, drag over the area to copy, release mouse1, DONE!

The mouse issue is probably easy enough to fix, I suspect I just need to read the man-page better and fiddle some more with the configuration. But I am not so sure about #1. That’s the built-in way to do it… getting something better working there is probably not straightforward at all.

Finally, this week I also “rediscovered” zodiac and I am now pondering whether or not to just use that instead of building my own “makefile blog”-type of thing. I’d need to hack it a bit, there are some things I don’t want to make do without (RSS, prev/next-links, tags) and it would be pretty neat (albeit useless) to have post signing using GPG.


My Software Stack 2011 edition

Saturday, December 31st, 2011

I realize that I haven’t written my customary “software stack” post for this year yet. But hey, from where I’m sitting, I still have … 36 minutes to spare ;)

I’ll be using the same categories as last year; system, communications, web, development, office suite, server, organization, and entertainment.


The OS of choice is still Archlinux, my window manager is still wmii, my terminal emulator is rxvt-unicode, upgraded by also installing urxvt-tabbedex.

My shell is still bash, my cron daemon is still fcron, and my network manager is wicd.

To this configuration I’ve added the terminal multiplexer tmux, and have lately found out just how useful mc can be. Oh, and qmv from the renameutils package is now a given part of the stack.


Not much change here, Thunderbird for email, Pidgin for instant messaging, irssi for IRC.

Heybuddy has been replaced by identicurse as my micro-blogging ( client. Heybuddy is very nice, but I can use identicurse from the commandline, and it has vim-like bindings.

For Pidgin I use OTR to encrypt conversations. For Thunderbird I use the enigmail addon along with GnuPG.

This means that Thunderbird still hasn’t been replaced by the “mutt-stack” (mutt, msmtp, offlineimap and mairix) and this is mostly due to me not having the energy to learn how to configure mutt.

I also considered trying to replace Pidgin with irssi and bitlbee but Pidgin + OTR works so well, and I have no idea about how well OTR works with bitlbee/irssi (well, actually, I’ve found irssi + OTR to be flaky at best.


Not much changed here either, Firefox dominates, and I haven’t looked further into uzbl although that is still on the TODO list, for some day.

I do some times also use w3m, elinks, wget, curl and perl-libwww.

My Firefox is customized with NoScript, RequestPolicy, some other stuff, and Pentadactyl.

Privoxy is nowadays also part of the loadout, to filter out ads and other undesirable web “resources”.


In this category there has actually been some changes:

  • gvim has been completely dropped
  • eclipse has been dropped, using vim instead
  • mercurial has been replaced by git

Thanks in no small part to my job, I have gotten more intimate knowledge of awk and expect, as well as beginning to learn Perl.

I still do some Python hacking, a whole lot of shell scripting, and for many of these hacks, SQLite is a faithful companion.

Doh! I completely forgot that I’ve been dabbling around with Erlang as well, and that mscgen has been immensely helpful in helping me visualize communication paths between various modules.

“Office suite”

I still use LaTeX for PDF creation (sorry hook, still haven’t gotten around to checking out ConTeXt), I haven’t really used sc at all, it was just too hard to learn the controls, and I had too few spreadsheets in need of creating. I use qalculate almost on a weekly basis, but for shell scripts I’ve started using bc instead.

A potential replacement for sc could be teapot, but again, I usually don’t create spreadsheets…


Since I’ve dropped mercurial, and since the mercurial-server package suddenly stopped working after a system update, I couldn’t be bothered to fix it, and it is now dropped.

screen and irssi is of course always a winning combination.

nginx and uwsgi has not been used to any extent, I haven’t tried setting up a VPN service, but I have a couple of ideas for the coming year (mumble, some VPN service, some nginx + Python/Perl thingies, bitlbee) and maybe replace the Ubuntu installation with Debian.


I still use both vimwiki and vim outliner, and my Important Dates Notifier script.

Still no TaskJuggler, and I haven’t gotten much use out of abook.

remind has completely replaced when, while I haven’t gotten any use what so ever out of wyrd.


For consuming stuff I use evince (PDF), mplayer (video), while for music, moc has had to step down from the throne, to leave place for mpd and ncmpcpp.

eog along with gthumb (replacing geeqie) handles viewing images.

For manipulation/creation needs I use LaTeX, or possibly Scribus, ffmpeg, audacity, imagemagick, inkscape, and gimp.

Bonus: Security

I thought I’d add another category, security, since I finally have something worthwhile to report here.

I’ve begun encrypting selected parts of my hard drive (mostly my email directory) using EncFS, and I use my passtore script for password management.

And sometimes (this was mostly relevant for when debugging passtore after having begun actively using it) when I have a sensitive file which I for a session need to store on the hard drive, in clear text, I use quixand to create an encrypted directory with a session key only stored in RAM. So once the session has ended, there is little chance of retrieving the key and decrypting the encrypted directory.

Ending notes

That’s about it. Some new stuff, mostly old stuff, only a few things getting kicked off the list. My stack is pretty stable for now. I wonder what cool stuff I will find in 2012 :D



Sunday, October 2nd, 2011

Stupid shell tricks

A friend of mine asked me this week how one would go about repeating the same command X number of times in a shell.

My first idea was of course a for-loop, along the lines of:

X=15; for i in $(seq 1 ${X?}); do echo "foo bar baz"; done

But his reply to that suggestion was that seems a bit much if all I want is to repeat the command twice…

Ok, so it wasn’t for X equalling any number, it was for X equalling two… sometimes I get the feeling that he is perhaps over-generalizing his questions to me ;D

Anyway, my second answer, given this new input, was: What? You’re too lazy to execute it, push up-arrow and enter?

But of course, his question had already caused me to fork a background process intent on finding a solution.

First I thought about the history command, and I ultimately came up with a solution through reading man history.

echo "foo bar baz"; !#

Note: That semicolon there is frakking important!

“!” when issued as the first char of a new word, should be interpreted as we’re going to do something with the history of this shell.

“#” in turn could roughly be interpreted as On this current line, do again whatever has been done from the start of this line, to where this history command is called

The result is echo “foo bar baz”; echo “foo bar baz”;

I have no idea what he needed that for, it seems pretty limited to me, but either way it’s pretty cool that it worked.

Now guess what echo "foo bar baz"; !# !# does.

How to get into Free Software

A buddy from work and I spoke about open source and free software the other day, and he had a basic grasp about it, but what he felt he lacked were knowledge of useful sites, etc. I.e. perhaps not how to become more involved, he’d already submitted patches to some specific projects, but more along the lines of where likeminded “hang out”?

That’s a poor description as well, and isn’t all that important. It did however get me thinking about it.

There is instead of twitter, instead of facebook or google+. There is, and as well as the local (Swedish) for information about the ideology behind free software, but also for information about how to get involved and the types of activism they engage in.

I don’t really know how to categorize, but I guess it could be a fun place to hang out and either get recognition for your own contributions, or recognize the projects you use yourself.

Then I guess there is the part of the FOSS ecosystem which ?doesn’t exist at all? in the proprietary world (I am sure there are some exceptions to this) such as public code repository sites (savannah.{,non}, gitorious as well as github and bitbucket).

I have accounts on all four, although I make a conscious effort to prefer the first two services over the latter two.

And then of course there are conferences which one could attend, FSCONS (yes, being biased, I put the one I’m co-organizing first) and FOSDEM springing immediately to mind.


Another Humble Indie Bundle in the making. This game looks like it would be precisely my type of thing. Maybe ;)

This Erlang “hello, world!” tutorial has definitively earned itself some linklove.


My software stack revisited – Programming

Friday, December 24th, 2010

Programming is one of my primary interests, mainly because it allows me to stimulate my brain with solving problems, but also force it to think in new ways.


I started programming in PHP, picked up Java and Erlang during classes at ITU, picked up Python on my own during my studies at ITU, and my latest addition would be shell scripting.

Slightly tangent to the topic are the markup languages I have picked up as well, html and css in high-school and LaTeX at ITU. I dabbled around for a while with both creole and markdown, but that didn’t last long.

Editor / IDE

My first and foremost tool of choice given nearly any situation will be (g)vim. The only two exceptions I can think of off the bat is Java (for which I use Eclipse and if I need to write a whole lot of text, with minimal distraction (more on that later).

The pragmatic programmers recommend learning one text-editor, and learn it well. If the name of that editor is vim, emacs, kate, gedit, or whatever, I really don’t care. Just pick up one that fits you, and LEARN IT WELL!

I have extended vim with a couple of plugins, the most prominent being NERD Commenter, matchit, snipMate and sparkup. There are at least two more plugins, but I will write more about those later.

And for Python, I usually install the IPython interactive prompt as it is a fair bit more useful than the standard python-prompt.

Version Control

While studying at ITU I had my eyes opened about the wonderful concept of version control.

I was first exposed to SVN, and while quite capable, I figured it was too much of a hassle to set it up myself, since that would require the presence of a server somewhere to host the SVN repositories.

But then mercurial entered the stage. Git or bazaar would have done the job just as good, but the people orchestrating the fourth term settled on mercurial, and it is so dead simple and still powerful enough for what I need that I haven’t had a reason to look elsewhere.

Issue tracking

For a course at ITU I tried using Mantis, a web-based bug tracker written in PHP, and while it worked well, it was a hassle to manipulate bug reports since it meant I’d have to go online and log in to yet another system.

I have however found a different solution which I am currently trying out: a plugin to mercurial called b with the tagline “distributed bug tracking”. It is a bit too early to tell if it will do, but for the time being it solves the immediate problem of having to go online somewhere to handle bugs.

Next post in line: “Office Suite” software


Random thoughts of a sleep-deprived mind…

Monday, January 28th, 2008

Couldn’t sleep last night, went to bed around 0100 hours (a little late, but I figured I’d manage with 5 hours worth of sleep, as I always try to trick myself) and just tossed and turned until I finally gave up trying to sleep around 0200, and sat down in front of the computer again, watched a movie… or two… while researching some on Lisp and Perl.

This continued until about 0500 when I finally started to feel so sleepy that I surely couldn’t stay awake even if I wanted to (which I didn’t). Oh how wrong I was. A quarter to six I was beginning to drift out of consciousness and into dreamland, but then I realized the futility and just lay there awaiting the alarm from my cellphone.

Great way to start a new day… really… not. So now I’m in school feeling pretty shitty, tired, queasy and freezing. So why would I want to share with you any thought currently in my mind? Good question, I sure as frack don’t have an answer (btw, may the Lords of Cobol make the writers strike end soon so that we can have season 4), but for what it’s worth (probably not much) here goes:

On a more serious note (not that Python, Perl, Erlang, Firefox, sshfs and rsync isn’t serious business) it gladdens my heart to see that more and more governments around the world are embracing the Open Document Format. Hopefully this more than anything will put an end to the madness that is Microsoft OOXML.

Over and out