As the result of a specific request of a client, I would get an XML file listing images, and I needed to download images using FTP and then add them to the application using paperclip.

Although Heroku does not let you permanently store files on its filesystem, you can use the filesystem to temporarily store files and then upload them somewhere else. In addition, you can actually use FTP on Heroku, as long as you use it in passive mode.

So, the process involved 2 steps

  1. Using FTP to download the files to a dyno
  2. Using paperclip to upload the downloaded files to S3
# FTPing from Heroku
ftp =, user, pass)
ftp.passive = true
ftp.getbinaryfile(remote_filename, tmp_filename)

# Uploading to S3 with paperclip
my_object.attachment =!
Read more (0 comments)

Recently upgraded XBMC from version 12 (frodo) to version 13 (gotham) on my standalone XBMCbuntu install. The current advice from the XBMC crowd is to reinstall xbmcbuntu, but I was not really looking forward to reconfigure the whole box.

Turns out that it is quite simple to upgrade to gotham by removing and reinstalling xbmc. Instructions below. Please do note that although this worked well for me, it is not a guarantee that it will work for you and I highly recommend making a backup in case something goes wrong.

sudo apt-get remove xbmc xbmc-bin
sudo add-apt-repository ppa:team-xbmc/ppa
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install xbmc xbmc-bin
sudo shutdown -r now
Read more (0 comments)

Somebody send me the screen shot below asking: "It's nothing like you to give somebody access to your e-mail, is this really correct?" The answer? It indeed is nothing linke me, and I never gave LinkedIn access to my e-mail or contacts, but the website nonetheless deems it okay to communicate to others that I did.

Bad LinkedIn

This thing led me to quite a search for LinkedIn settings, to see if it had somehow managed to link to my e-mail account or contacts. Nothing indicates so, and the settings don't show any connected sources apart from LinkedIn itself.

Depending on your level of paranoia, I see three levels in how Linkedin got to say this:

  1. Accidental mistake from LinkedIn, e.g., the algorithm fails to check whether or not someone gave LinkedIn actual access to his/her contacts
  2. Intentional misleading statement from LinkedIn, e.g., to create social pressure to link e-mail addresses, even though others are not actually using this...
Read more (0 comments)

On Bitcoins and Value

Dennis | over 1 year ago | Bitcoin Btc

Recently, a lot of coverage has stated that Bitcoins have no value, are part of a Failed Techno-Libertarian Agenda, have a carbon footprint from hell, that they should die in a fire, and that it represents a digital gold rush. Even the NYTimes is reporting extensively on bitcoin these days.

Read more (0 comments)

Tl;dr: Heroku's non-intelligent routing takes about 25% capacity of your dynos

I'm a big fan of Heroku. For everything from really small projects to medium sized projects it has helped me focus on the development of the applications rather than how I deploy it. Recently however, Heroku took some flak after RapGenius, previously a Heroku success story, noted that it did have scaling issues on the platform

Specifically, the routing was not as smart as was advertised: routers do indeed route to 'idle' dynos, but the list of busy dynos is only based on the requests passed through that specific router, without taking other routers into account. Heroku, due to its size, has so many routers that the result is practically random assignment of work to the nodes. What does this mean in practice? To...

Read more (0 comments)

I run Ubuntu in Virtualbox on my retina macbook pro and found that it would not detect the full resolution by default. Just to spread the news on how it works:

1) Fire up the terminal and create a new resolution:

$ cvt 1680 1050 60
-> "1680x1050_60.00"  146.25  1680 1784 1960 2240  1050 1053 1059 1089 -hsync +vsync

2) Copy the result into xrandr --newmode to create it

$ xrandr --newmode "1680x1050_60.00"  146.25  1680 1784 1960 2240  1050 1053  1059 1089 -hsync +vsync

3) Add the resolution so you can select it from the displays GUI

$ xrandr --addmode VBOX0 1680x1050_60.00
Read more (0 comments)

At (Dutch) - my company that schedules emergency duties for dentists - we wanted to get a better overview of how dentists are currently scheduling their evening and weekend duties. We knew that most of our current clients used to schedule these by hand, but were more interested in dentists that were not (yet) amongst our client base.

While we were thinking of ways to connect with possible clients, one thing popped up that I think is worth sharing: online surveys. Not your every-day survey with a loads of questions for thousands of respondents, but a well marked-up survey with at most 10 multiple choice questions, personally sent to a small group of potential clients. (e.g. see the survey we're releasing to our clients)

If you think about it, the survey fulfills much more than just an information gathering role, it also:

  • Creates awareness of our product
  • Makes down-sides of...
Read more (0 comments)

With the release of Ubuntu 12.04 LTS the time has come - albeit late - for an updated guide on rolling your own Rails production server with a long term supported Ubuntu. This is an updated guide based on an earlier version for Ubuntu 11.10. Most steps are the same, but I've gone through the guide in a fresh virtual machine to make sure everything still works as expected.

The setup

I'm assuming that you already have installed Ubuntu Server with a non-root user (with sudo rights) and that SSH is setup (e.g. [like this][6].) Use sudo, do not use root, because this is a requirement for rvm. You should setup your hosts file for your...

Read more (6 comments)


Dennis | almost 3 years ago | Heroku

I moved this weblog to Heroku yesterday and it's been a great experience so far. In this post I'd like to describe how I moved the information in the mysql database from my VPS to the postgresql database at Heroku using taps.

After moving your application to heroku the usual way, all that is left is to move the database. Since the old database was mysql and heroku uses postgresql, data could not be imported directly. One way to do this is using taps, a gem that uses sinatra to make your database available for importing over the web. There are some caveats though, because the heroku implementation (server-side) uses ruby 1.9.2 and trying to send you database with 1.9.3 will not work.

On my VPS I checked out a fresh copy of my app and coupled the account to the right heroku app.

rvm use 1.9.2@temp --create
Read more (0 comments)

Faster tests with BCrypt

Dennis | almost 3 years ago | Bcrypt Rails Testing

BCrypt is a way to hash passwords with a given work-factor. I'm not going into the details here, but it comes down to 2 main properties

  1. BCrypt is difficult to implement on GPU's, which limits the speed in which a dedicated attacker can create hashes. (Unlike SHA or MD5 hashes, which were optimized for speed)
  2. BCrypt allows you to specify a work factor so that your hashing difficulty can grow with time.

One problem I found when running my tests in RSpec is that BCrypt is so good at its job that it has quite some impact on my tests. Every user that gets created takes out some time to generate a bcrypt hash and in the end this slows down each test by a few 100ms.

The solution is to reduce the work-factor, of course. However, implementing this in my user-model doesn't seem right, why would I adapt my code for tests? It only creates another entry for bugs or security...

Read more (0 comments)