Archive for the ‘Personal’ Category

2011w52

Sunday, January 1st, 2012

Merry belated christmas greetings everyone! And by the time this post is published I could extend it with Happy belated new years greetings as well ;)

vim + html5 syntax

I’ve been tinkering a lot with html5 during my vacation and vim just didn’t want to play nicely with the new html-tags.

Namely, as it wouldn’t recognise the new semantic structural tags (footer, header, article, section, nav, aside) it wouldn’t indent the source properly and it was a cause for both distraction, and the resulting frustration.

I was not the first to feel this frustration, and a quick search turned up this result which solved both the html and css syntax issues (check the comments for the css solution). Very elegant solution, and now I’ve also learned about vim’s .vim/after/ directory… That was pretty cool.

Learning html5

I’ve actually shied away from doing stuff with html5, as whenever I tried to wrap my head around the new tags and how they should be used, there were just a myriad of different sites interpreting the usage in subtle but differing ways, but I finally found a resource which makes sense to me, so until a definitive interpretation has been hammered out, that’s the one I’m going to stick with.

Also, for sticky footers using css, and html5, check out this page. I had no trouble getting that to work.

Links

This question pretty much sums up why I like the command line so much

This looks interesting for synching (and deleting) without having to worry about doing “the right thing”

Nice list of things one could do with a home server

Doing it for teh lulz, 1903 style

EA, Nintendo and Sony now only covertly support SOPA (through their membership in various interest organizations). Wanting to eat the cake and still have it huh?

Tom’s Hardware not being amused by SOPA

Oh how I so hope that Wikipedia, Google, et al, will go down this path. (I do think there is a difference between companies lobbying, writing laws, and pressuring governments, and companies urging people to put pressure on governments, so yes, I think this is ok)

An interesting theory about why cinemas are having such a rough time

Haven’t had a chance to try this, but creating art using a written grammar does sound pretty neat, especially if you could get a script and /dev/random involved as well ;)

German police tracking people via silent SMS. I am beginning to think that rms is correct in his cellphone “usage”

Too much reading and constant information overload makes us pretty little passive consumers

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.

System

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.

Communications

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

Heybuddy has been replaced by identicurse as my micro-blogging (identi.ca) 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.

Web

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”.

Development

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…

Server

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.

Organization

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.

Entertainment

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

:wq

FSCONS 2011

Monday, November 14th, 2011

FSCONS 2011 is now over, but fear not, FSCONS 2012 is only about a year away.

All of the participants; volunteers, speakers and visitors alike, whom I’ve had the pleasure of speaking with had only good things to say.

The overall feeling is that this was the best FSCONS yet. I am inclined to agree—but of course I am biased—due to the very low amount of incidents at all.

There were some, which is to be expected, but nothing really major, and nothing showstopping.

There were some close calls, but—and this is one of the many GREAT things about FSCONS: the visitors—in most of the close calls, visitors stepped up, graciously lending their own equipment and thereby saving the day.

And this is what I love about FSCONS. Everyone participating, no matter who they are, what they do, all bring their very best.

That, and getting to meet people I’ve only otherwise known through emails. :)

Finally, rest assured that I have a list of all the small things I observed to be in need of improvement.

2011w45

Saturday, November 12th, 2011

FSCONS

That is all for this week. See you all there :)

2011w38

Sunday, September 25th, 2011

Wow, this week sure shot by in a blur. This, the second week at work (I can’t call it the third, I was only present one day in the “first” week), has been filled with more learning, getting down and dirty with the hardware (i.e. replacing some boards) and generally playing around inside the node.

The highlight of the week must have been when I was fiddling around learning commands on the node, and managed to find what Pontus described as a “not entirely insignificant bug”. Pontus then spent a couple of hours tracing the hell out it, with me observing from the side. All in all a pretty productive day :D

Links

