Munin plugin: Copenhagen gasoline prices

Introduction

It is no secret that I am very fond of Munin and since I recently bought a car I wanted to know cheapest gasoline price. I chose to write a munin-plugin to find the optimal time on the day to buy gasoline. Luckily the Danish organization called FDM (United Danish Automobile owners) maintain a user/operator updated list of gasoline prices from all the gas stations in Copenhagen (or any other area of Denmark). These prices are the actual prices at the gas stations and are thus more accurate than the list-prices maintained by the operators themselves. The list can be seen here:
http://www.fdmbenzinpriser.dk/searchprices/2/K%C3%B8benhavn

Update
I have updated the article with a plot of the mean prices per vendor to see if there were some vendors that would be consistently more or less expensive.

Munin plugin

Munin is the perfect platform to sample these prices and show the time trends, so I wrote a simple python based plugin that scrapes the page for prices and calculates the min, max and mean prices.


Continue reading

Share
Posted in Articles, Computer | 4 Comments

Compressing PDFs using Ghostscript under Linux

Introduction
I had to email a PDF with several high-resolution images embedded. The original file size was 7.31 MB and this was unnecessary large for a single page PDF. I did not need the very high-resolution of the pictures, but only that the PDF would look good on-screen and in print on a normal inkjet printer.

The magic of Ghostscript
Googling the terms “compressing pdf” revealed several online options for uploading and compressing PDFs, but since I was sitting in front of a Linux computer and didn’t really trust any of these unknown providers I ended up using Ghostscript instead. The following command compressed my PDF from 7.31MB to 674KB in about a second:

gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf

From the Ghostscript manual it can be seen that there are several qualities to choose from:

  • /screen – selects low-resolution output similar to the Acrobat Distiller “Screen Optimized” setting.
  • /ebook – selects medium-resolution output similar to the Acrobat Distiller “eBook” setting.
  • /printer – selects output similar to the Acrobat Distiller “Print Optimized” setting.
  • /prepress – selects output similar to Acrobat Distiller “Prepress Optimized” setting.
  • /default – selects output intended to be useful across a wide variety of uses, possibly at the expense of a larger output file.

Continue reading

Share
Posted in Articles, Computer | Leave a comment

Rebuilding and updating my Linux NAS and HTPC server

This article is a continuation/update to my article:
Building a powerful, cheap and silent Linux NAS and HTPC server.
UPDATE: Now contains a section on converting from Raid 5 to Raid 6.

Heavy lightning and rain in Copenhagen killed my server

On the 2 of July 2011 Copenhagen had a very heavy storm with 150mm of rain falling in less than three hours and the Danish Meteorological Institute (DMI) recorded 18,602 lightning strikes in the same period, see cphpost.dk [english]. Beside flooding the basement and destroying old papers and notes the lightning also killed of my newly build server and my old DD-WRT modded WRT54GL router. Now a month later I have bought most of the components to rebuild the server and a new Asus RT-N56U gigabit router.

The insurance company investigated the hardware and found it to completely wasted, but I had the option to by back my hard drives, so I could try to recover the data. Luckily my hard drives were all intact and I could rebuild my server with new hardware.

Updated hardware list

The list is still based on the guide Silent Home Server Build Guide [www.silentpcreview.com], but now with an updated motherboard and CPU.

  • Lian Li PC-Q08A (750DKK = 145USD)
    This Mini-itx enclosure has 6 internal 3.5” bays and is rated as very quite in several reviews. I can now add it is only really quite if you under voltage the fans a bit.
  • Continue reading

Share
Posted in Articles, Computer | 36 Comments

OCRopus – open source text recognition

Introduction

My girlfriend Pernille Petersen needed to grab a big chunk of text from from a magazine and asked me help her, so she didn’t need to type it in by hand. I new that I could do this easily with OCR, but hadn’t done so in Linux before.


Continue reading

Share
Posted in Articles, Computer | Leave a comment

Creating a Carbon fiber wallpaper in Gimp

Motivation

I am getting a new payment card with the option of designing the background myself. I thought that a carbon fiber background would be nice, and found wallpaper online to use for the purpose. Unfortunately my bank rejected this as I was not copyright owner of the image. So I figured I had to make one myself, document it and put online. The added benefit from this approach is that the wallpaper I have made is completely free for all to use for all intents and purposes without any attribution and every right to remix, share and redistribute.

Continue reading

Share
Posted in Articles, Computer | Leave a comment