Feed on
Posts
Comments

I came across some confusing errors when combining patch_socket, patch_ssl of Gevent 0.13.0 (the one in Ubuntu 11.10) and Mercurial today. If you get this error:

__init__() got an unexpected keyword argument 'ciphers'

update your Gevent version to at least 0.13.1. That should resolve your issue. Good luck!

(B)eid on Ubuntu 12.04

This post helped me use my ‘.beID’ device with our Belgian tax-on-web site on Ubuntu 11.10. It didn’t come up in Google right away, so I guessed it needed some additional linking.

I wanted my bash prompt colors in tmux on Ubuntu 11.10 Oneiric Ocelot. The internet didn’t turn up anything 100% right, but after some trial and error, this worked for me: just add the following line to your .tmux.conf:

set -g default-terminal "xterm-color"

This will make sure the following lines in the default .bashrc are triggered:


case "$TERM" in
xterm-color) color_prompt=yes;;
esac

Hope this helps someone.

During the Christmas holidays I started reading Seven Languages in Seven Weeks. That means being exposed to seven new programming languages. Why? Because they all have some aspects that make them worth discovering. Ruby has some extremely agile features I wasn’t familiar with. Io uses prototypal inheritance and is a message passing language. Prolog is a logic programming language, a type of programming language I wasn’t familiar with. Etc. I read part of the Prolog chapter using the preview functionality on Amazon, and it convinced me to buy the book.

After finishing the Ruby chapter last week, I’m getting familiar with Io now. So far the book has been a great read, and I look forward to the rest of the chapters, wondering what new insights Clojure, Haskell, Prolog, Scala and Erlang will bring.

Although the book says answers to the questions and exercises are included in the final pages, they are nowhere to be found. So I decided to push my answers to Github in case fellow readers would like to compare. I’m not sure at all that these answers are correct. They most probably will contain bugs. If you find any, just clone the repository and fix them. ;-)

Based on this blogpost, use this Vim command to format the contents of a JSON file:

:%!python -m json.tool

That is all.

Recently I needed to upload some patches to Review Board. I foolishly tried to upload a patch that was created by git diff (I’m a git-svn user) but Review Board expects an SVN patch… While there are some simple solutions to be found on the web, I could not find any that correctly handled new files in the patch. The closest thing I found was a mail on the KDE panel-devel mailinglist.

I started looking into sed and came up with a slightly more powerful version:

This script supports updated files and new files. I have not tested it yet with deleted files.

Feel free to use it if you need it. Good luck!

Note: a friend linked me a Perl script that does the same thing. I haven’t tested it yet, so I have no idea how well it works.

My Volvo V50’s mp3 player is able to sort the folders it finds on the flash drive I plug into it, but is unable to sort the mp3 files in the folders in any useful way. It seems like it just plays them as it finds them on the file-system. This week I found a utility that sorts the files on the file-system, called FATSort. If you’re a Linux user, make sure the names of your mp3 files start with the track number (01, 02, 03, …), install this utility and run it on your flash drive’s device. Your car will now play your music in the order it was intended to be heard.

If you’re a windows user, this utility seems similar, but I didn’t test it.

I hope this helps a fellow Volvo (or other) owner out. Happy listening!

This is just a quick note to announce that I will be reviewing “Grok 1.0 Web Development” from Packt Publishing. They kindly provided me with an elektronic copy of the book. I’m looking forward to getting to know a new Python web framework (Grok) and the framework it’s based on (Zope 3). To be continued…

Being a big git fan, I was disappointed when I was forced to use mercurial at work. In my opinion, mercurial is not as flexible and powerful as git. But lately I’ve started to use the mq extension of mercurial, which gives me back some of the more powerful features of git I had missed the most.

One thing I liked about git was being able to update my commits to include the name of a reviewer in the commit message, or to include the fixes that resulted from the review in the commit. Read on to see how you can use the mq extension for this.

Continue Reading »

BurgieBot is a project that was started early 2008 by Nicolas Trangez and had some short bursts of development since. Its purpose since has been to run inside a small IRC-channel, logging, and more importantly hosting trivia games. :)

The trivia plugin is the most important feature of BurgieBot, and the one I enjoyed most over the last months. I didn’t announce it back then because it had some small bugs that needed fixing. Those are fixed now, and the bot runs quite nicely. There’s a lot that I wanted to fix/change before releasing it, but following the release early, release often philosophy, I’m releasing it now.

BurgieBot pros

  • Easy to extend with plugins
  • Trivia plugin
  • Automatic reloading of plugins without restarting the bot

BurgieBot cons

  • No i18n, most strings are in Dutch
  • No docs…
  • Automatic reloading of plugins sometimes fails

Download it
Tarball, Zip

Dependencies

  • Python 2.5 or higher
  • SQLAlchemy 0.4.4 or higher
  • twisted
  • pyinotify (used for reloading modules on the fly)

How to run it
Create a settings.py file in the folder containing the burgiebot.py file containing:


channels = ['#demochannel',]
host = 'irc.demoserver.org'
port = 6667
nick = 'BurgieBot'
dsn = 'sqlite:///file.db' # Use an sqlite db
colors = True # Display messages in color

And run the bot using python burgiebot.py

You can browse the code here (yes, that’s a Django-based gitweb-like interface, which is WIP and unreleased :) ), or clone the git repository from http://realnitro.be/git/burgiebot.git/

Older Posts »