This week has also seen a rather troubling report (part 1, part 2) about Microsoft maybe being able to abuse UEFI secure booting in order to disallow booting something from a competitor, say a GNU+Linux system. While they have responded in a post of their own, which includes innocent-looking sentences like this:

OEMs have the ability to customize their firmware to meet the needs of their customers by customizing the level of certificate and policy management on their platform.

This however, does not fill me with any warm and cuddly feelings. This just attempts to give Microsoft an alibi, so that they can say “hey, we aren’t doing anything, blame the OEMs.”

At the same time Microsoft could, since they have a great big part of the desktop market, tell OEMs something along the lines of: “If you bundle other UEFI keys than ours, we might not want you as an OEM partner.”

Of course I can only speculate, but from previous observations I wouldn’t put it past Microsoft to do something like this. From a business perspective it makes perfect sense, and if that means that Patrik in Göteborg can’t boot his computer, well, you have to break a couple of eggs if you want to make an omelette right? Shit happens, right?

But hey Microsoft, please prove me wrong, the ball is yours.

Update: My poor motherboard seems to have gone to that very tiny electron in the sky :(

I guess it is time to start looking at buying new components…

:wq

2011w36 — 2011w37

Monday, September 19th, 2011

The regular readers might have noticed that there weren’t any weekly summaries the last two weeks, and the reason for this was a series of rather fortunate events which conspired to leave me with very little time or energy to compose a summary in.

Very shortly summarized, I have gotten a job at a pretty cool consulting company, and Wednesday (7th, week before last) was my first day at my assignment, quickly followed by an introduction day at my company, and a long weekend (Friday–Monday) conference trip to Barcelona.

So, a great big thank you to CoyPu, pesa, hesa, jonaso and razor for all your help in both acquiring the job, and keeping my spirits up. I really appreciate it.

There really isn’t much more to say, the previous week was filled with reading GPRS documentation and figuring out how an SGSN fits into it all, and I kindof suspect that the coming weeks will be equally devoid of cool stuff I’ve found, while I get myself settled at work.

hook’s suggestion to check out ConTeXt has begun rooting itself as I feel myself more and more drawn to exploring it. And I also believe the time have come for me to learn the LaTeX Beamer class in ernest.

To that end I have actually located what looks to be a rather good resource.

I have also begun seriously considering starting encrypting (parts of) my home partition, and have started looking at EncFS for that purpose.

pesa had some good ideas for how to integrate this into an auto-starting process. I’ll have to experiment a bit with that.

Finally, another tip from pesa was to replace ~/.Xdefaults with ~/.Xresources and in .xinitrc execute xrdb -m ~/.Xresources

:wq

2011w35

Sunday, September 4th, 2011

I guess the first big thing to happen this week, which I’d be remiss if I didn’t mention it, is that I got a job :D

passtore

This Tuesday I also awoke with the idea that I really should, somehow make it easy for a user to sign the configuration file of passtore. And of course to check said signature as well.

What I want to achieve with that is to engineer out the flaw in security which would appear if an aggressor got hands on the system and added his/her own key id to the list of recipients in the configuration file.

I’ll have to think about that some more.

chattr +i

I don’t particularly like flash. Sadly a great big chunk of the Internet becomes useless without it, and although I should take a firmer stand against flash I have the flashplugin for Firefox installed. One of the really nasty things about flash is those persistent super-cookies which can be set, and quite frankly, Firefox has become a bit heavy lately, so I have been looking around for ways to cut back on add-ons.

I am currently trying out Privoxy as a standalone ad-blocker, and today I got the idea of trying to replace the “Better Privacy” add-on with some file-system hacking instead. In short “Better Privacy” works by trying to detect when a flash super-cookie has been set, and remove it.

This cookie is stored in a file, locally on the file-system. So I did a little thinking. In my home directory there are two hidden directories: .adobe and .macromedia, both containing a directory named Flash_player. Inside one of those (I guess it depends on the version of flashplayer which directory is the relevant one) flash stores these cookies.

So my first idea was simply to delete those two directories. Which of course is silly. The relevant one will just be recreated, at the latest upon the next Firefox restart. So that wouldn’t work.

I could of course instruct fsniper or incron to watch those two directories and have them pounce any newly created content within with an rm -rf command, and although that would work, I don’t particularly like scripted events which includes an rm command. Also I’d have to divert some system resources to that (yes, there are plenty of resources to go around, that’s beside the point) activity, and that wasn’t to my liking either.

Finally it dawned on me. If I removed the directories, they would just respawn, so I’d need to keep them there as placeholders, and make them non-writeable, and really immutable. That way, any time flash would try to get cute, it would hit a brick wall.

So what I ended up doing was:

  1. Purge any and all contents inside .adobe/ and .macromedia/
  2. chmod 0500 ./{.adobe,.macromedia}
  3. sudo chattr +i ./{.adobe,.macromedia}

So now the owner (me) can only read/list the contents of the directories (not modify them) and with chattr +i they are immutable, requiring root privileges to change those permissions.

Your move flash…

Links

Schneier on Security: The Efficacy of Post-9/11 Counterterrorism

MITnews: Killing a cancer cell from the inside out — although I’d worry about mutation, or weaponisation…

Solving excel troubles by thinking out of the box

Saturday, July 2nd, 2011

A friend of mine just pinged me, wanting to know if I knew a way to programmatically add a range of number sequences to an excel worksheet.

I know nothing about excel scripting (or VBA-stuff or that type of things). But that didn’t stop me from getting an idea.

So I questioned him relentlessly until I was sure I knew what the expected output should be.

What he wanted was 16560 rows  in a worksheet. Rows 1 through 60 should contain the number 1. Rows 61 to 120 should contain the number 2, etc…

The final 60 rows should contain the number 276.

Why would he want this? I don’t know, some school work I presume. I didn’t particularly care, I assume his teacher wanted that format and was to lazy to provide a template…

I did however care that I found the problem interesting. How could I help, without any knowledge in VBA-scripting, and no desire to learn it within the next two hours?

The solution was rather neat:

$ touch file.csv
$ for i in `seq 1 276`;
do
    for a in `seq 1 60`;
    do
        echo "$i" >> file.csv
    done
done
$ unix2dos file.csv

After having created the file, ensured it would work on his windows system, and transferred it to him (and he verified that it worked to import it and copy the results over to where he needed to work with it) I timed the execution of the loop.

2.33 seconds, against several hours if doing it manually, or $DEITY knows how long if it involved learning how to create a VBA script to do it for you…

He was pleased, I had fun, all in all 25 well spent minutes. Win-win.

And it was definitely easier, for me, to create a csv-file for him to import, than to learn me sum VBA.

:wq

2011w24

Sunday, June 19th, 2011

Vim

I have begun to use {c,d}f<character> to change or delete from the cursor up until (including) <character>.

It has made me a little bit faster in some few edge cases of text-editing, but today (Monday) I found myself in need of doing a couple of manipulations on text up until (NOT including) <character>.

SuperUser.com helped me find {c,d}t<character>.

Very nice :)

