Optimizing scanned documents with ImageMagick

I am in the process of scanning in all my paper receipts and correspondence. I use a small standalone document scanner that creates jpg images on an SD card. These documents are then converted into searchable PDF files.

The problem is that the images have not enough contrast to be easily readable on screen. Text is usually grey instead of black and you always see a grayish paper background.

Here comes ImageMagick to the rescue. You can easily stretch the color distribution so that light gray becomes white and dark gray becomes black. I use the following command line to modify all images in a folder before converting them to the PDF format:

for img in *.jpg; do mogrify -normalize -level 10%,90% -sharpen 0x1 $img; done

The level values fit my requirements. You should try different values if you don’t like the result.

Please note that pictures will look worse after the above step. Text documents will improve but the colors might change a bit.

Running OLA without network

Recently I bought a Raspberry Pi. My plan was to use this tiny computer as a lighting controller for my band on stage. I have installed the Open Lighting Architecture (OLA) daemon to talk to a cheap FT232 based DMX interface I bought from ebay and developed a simple lighting controller software in python which uses the OLA ClientWrapper API to talk to the DMX interface.

Continue reading

Standalone nginx & PHP Guide for Ubuntu 10.04

The last 1 or 2 years I have been running nginx as reverse proxy in front of Apache2. Now with the release of nginx version 1.2.0 I decided to revamp my installation and use nginx as a standalone server again. This guide explains my installation which uses nginx, PHP via FastCGI connector and SSL running on Ubuntu 10.04.

I want to use the current version of nginx, so I use the PPA repository where current nginx builds can be found:

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:nginx/stable
sudo apt-get update
sudo apt-get install nginx

Continue reading

Quickie: Change Time Machine interval

Here is a quick shell snippet to change the time machine backup interval on OSX. The time interval is specified in seconds. If you want to change it to 4 hours open terminal and enter:

sudo defaults write /System/Library/LaunchDaemons/com.apple.backupd-auto.plist StartInterval -int 14400

You can restore the default interval with:

sudo defaults write /System/Library/LaunchDaemons/com.apple.backupd-auto.plist StartInterval -int 3600

Configuring a PPTP-VPN on iOS and Android

About a year ago, I wrote a blog posting about how to setup a PPTP VPN service on a Amazon EC2 node. This is a follow up to that posting which describes how to setup the VPN on an iOS or Android device.

Please note that some carriers might block PPTP traffic. I experienced problems with using the VPN connection via 3G, while connecting through Wifi works for me. On 3G I can connect to the server, but no data is being transferred. On the server I see a lot of messages of the type “Protocol-Reject”. So if your device seems to be connected to the VPN but you get no traffic, it might be blocked by your carrier. You then need to find a Wifi Hotspot to use the VPN.

Continue reading

Speeding up ProFTPD logins

One year ago I have switched from PureFTPd to ProFTPD because it runs smoother on the virtual server I am running. The server is really easy to setup and maintain, but with the standard configuration it always takes around 5 to 10 seconds to log on to the server. After searching for a solution to these slow logins, it turns out that there is even a point in the FAQ on how to speed up the login process.

Just edit the file /etc/proftpd/proftpd.conf and add these 2 lines:

UseReverseDNS off
IdentLookups off

Lesson learned: I should read manuals more often.

Lion and legacy AFP connections

I have just upgraded to Lion to find out that I could no longer connect to my Qnap NAS via the AFP protocol. Seems like Apple decided to disable an authentication mechanism in Lion which the Qnap device depends on. Whenever I tried to connect with my username, I received an error “There was a problem connecting to the server”.

Qnap is working on an updated firmware but my device will not receive this update, so I need another solution.

Thanks to Alexander Wilde there is a simple solution to reenable the now missing authentication schema.

Continue reading

Recap: 4 months on the iOS App Store

App Store IconIt is now a little over 4 month ago that I have released Gigtool in the iOS app store. I was aware, that most applications in the app store don’t perform well without heavy promotion. I wrote Gigtool with a very small target audience in mind to test whether specialized applications might produce a steady revenue stream even without any promotion. The reasoning behind this is, that Gigtool will be found by its target audience using the search functionality of the app store.

I released Gigtool for a price of $1.99 in the music category of the store. As long as Gigtool was mentioned on the front page of that category under the “New & Noteworthy” section there was a steady stream of around 5 sales per day. This dwindled to next to nothing once Gigtool dropped out of the “New & Noteworthy” section. At that time I had only around 2 sales per week.

Continue reading

Git hosting with gitolite

Git LogoNow that Xcode has native support for Git repositories, I finally decided to migrate my private Mercurial repository to Git. I have always been running my source code repository on my own server and I want to keep this practice with Git. When searching for options on how to setup a private Git repository, Gitolite seemed like a nice option.

In this small howto I will describe how I have setup Gitolite on my Ubuntu 8.04 server. Please note, that Ubuntu has included Gitolite in the 10.10 release, so that the installation is even simpler now. I will describe the manual installation procedure for Ubuntu releases prior to 10.10.
Continue reading