Budts.be: version 3 is here
Today I'm happy to launch the new version of my weblog. (Oh and also the rest of the website, although some content still needs to be updated.) This is version 3 of the weblog, not counting my very first weblog at blogger.com. Although it's only been 1.5 year since I switched from Nucleus CMS to Wordpress, I once again switched over to another CMS: Drupal. Not because I was unhappy with Wordpress (it's a really nice system), but Drupal gives me a lot more flexibility. Flexibility which I needed to implement some new ideas I had for this version of the weblog and my website in general.
I have always maintained a few different sites, running on a plethora of applications. I had my photo website (fotos.budts.be), which ran on ZenPhoto; I had lightyear.be with the activity stream, running on Gregarius with some self-hacked ruby code to write the final stream; Then I had my cv-site (budts.be/jeroen), which was mainly just static html with some PHP-hackery; Joining the club was also gluefish.net, which was built with some other static html and PHP-code; and finally I had this weblog on Wordpress. Clearly a mess :)
So now all these sites are integrated in one Drupal site. The cool thing about this is that all my content is now available on the website as real content, or 'nodes' to use the correct Drupal-speak. That's right, blogposts are nodes, normal pages are nodes, photos are nodes, tweets are nodes, delicious-bookmarks are nodes*, project pages are nodes, (allmost) everything is a node. This has the advantage that I can tag nearly everything on the website with the same set of tags so you and I can easily read all of the content about something. And it also allows easy searching.
Dell Latitude E6510, screen and touchpad
When we got our new laptops at work (Dell Latitude E6510) we had some various problems while installing our preferred Linux distros on it.
The first problem which we all had was trying to get the screen to work. I could get it to work by booting with the following kernel params xforcevesa nomodeset (I also removed the default quiet splash). Now I just run with only nomodeset, which works without problems for me, but without 3D. Jan has compiled a patched kernel for Ubuntu with 3D support but with less colors.
Then the second problem: scrolling with the touchpad didn't work. To fix this I ran the following commands:
1 2 3 4 56 7 8 9 10 | cd /tmp/ wget http://launchpadlibrarian.net/57421117/patch-dell-e6510 sudo apt-get build-dep --no-install-recommends linux-image-$(uname -r) apt-get source linux-image-$(uname -r) cd linux-2.6.35/drivers/input/mouse/patch -p0 < /tmp/patch-dell-e6510 make -C /lib/modules/`uname -r`/build M=`pwd` psmouse.ko sudo rmmod psmouse sudo cp psmouse.ko /lib/modules/`uname -r`/kernel/drivers/input/mouse/ sudo modprobe psmouse |
Reisverslag Guatemala 2010
Nadat we vorig jaar een kijkje hadden genomen in India en Nepal wilden we nu wel eens meer richting Amerika trekken. Ook wilden we eens een groepreis proberen. We hadden in India gemerkt dat we toch wel tijd verloren aan het zoeken naar de juiste plekken en we toch niet overal zo direct onze draai vonden.
We hadden al van verschillende mensen vele positieve dingen gehoord over Djoser en zij bieden sinds dit jaar een 17-daagse rondreis door Guatemala aan. Ons eerste plan was Mexico, maar als we het aanbod bekeken leek Guatemala ons aantrekkelijker omdat het zowel echte Maya-cultuur heeft, maar ook jungle en mooie natuur, zodat het, zo hoopten we, een gevarrieerde reis zou worden. En dat werd het ook!
Hieronder het verslag van onze reis naar Guatemala (en een klein stukje Honduras), die we deden in oktober 2010. Onze groep bestond uit 5 Belgen en 5 Nederlanders (waarvan eigenlijk 1 iemand van Spanje kwam) als je de reisbegeleidster meerekende. Het verslag is geen doorlopend verhaal, eerder een aangepaste versie van de verschillende mailtjes die we naar huis verstuurden (geschreven door Tine) met enkele van onze foto'tjes bij (gekiekt door Jeroen). Zowel de tekst als de foto's in deze blog-post staan onder de Creative Commons Attribution 2.0 Belgium License.
15-16 oktober: Ola Guatemala!
Na 27 slopende uren zijn we gisteren aangekomen in het wondermooie Antigua. Om geen 'dat hoort erbij'-speech uit te lokken, besparen we jullie van onze klaagzang over ontelbare paspoortcontroles, onnoemelijke 'customs and migration'-forms en het feit dat Continental Airlines echt wel een pak zuigt. Om eerlijk te zijn had ik deze nabijtraumatiserende ervaring liever ingewisseld voor een 27-uur durend tandartsbezoek. Zonder verdoving! Soit, het zicht van baggage die onbeschadigd van de band rolde en de chauffeur die een ruim busje had, maakte veel goed!
Vandaag prachtige dag. In de voormiddag Antigua bezocht, een zalige koloniale stad. Erg mooi met al die kleurtjes op de muren van de huizen, de kinderkopjes, de muzikantjes op de straat, de oude gebouwen... en dit allemaal in de schaduw van verschillende vulkanen. In de namiddag besloten we een 'korte' wandeling op een actieve vulkaan in de buurt te doen. Achteraf bleek het eerder een uitputtingsslag maar het was een superervaring. De vulkaan barst geregeld uit en de hele omgeving is bedekt met lava. De wandeling was inderdaad kort maar door de hellingen en het genadeloze pad met grote stenen en glibberig grind maakte dit een heftige tocht. Maar het uitzicht was fenomenaal! En het was erg indrukwekkend om lava te zien stromen in de tunnels onder het pad.
Upgraded to Ubuntu 10.10 (Maverick)
Today we saw the release of Ubuntu 10.10, codenamed Maverick Meerkat. Because I had some time today I immediately decided to upgrade my laptop. As usual the upgrade succeeded without too much trouble. Clicking a few buttons, letting the computer work for about an hour, reboot, and you are pretty much done.
Except for the few small things which break during upgrade. Out of experience from upgrading previous versions I know there are always a few small things you will have to fix. So here are the steps I did after the upgrade:
- The installer disables all your extra PPA's, so when the upgrade has finished I re-enabled those and ran
sudo apt-get update && sudo apt-get upgradeagain. - I quickly discovered that Guake didn't use my nice UTF-8 prompt anymore. This turns out to be a bug in VTE. The TERM variable isn't set correctly when launching Guake, so it acts as a dumb terminal. To fix this I changed the method of launching Guake in my startup script. It used to be
guake &, and now it isTERM=xterm guake &. Fixed! - During installation I saw that the upgraded had decided to remove cups-pdf. Simply reinstalling it with
sudo apt-get install cups-pdffixed this. I don't really know why it was uninstalled in the first place. - To quickly switch between a one screen and a dual screen configuration I used
disper(available from a PPA) on Ubuntu 10.04. Disper doesn't work anymore. However, once you have configured your desired dual screen setup once with the 'Monitors' configuration tool, you can simply open 'Monitors' again and ubuntu will detect the correct screen setup (one or two screens). To setup my correct screen setup I had to open the ATI Catalyst Control Center as root and play a bit with the settings. It was a bit of trial and error, but in the end it turns out support for my setup has improved. With Ubuntu 10.04 I could only select 1440x900 as the largest resolution for my second screen and I had one corner (5 by 5 cm) which was always unusable. Now I can select the correct screen resolution (1680x1050) and it looks awesome. - Because I did an upgrade, some of my settings were kept. I was still using the default ubuntu 10.04 wallpaper, so I manually changed it to the default 10.10 wallpaper (I always like to use the default wallpapers for a while). I also configured the 'programs font' to use the new Ubuntu font, just to give it a try. At first it looked a bit odd, but after using it for a few hours now, I'm starting to like it.
Apart from these small things I really like Ubuntu 10.10 so far. Certainly the upgraded theme looks really good.
VIM: working with "light-projects"
While VIM certainly isn't an IDE, there are a lot of plugins in existence to make it more IDE-like. Although I have been working a lot inside IDE's the past few years, I don't really need all those fancy IDE features (and the bloat that comes with it). That's one of the many things I like so much about Vim, I can just add the features I need to the editor. So while there are certainly at least a few plugins to work with projects inside Vim, I came up with my own system for working with "projects" (call them "light-projects" if you wish). One small note: For the moment this method suits my needs, but since I'm only using Vim for about two months as my main editor, this might change obviously.
Basically, my solutions is based on an autocommand for every 'project' and the command-t plugin. Oh, and sessions as well. The autocommand detects when a file is read (or created) inside the project-directory. In this case, it will source the correct 'vimrc-project-file' and setup everything specific for the project. So as an example, suppose we have a project in ~/Projects/foobar/. In my .vimrc I add the following line (to be more correct, for most of the projects I would add the line in my host-specific vimrc-file, as I mostly use one specific computer to work on a specific project):
1 | autocmd BufRead,BufNewFile ~/Projects/foobar/* source ~/.vim/projects/foobar.vim |
This autocommand simply sources the foobar.vim file everytime a file in the foobar directory is read, or created. Since the foobar.vim project-file is just a regular vim-script file, you can do anything you want in it. I mostly use it to set some editor properties and add some additional mappings, such as:
1 2 3 4 56 7 8 9 10 | " I use autochdir by default, but for this project I prefer " to always be in the project-root. So we first disable the " autochdir option setlocal noautochdir " and then we cd to the project-root cd ~/Projects/foobar/ " in this project i like to use ant, so set it up as the make program inside vim setlocal makeprg=ant\ -find\ build.xml |
I have some other options in my project-vimrc file which are more specific to exploring and navigating code, but I will explain these in a later post I plan to write.
So that's it for automatically configuring vim with settings specific to your project when editing one of the files of that project. One other important aspect of working with projects is to be able to easily open any file of your project. Most IDE's have fancy file-explorers, and a lot of vim-users seem to love the NERDtree plugin. But a few years ago, when I found the OpenIt plugin for jEdit, I discovered that I can type faster than search my way through a tree-structure of directories and files. Resharper adds a similar feature to VS.NET (did I already mention that Visual Studio is just crap without Resharper?). Just press a shortcut, start typing what you need, and let the program do the searching.
For vim I found the command-t plugin. After installing the plugin you can launch command-t with <leader>t (unless you have changed your leader key it will be a backslash, so the correct mapping will be \t). Command-T will index your current directory and it's children. The fact that it indexes the current working directory is one of the reasons why I `cd` to the root of a project in my project-vimrc, so while working on a project Command-T will always index my entire project. The first time you launch it, command-t might take a few seconds before the indexing finishes (depending on the amount of files in the directory-tree), but the results are cached, so next time you launch Command-T it shows up almost instantly. Command-T will now show you a list of all the files in your project. Now you can just start typing parts of the filename (or even of the path to the file) and Command-T will filter out the matching files. If the correct file is selected, simply press enter and Command-T will open the file. I really find this a lot easier than hunting down the file myself.
One last feature of Vim I use for projects are sessions. If your Vim is compiled with session-support (it probably is), you can let Vim write a file which contains a list of all the buffers you have opened (and mappings etc which you have defined while editing). When you want to continue working on your project, you can simply instruct Vim to open the session from the session-file and Vim will restore all the opened buffers, mappings etc.
While this is already useful, I think it still requires to many manual actions. No problem, plugins to the rescue! The SessionMan plugin makes all of this a lot easier. The first time you start your project, simply save your session with :SessionSave. SessionMan will notice that you currently don't have a session and ask for a name, so you can enter 'foobar' (if that is the very original name of your project). When you start vim again to continue working on your project you can now simply use the command :SessionOpen foobar to open your foobar session. Also SessionMan will automatically save your session when quitting vim. Another useful command is :SessionList (which I have mapped to ,s). This shows a list of all your sessions and lets your select the session which you want to open.
So in short, when I want to continue working on a project:
- I launch gvim
- I type
,sto open the sessionlist - I select the correct session
- Vim restores all my opened buffers and windows
- Thanks to the autocommand for the project, vim is correctly setup for the project
- I can quickly open files with
\t
Using your Bash and Vim config on multiple computers
Not long after I switched to Linux I started modifying my .bashrc file. In a .bashrc file you can set options for Bash, add aliases, configure your Bash prompt etc. When I decided to start using Vim as my main editor a few weeks ago, I also started tinkering with the .vimrc file. The .vimrc file is, similar to the .bashrc file, the place-to-be to configure Vim.
Obviously I wanted to share all these config-files between my work machine and my personal computer. That is why I set up a Git repository on my Dreamhost webspace. With most of your important config-files in a Git repository you can easily share your config between multiple computers and you get a history of your modifications as a free bonus.
Because I want to keep it clear which files are in the Git repo and which files are not, I just created a directory in my homedirectory called 'scripts' (so at ~/scripts/). Everything in that directory is in Git, everything outside the directory is not. But because the Bash and Vim RC-files are outside the ~/scripts/ directory you will have to do some additional step to make those programs use the RC-files from the scripts-directory. For Bash, you can simply source your own Bash-file from your .bashrc by adding the following lines to the end:
1 2 3 | if [ -f ~/scripts/bashrc/bootstrap ]; then source ~/scripts/bashrc/bootstrap fi |
For Vim, I simply create softlinks to .vimrc and .vim/ (if .vimrc and/or .vim/ already exist you will have to remove them first). On the commandline type:
1
2
3
4
56
7
8
| # make sure you are in your home directory $ cd # remove the .vimrc and .vim/ if it exists (this will delete everything, obviously!!) $ rm .vimrc $ rm -rf .vim/# make the softlinks $ ln -s scripts/vimrc .vimrc $ ln -s scripts/vim/ .vim |
Settings specific to one computer
Because I use every computer for a different task, my preferred configuration sometimes slightly differs for each machine. That's why I came up with a small addition for both Bash and Vim. In Both cases the default configuration file sources an additional configuration file, which is specific to the machine. To automate this, I use the hostname of the machine. So for Bash I have the following lines at the end of my bootstrap script:
1 2 3 | if [ -f ~/scripts/bashrc/$(hostname -s) ]; then source ~/scripts/bashrc/$(hostname -s) fi |
When this code is run on my personal pc, it will look to see if ~/scripts/bashrc/andoria exists, and if so execute it. On my work-laptop it will source the file ~/scripts/bashrc/delta-vega. When I use the scripts on another machine, no file specific to that host would be found, so nothing would be executed. But adding host-specific config for that machine would be as simple as just creating an additional file with the hostname as the filename.
For Vim I use a similar approach. At the end of my .vimrc I have the following code, which checks for a host-specific vimrc-addition and sources it:
1 2 3 4 | let hostfile='/home/jeroen/scripts/vim/vimrc-' . hostname() if filereadable(hostfile) exe 'source ' . hostfile endif |
So again, I have the vimrc-andoria file for my personal machine, and vimrc-delta-vega for my work-laptop. One small note: I couldn't get this working without the full path (/home/jeroen/), instead of ~/. But that is probably just something I did wrong. After all, I still need to learn the basics to Vim-scripting ;).
Learning Vim
When I started working on my first PHP project at Inuits I had to decide which editor or IDE to use. Obviously while I was still working in the .NET-world I used Visual Studio, just as almost everybody else. However I also used jEdit at home for PHP, Ruby etc. I always felt that learning a general purpose editor, and learning it very well, is more interesting than learning an IDE for one specific platform (VS.NET in this case).
One of my new colleagues recommended me to use NetBeans for PHP development, so I had a look at it. While I'm sure it has a lot to offer, it just didn't feel like the tool I wanted to use. Obviously I had also installed jEdit. While I have always loved jEdit, somehow I wasn't convinced anymore. I also had a look at gEdit, which certainly has potential if you install some extra plugins and configure it, but compared to other editors and IDE's it seems to be rather limited. So then there was still that other editor. The editor which has fascinated me since at least 5 years. The editor which I have been using from time to time to make small edits on config files. The one editor which has a history which dates back to 1976. Yes, indeed, I'm talking about vi and it's modern incarnation vim (Vi IMproved).
As I already mentioned I had been using vi for at least 5 years to make small changes to config files, mostly over SSH on webservers, so I knew the basics. But the basics are, imho, just not enough to do some serious development. Therefore I decided to try and learn at least one new thing about vim everyday. Be it a new shortcut, a plugin, whatever. Reading an entire article with lots and lots of vim-shortcuts really isn't the best method to learn vim, because it's impossible to memorize them all at once.
However after using other editors and IDE's, such as VS.NET, for so many years, it is difficult to just start with vim, because it has a steep learning curve. By example, I got used to navigating code with the arrow keys, certainly in combination with the control and shift keys, to move the cursor by words and select text. Because I did not yet know the correct vim keys and learning them all at once is impossible I had to find a solution to ease my transition. I found this solution in the mswin.vim script which comes with vim by default. You can enable this script by placing the following lines in your .vimrc file:
1 2 | source $VIMRUNTIME/mswin.vim behave mswin |
This script makes vim behave more like other text editors. It's Vim with bicycle training wheels. You will be able to select text by using the arrow-keys in combination with shift, copy and paste with <CTRL+C> and <CTRL+V>, save with <CTRL+S> etc. Sadly it also uses some bindings, like <CTRL+Y>, which have, by default in vim, a different function thus making those default commands unavailable. While this script is very useful, my goal has always been to learn the real vi-shortcuts so in the end it should be possible to disable the script. You don't keep your training wheels either do you? And a few days ago I learned how to copy/paste from the global clipboard, which I believe was the last shortcut I was missing, so as of yesterday I have disabled the script. Now I hope I don't crash on my face because of the missing wheels :).
Another nice trick I found is to change the color of the statusline depending on the current status. When I'm in normal mode, my statusline is gray, the default for the Mustang colorscheme. But while I'm in insert mode the statusline turns green. To configure this add the following lines to your .vimrc:
1
2
3
4
5 | " first make sure the statusline is always shown set laststatus=2 " then define two autocommands au InsertEnter * hi StatusLine term=reverse guibg=#005000 au InsertLeave * hi StatusLine term=reverse guibg=#444444 |
Please not that this configuration only works for gVim, not the terminal version. But it is possible to adapt it for the terminal version as well.
Oh and just as a reference, here are some of the shortcuts I use to replace most of the shortcuts in other editors:
- w: move to the next word (replaces <CTRL+Right Arrow>)
- b: move to the previous word (replaces <CTRL+Left Arrow>)
- de: delete the next word (replaces <CTRL+DELETE>)
- db: delete the previous word (replaces <CTRL+BACKSPACE>)
- viw: select entire word (replaces <CTRL+SHIFT+Right Arrow>) Note: keep pressing 'w' to select additional words
- "+p: paste from the global clipboard (replaces <CTRL+V> in case you want to paste text from another application)
- "+y: copy to the global clipboard (replaces <CTRL+C> in case you want to copy text to another application)
- "+d: cut to the global clipboard (replaces <CTRL+X> in case you want to cut text to another application)
I'm also using some very useful plugins to help me code, and I have some nice config-settings in my .vimrc, but i'll show these in another blogpost.
Married and a new job!
As you might have read on my Twitter, I got married two weeks ago. My wife - it still feels strange to say :) - is the most wonderful girl on this planet, and far beyond.
Our marriage really was a day which i will remember for the rest of my life. Everything was perfect. Obviously a few small things went wrong, like arriving at the church without the bridal bouquet (doh!), but we really enjoyed the day!
For those interested, our wedding dance was Beste Banaan by Kommil Foo. Our DJ was DJ Patrice, who really did a wonderful job! A DJ who gets nearly everybody on the dancefloor knows his art! Even people which I never expected on the dancefloor suddenly were shaking their butts off. The people from De Vleeshoeve served us one of the best BBQs I have ever tasted. Also the icecream from Gelati Van Houcke was really tasty. And thanks to some friends, our reception also was great (thx guys!!)!
I'm becoming an Inuit
While most of the time, I enjoyed working for Item Solutions, i felt that it was time for something new with some new challenges. When i was at FOSDEM this year I discovered a job offering for a Linux engineer at INUITS. After a few weeks - i'm not a linux engineer after all - i decided to give it a try. While that specific job offering was already filled in, they still where interested to meet me. After two talks they offered me a job, starting as a PHP/Drupal/Ruby developer. I didn't have to think long to decide that i really wanted to accept the job. So, as of mid-july I will become an Inuit.
INUITS is a company which does both infrastructure and custom development, but only uses Open Source/Free Software technologies. As i'm a real Open Source fan and only use Linux and FOSS at home, this really feels like a perfect fit. I'm sure i will learn *a lot* in the coming months and probably years. Learning new and excitings things was something I was really missing lately in my current job. Apart from that i was also growing tired of the windows environment. On top of that I had to travel to Brussels everyday (which takes at least 1 hour from where I live). The Inuits office is 3.6 km from our home (according to Google Maps). Quite a difference!
Inuits also considers itself as a real part of the Open Source community, instead of only being interested in profit. They release patches and code. They sponsor a pinguin in the zoo of antwerp and they help other projects to make this world a better place.
So I am REALLY REALLY EXCITED to start working as an Inuit! :)
Avishai Cohen in De Roma
Een paar weken geleden ontdekte ik de site BandsInTown. Op deze website vind je enorm veel optreden van groepen en muzikanten. Niet enkel optreden in de VS, maar ook in Belgë en Nederland. Maar de echte 'killer'-feature van de website, is dat je hem aan je last.fm profiel kan linken. Op die manier kan je dus door gewoon naar je favoriete muziek te luisteren en te scrobblen helemaal automatisch geregeld een mailtje krijgen met optredens in je buurt. Het duurde dus maar 5 minuten tot ik zag dat Avishai Cohen op 4 februari optrad in De Roma.
Avishai Cohen is een Jazz bassist uit Israël en maakt echt enorm goede en moderne Jazz (dat is natuurlijk mijn persoonlijke mening). Ik heb de muziek van Cohen ook toevallig leren kennen dankzij een foutje van de Media Markt. In hun systeem om CD's voor te beluisteren stond "Aurora" verwisseld met een andere CD, die ik op dat moment wilde beluisteren. Hoewel ik Aurora toen niet gekocht heb (wegens al een te grote stapel CD's om mee naar de kassa te lopen), heb ik de naam toen wel opgeschreven. Een tijd later heb ik Cohen op eMusic gevonden en heb er toen "Gently Disturbed" van gedownload. Dit is echt een heel erg goede en meeslepend album.
Toen ik dus op BandsInTown zag dat Avishai Cohen naar De Roma kwam was ik onmiddellijk overtuigd dat ik wilde gaan kijken. Ik was ook nog nooit in De Roma geweest dus dat was nog een extra reden. Als je in de buurt van Antwerpen woont en cultuur weet te appreciëren moet je daar in feite toch wel eens geweest zijn.
Gisteren was het dus de langverwachte avond. Het optreden duurde zo'n anderhalf uur en vloog echt voorbij. Er werden vooral stukken gespeeld vanop de recentste CD "Aurora" en enkele nieuwe stukken. Het was echt ENORM goed. Cohen speelde zelf natuurlijk op de contrabass en zong ook geregeld met zijn vrij speciale stem. Verder speelde Shai Maestro op de piano, Amos Hoffman op de oud, Itamar Doari op percussie (gebruikmakend van enkele speciale instrumenten die ik nog niet gezien had) en Karen Malka (zang) ook geregeld mee. De combinatie gaf geregeld een vrij oosters klinkend geheel waar ik tegenwoordig wel fan van ben. Geregeld ging het er ook wel heftig aan toe, waardoor het moeilijk was om op je stoel te blijven zitten. Het was echt wonderbaarlijk hoe al de muziekanten hun instrument beheersten en er volledig voor gingen. De drummer moest op een bepaald moment zelfs naar een rekje grijpen waar enkel symbalen en belletjes aan hingen omdat hij zo hevig bezig was dat het onderuit ging (hij had het nog net!). Alle muziekanten kregen ook geregeld de tijd en ruimte om volledig op zichzelf te spelen waardoor zeker niet alles enkel en alleen rond Cohen draaide.
Toen Avishai Cohen aankondigde dat het die avond de verjaardag van de pianist was begon de zaal natuurlijk happy-birthday te zingen. Hierop pikte Cohen op zijn eentje in met een heel knappe solo op bass, met het happy-birthday-deuntje mee in verwerkt.
Het optreden was dus een success. Nadat we thuiskomen heb ik meteen ook nog eens op eMusic gekeken en heb "Colors" gedownload. Ook dit is een heel goed album. En vandaag ben ik tussen de middag even snel naar de Media Markt gespurt omdat ik toch ook wel heel graag "Aurora" wilde hebben. Ook dit is een schitterend stukje muziek, hoewel het live inderdaad toch nog wel net dat ietsje beter klinkt. Maar dat is vermoedelijk met alle Jazz wel zo.