MediaWiki sortable tables

In preparation for FSCONS one of my duties as team leader for the Hardware team is to keep track of all the hardware available to FSCONS (i.e. hardware owned by FFKP) and Jonas felt it would be a good idea to have that list available on a wiki.

When I was done adding the laptops and cameras it kindof bugged me that I’d added the laptops in the “wrong” order (i.e. the serial number column wasn’t ordered).

Luckily this was an easy fix, as one can add class="wikitable sortable" to the table header in the wiki-syntax and it will automagically add the necessary javascript and buttons to make each column sortable.

FreedomBox

The “Bump” Challenge aimed at creating a simple(r) way of exchanging public keys and establishing trust, possibly (probably?) using smartphones which are able to sync with the FreedomBox, seems like a rather nice idea.

Personal Wikis

A wiki can be a great tool, and for a while I was maintaining a personal mediawiki installation, just adding stuff I needed from time to time, but never often enough that I could learn it.

Then I stumbled over Zim, which became collateral damage as I got into my “replace as much as possible with a command-line alternative”-phase (this phase hasn’t abated yet ;) ) which left me migrating to VimWiki.

I am not likely to replace VimWiki, it works well for me, but sometimes it might not be the right tool for the job. Which is why I am always on the lookout for new stuff.

I already knew about ikiWiki, but at the time I discovered it I didn’t have the time to look further into it. I guess I should change that.

