Posts Tagged ‘myConf’


Sunday, August 28th, 2011

Imagemagick, again

There has been quite a lot of hacking using imagemagick this past week, all of it for FSCONS use.

My first hack was to create an image for use in the MyConf site, to visually mark up passed timeslots as, well… passed.

The idea I had was to set a background on that html element which would have “Session has ended” written diagonally from the lower left corner to the upper right.

Greg convinced me that there must be better ways to mark this up which would at the same time not interfer with the readability of those sessions, and we ended up going another way, but this is how to create images with diagonal text anyway:

$ convert -size 400x200 xc:none -fill red -pointsize 40 -gravity center -draw "rotate 337.5 text 0,0 'Session has ended'" tmp.png

This will create a 400px wide by 200px high image, with a transparent background and red text, rotated to lay diagonally across the image, beginning in the southwest corner of the image and ending in the northeast.

The next day Rikard had an idea about using an FSCONS crowd image as background for another image, and have parts of the crowd “bleed through” the overlaying image.

This is of course something one can do in GIMP, iff you have learned how to. Rikard struggled with that, got help from Jonas, but ultimately the result wasn’t good, and he’d have to do it all over again, at which point Jonas had left for the day and he didn’t remember what had been done.

Which got me thinking “this must be doable in imagemagick, and repeatable (i.e. a shell script)”. Of course it was.

It is a two-step process, first you’ll need to prepare the overlaying image, by making parts of it transparent, enabling the background image to bleed through. This is done with:

$ convert overlaying-image.png -transparent black new-image.png

In the above example, the color black in “overlaying-image.png” will be made transparent, and the output saved into “new-image.png”.

For my tests, as I only needed a background image, and as anything would suffice, I had imagemagick create one for me:

$ convert -size 525x525 xc:blue bg.png

This will create an 525*525 pixel image with a blue background color.

With this done, all we need do is to merge the two images (“new-image.png” and “background-image.png”) together:

$ composite -gravity center new-image.png background-image.png resulting-image.png

One little gotcha with this command above: I haven’t tried what happens when I use two differently sized images. I am assuming that things will get cropped.

Media Queries

This Thursday I was introduced to Media Queries, a rather cool technique for having CSS determine (well, I suppose it really is the web browser which does all the work, while CSS is just the container for the rules) which styles to apply, depending on certain browser attributes (such as current width of the window, etc.)

Greg has implemented this in MyConf and it is pretty cool when you shrink your browser window down to about 200 pixels or so, and the page transforms before your eyes.

graphvis and neato

On thing which have bothered me about neato for a long time is that I could never find a way to have the nodes not overlap in the generated image.

There is syntax for how to space out nodes inside the graphviz grammar, and it works… sortof, but I actually found a better way to go about it now.

$ neato -Tpng -o resulting-file.png -Goverlap=false


When I updated the WP Stats plugin this Friday I was “greeted” with the message that I wouldn’t receive any further updates to the stats plugin and that I should get Jetpack instead.

It promised to be great and awesome and connect my blog to the “WP cloud” (whatever that is), but instead of filling me with optimism and making me look forward to that change, all that message managed to do was make me think “ok, I wonder how long before they’re gonna start charging for access to all this Jetpack functionality”.

Automattic is of course free to do so if they feel like it, but I can’t help but feel that it is ass-backwards to have the self-hosted platform, and then try to tie it into that “WP cloud” (whatever that is, again they leave me with more questions than answers)…

The funny thing is that WP Stats was one of the features that I really liked, and which made me hesitant to move somewhere else.

So thanks Automattic… but no thanks. Time to speed up the plans for migrating to fugitive…


Sunday, June 12th, 2011


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.


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

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:

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


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