Posted by Runar Svendsen
on October 22, 2009
How do you make sure your Rails files are added to Subversion before you commit? I have a simple batch file (for Windows currently) which I use, thought I’d post it here if anyone finds it helpful. What’s probably gonna happen though, is that someone points me to a better solution, which would be even nicer
Anyway, here’s the file, so download and place it in your RAILS_ROOT folder:
Add to SVN Batch file
Posted by Runar Svendsen
on June 16, 2009
I was installing webrat on my Ubuntu 8.04 Hardy Heron box and it gave me this error message:
libxslt is missing. try ‘port install libxslt’ or ‘yum install libxslt-devel’
Well, it turns out there is no libxslt-devel on Ubuntu, instead you have to do
sudo apt-get install libxslt1-dev libxml2-dev
and then install webrat (via sudo gem install webrat or add the gem in your environment.rb file).
Posted by Runar Svendsen
on April 07, 2009
I recently installed Wordpress on an Ubuntu 8.10 image and permalinks wouldn’t work properly. I would only get a 404 File Not Found error when I enabled the pretty URL permalink structure. The Permalink function in Wordpress relies on a small URL rewrite statement that Wordpress puts in the .htaccess file at the root folder of your WP installation:
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
Turns out there is a setting in Apache that disables the .htaccess files by default. So you have to enable this to allow the .htaccess files to be processed. The setting is called AllowOverride, and you must set this to All (it probably is set to None right now).
Change your Apache virtual host config file to something like this:
<VirtualHost *:80>
ServerAdmin webmaster@server.com
DocumentRoot /var/www/
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
....
Posted by Runar Svendsen
on January 06, 2009
I can’t believe its not clearfix (sic) because this fixes clears! The tip is from 2005, I have no idea how everybody missed this, but anyway here it is:
Simple Clearing of Floats
Posted by Runar Svendsen
on January 06, 2009
Here is my favorite CSS min-height solution:
Dustin Diaz min-height solution
Posted by Runar Svendsen
on January 03, 2009
My main claim against using Ubuntu is that the font rendering is just ugly and uninspiring. I am no graphic designer, but I love seeing my XHTML rendered in Safari on OS X. Turns out there is a solution that makes Firefox on Ubuntu almost as good as Safari/OS X, and it’s quick, easy and free!
If you want the whole explanation, go to this article, but if you just want the fix, all you have to do is this:
Download this file and store it in your home folder (ex: /home/yourname) with the file name .fonts.config (remember the leading dot). Restart X (press CTRL+ALT+BACKSPACE or log out and in again), and your fonts should be smooth as a you-know-who’s you-know-what.
Below are a few selected web sites captured before (left) and after (right) the font smoothing was enabled.

Posted by Runar Svendsen
on October 07, 2008
This is something I do just too rarely to remember the syntax, so I decided to write it down. Here it is:
To convert an image from color to grayscale (and save the result to a different file), type the following curse:
convert image1.jpg -colorspace Gray image1_grayscale.jpg
If you just want to overwrite the original image, use this command instead (thanks CableCat for the tip):
mogrify -modulate 100,0,50 image1.jpg
Posted by Runar Svendsen
on July 30, 2008
Here’s how to install Robin Sheat’s eMusic download manager on Ubuntu (I’m using Hardy at the moment, but I don’t think your mileage should vary too much, it is a Java program after all..).
These instructions require that you have java runtime v1.5 or higher installed, let me know if this is a problem.. The Java runtime is probably installed by default these days, or you can get it via apt-get. To check if you have the correct version, open a terminal and run “java -version”. You should see something similar to this:
java version “1.5.0.15″
- run
sudo apt-get update (always the first thing to do when installing new programs, see previous post)
- Download the client from this page http://www.kallisti.net.nz/EMusicJ/Download (the most common version to choose is the first link, “eMusic/J for i686 Linux “).
- Navigate to the download folder (i use /home/runar/Applications) and unpack the file:
tar xvf emusicj-linux-i686-0.25.tar.gz
- run
cd emusicj-linux
- run
emusicj and verify that the program is running. Close the program.
- Navigate to /usr/bin and create a symlink to make the program start from the command line:
cd /usr/bin
sudo ln -s /home/runar/Applications/emusicj-linux/emusicj emusic
- Open the application launcher (ALT+F2) and verify that the symlink works by typing emusic and pressing ENTER. See that the application launches.
- Open your browser, navigate to www.emusic.com and select a track or album to download. For Firefox, select “Open with” and press Browse. Navigate to the emusicj-linux folder and select the emusicj application. Check “Do this automatically for files like this from now on” and press OK.
- That’s it! Now you are able to enjoy all your high-quality long-tail fair-use music on Ubuntu!
Posted by Runar Svendsen
on May 02, 2008
This is a short description of how I installed the ImageMagick framework and its Ruby wrapper (RMagick) on an Ubunty 8.04 (Hardy Heron) OS. This tutorial requires that ruby and gems are installed. See www.rubyonrails.com for more info.
Step 0: run sudo apt-get update (thanks for reminding me, HD)
- run
sudo apt-get install imagemagick
- Then, install the imagemagick9 dev library:
sudo apt-get install libmagick9-dev
- Last, install the RMagick gem:
sudo gem install rmagick
- That’s it! Now peruse the RMagick documentation and start processing images!