And today I found TiddlyWiki, a wiki self-contained within an html file. Which people have extended for other uses.

SQLite Triggers

SQLite has support for triggers, how cool is that?! And these triggers can be triggered by other triggers! :D

Links

Vim Casts is a Vim screencast resource for learning / improving your knowledge in Vim (thank you for the tip hook).

Tahoe-LAFS (Least Authority File System) is a decentralized fault-tolerant peer-to-peer file system. I can’t really speak about its security, but it looks pretty good, at least on paper.

ZRTP seems to be a pretty cool VoIP encryption protocol, and there seems to be an implementation for Android devices as well.

“Towards a Lifelong Content Management System” is a rather nice, well thought-through blog post on how we might want to change the way we think about content management systems (thanks @mlinksva).

:wq

2011w23

Sunday, June 12th, 2011

myConf

This is a technology demonstrator of the FSCONS myConf concept that doesn’t rely on any server-side programming.

It also became my first project under git versioning.

myConf is a concept we’ve (FSCONS) been thinking about implementing since, IIRC, 2009.

Basically it should allow a participant to tailor a personalized conference schedule, instead of having to mark it up in a dead-tree version.

Or so is at least my understanding of the myConf concept.

In short it is a Javascript (jQuery) / JSON-powered site, from which I have now learnt two things:

  • It is as important (if not more so actually) to have a good JSON structure as it is to have a good database design, otherwise it WILL come back and bite you, hard
  • It is actually quite fascinating what one can do with Javascript (at least when a library is used so that you don’t need to even think about platform irregularities)

Expect a public release shortly.

vim foldsearch plugin

I was editing my sudoers file (I still haven’t gotten myself off sudo) and started wondering if there perchance wasn’t a way in vim to hide lines according to some pattern.

The default archlinux sudoers file is full of comments, to the point that it is almost hard to see the uncommented lines.

:g/pattern and :v/pattern only takes you so far, i.e. it shows you the lines, but immediately disappears when trying to edit or move or anything except just looking at it.

Luckily for me other people had already asked the same question, and yet other people had answered it.

Which lead me to the vim foldsearch plugin. Best of all, it is easy to use.

Search for something, i.e.:

/my pattern here

and then use <Leader>fs (I have mapped <Leader> to \ in my config, so for me that would be \fs) and voilà, all the lines not matching the search are folded away.

renameutils

I am sure I have already written about renameutils, or more likely about qmv, but it is worth repeating. qmv rocks!

wallpaper-switcher.sh

wmii is my window-manager, although I am probably running version 3.6 or something (i.e. not 3.9) so this might not be usable for people other than wmii 3.6 users.

Anyway, last Friday I got the idea to write a little script to switch wallpapers for me. Today I sat down and hacked it together:

#!/bin/bash
 
tmpList="$(ls -l ${HOME}/wallpapers/*.jpg | awk '{ print $NF }')"
tmpList=($tmpList)
 
randomWallpaper="${tmpList[$(($RANDOM % ${#tmpList[@]}))]}"
 
ln -fs "$randomWallpaper" "${HOME}/wallpaper.jpg"
exit 0

Links

shunit2 Unit-testing for (Bash) shell scripts, this is so cool :D
Akka for a simple way of writing concurrent applications in Java
Protolol jokes for nerds