December 17, 2014

building a currency exchange rates api

While working on umsatz I had to build a tiny currency exchange rates api in go. While the original API works fine, it clocks in at more than 400 lines of code. Let’s write a shorter version! In this post we’ll re-build the api, in three steps: download, parse & cache the EUR exchange rates history xml, provided by the ECB 1 add a tiny HTTP JSON API to request rates periodically update the cache with new data This will leave use with a tiny, HTTP currency exchange rates api. Read more

December 15, 2014

present a project: umsatz

In the last post regarding open source side projects I presented traq, a CLI time tracking application I use for my everyday work. Today I decided to present and walk you through the setup of umsatz, my open source accounting application. But let’s first introduce umsatz: umsatz was written to ensure that my book keeping informations are kept safe - that is only locally accessible, not from the internet. It’s not that my information are particularly sensitive. Read more

August 29, 2014

cleaning multiple databases with DatabaseCleaner

TL;DR; the database cleaner gem can easily be used to clean multiple databases at once. I work and maintain some rails projects which connect to multiple databases, some legacy (read: not managed by ActiveRecord), some not. In order to write proper integration tests you might need to load test data into multiple databases, which in turn leads to the need to have clean databases available for all your test runs. Read more

August 17, 2014

present a project: traq

In the last post regarding open source side projects I presented revisioneer, an API to track application deployments. Today I’ll be showcasing traq, a command line application which tracks your times. I’ve also blogged about it before. The initial proof of concept was entirely written in bash with a focus on simplicity and understandability. This meant that traq uses a simple folder structure and plain text files to store the tracked times. Read more

June 14, 2014

present a project: revisioneer

I’ve am working on multiple projects in my free time and I’d like to take the time to write about them, one by one. The basic idea is to describe the project briefly: what it does, why I started working on it, and what my plans are for the future. Today I’d like to talk about revisioneer Revisioneer is an API which tracks application deployments per server. Every time you deploy your application via ansible or mina you can send the current SHA including the changeset to revisioneer, and later use that information in whatever way you like. Read more

February 5, 2014

writing and testing custom ansible libraries

This post is about testing custom ansible library code. Specifically the tests I wrote while working on ansible-rails, a wrapper utility for bundler and rake useful when deploying rails applications with ansible. Sadly the documentation on how to test custom library code is really thin. Hopefully this will change but for now, here’s how I write and test custom libraries using a very simplistic example. Most ansible libaries will look somewhat like this: Read more

January 12, 2014

scraping nsscreencast

Today I decided to catch up with NSScreencast. NSScreencast has currently over 100 episodes and I stopped somewhere at 40. I like to watch them offline when I have time but downloading the missing ~60+ episodes by hand would take too long. Having recently installed GNU Parallels I decided to give it a spin. My goal was to generate PDFs of all episodes as well as to download the mp4 files of every episode. Read more

December 28, 2013

deploying rails applications with ansible

Fellow web developers might know ansible - a lightweight, extensible solution for automating your application provisioning. Since ansible galaxy opened its doors sharing roles became very easy which is why I started sharing the deployment and rollback roles I’m using for some Ruby on Rails projects I’m working on. First, some thoughts on why I switched deployments from mina to ansible: development of mina stagnated over the past year Mina still lacks some important features like rollbacks, while other features like multi host deployments are only possible through hacks. Read more

November 20, 2013

deploying with mina using gateways

Capistrano allows you to deploy through a gateway server using a :gateway attribute. When migrating from capistrano to mina you might wonder how mina does this. Mina relies on a properly setup ssh config file, in particular the use of ProxyCommand. For example lets assume you want to deploy to intranet.example.com using a gateway at gateway.example.com. Your mina config will look something like this: require 'mina/bundler' require 'mina/git' set :domain, 'intranet. Read more

August 4, 2013

let SQL do the work

Today I want to share an example of a simple optimization I’ve recently made for multiple reports I’ve had to generate. It basically boils down to moving work to your SQL server (your SQL server is awesome at crunching huge amounts of data). Here’s the full story: For four years now I’ve been developing the Festivalmanager - a web based management software used for internal attendances at the Wacken Open Air Festival. Read more

© Raphael Randschau 2010 - 2022 | Impressum