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 | 31 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

Building a powerful, cheap and silent Linux NAS and HTPC server

Introduction

I am currently using an old IBM Thinkpad T42 as a server and NAS for my desktop and laptop, sharing files through CIFS/SAMBA and NFS. I was running out of storage space on the server, which only had a single 250GB 2.5” disk and I considered either to buy a cheap NAS box as the ReadyNAS Duo and have two disks in raid 1 (mirroring) or build a new server from scratch with room for several disks in raid 5.

Updates to the article

I have updated this post several times since I posted it and it now contains the following new sections:

  1. Data scrubing
  2. Monitoring the server through munin
  3. A HTPC media server
  4. The server was killed by thunder and has now been rebuild and upgraded, see:
    Rebuilding and updating my Linux NAS and HTPC server

Underpowered off-the-shelf NAS boxes

When I researched the ReadyNAS duo (1000DKK = 175USD) I found the performance to be less than what I wanted:

  • trustedreviews.comaverage read and write speeds of 24.6MB/sec and 17.3MB/sec.
  • smallnetbuilder.com — write speed: around 15mb/s, read speed: 35MB/sec for files up to 128MB and less than 10MB/sec for larger files!.

Since I do image and video processing on large images on my desktop over NFS I need the speed to be better than this. So I started to look into more expensive NAS enclosures, but even though I think I would have been perfectly happy with a QNAP TS-459 Pro+ Turbo NAS enclosure performance wise, it is silly expensive (6000DKK = 1050 USD) without disks. After all this box is nothing but underpowered, single-purposed Linux servers with a webgui, surely I can do this better my self. Building my own server would also give me the power to run a HLDS server, saturate my gigabit network, running the LAMP stack, a squeezebox service and such.
Continue reading

Share
Posted in Articles, Computer | 27 Comments

LaTeX fonts: 73 PDF and JPG samples

Introduction
I had a friend ask me to find an alternative font for him to use in LaTeX. I first tried to trawl Google, but only found dated and incomplete pages, so I decided to sample a ton of fonts so he could choose for himself. My friend was running Ubuntu Linux which uses TeX Live and Ubuntu comes with two texlive-fonts packages in the repositories: texlive-fonts-extra and texlive-fonts-recommended. So the first thing I did was to create lists of the fonts in these packages:

aptitude show texlive-fonts-extra | grep " -- " | awk '{print $1}' > texlive-fonts-extra
aptitude show texlive-fonts-recommended | grep " -- " | awk '{print $1}' > texlive-fonts-recommended.txt

This provided 121 fonts for texlive-fonts-extra and 24 for texlive-fonts-recommended.

Automating the font sampling
To automate the font sampling I made a template LaTeX document, where I used the standard dummy text of typesetting: Lorem Ipsum and small equation to see math font in use. The LaTeX template is slightly shortened compared to the version in the downloads.

\documentclass[11pt]{article}
%placeholder
\begin{document}
 
\section*{Lorem ipsum dolor sit amet}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus magna orci,
commodo eget sollicitudin id, commodo vitae erat. Pellentesque eu dapibus arcu.
Cras tristique, lectus at porta porttitor, enim tellus pulvinar turpis,
pulvinar fringilla elit erat sed sem. Suspendisse elit velit, iaculis id
adipiscing in, convallis et lectus. 
 
\begin{displaymath}
{\left( \frac{\partial}{\partial x}{\left(\frac{\partial g\left(x,y\right)}{\partial y}\right)}_x \right)}_y = 
{\left(\frac{\partial}{\partial y}{\left(\frac{\partial g\left(x,y\right)}{\partial x}\right)}_y \right)}_x
\end{displaymath}
 
\section*{Nullam ac gravida ante}
Nullam ac gravida ante. Ut consequat, arcu vel sodales pharetra, ante nibh
rhoncus justo, pulvinar gravida lorem nunc ut augue. Nullam nec diam libero,
eget aliquam augue. 
\end{document}

Now to the script to automate it all. First the script replaces %placeholder with \usepackage{fontname}, then document is compiled using pdflatex, the pdf is convert to a image using ImageMagick and finally a bit of cleaning. The script reads the list of fonts to use from the file texlive-working-fonts.txt which contains the 73 fonts compiled flawlessly in the two lists compiled earlier. texlive-working-fonts.txt is included in the downloads below.

#!/bin/bash
 
# Times like fonts 
#fonts="times mathptmx pslatex newcent palatino lmodern"
 
if [ ! -d PDFS ]; then
    mkdir PDFS
fi
if [ ! -d JPGS ]; then
    mkdir JPGS
fi
 
for font in $(cat texlive-working-fonts.txt); do
    if [ ! -e PDFS/font-$font.pdf ]; then
        echo "### Creating $font"
        if [ $font = "standardlatex" ]; then
            sed "s/%placeholder//g" document.tex > font-$font.tex
        else
            sed "s/%placeholder/\\\usepackage\{$font\}/g" document.tex > font-$font.tex
        fi
    	pdflatex font-$font.tex
        convert font-$font.pdf font-$font.jpg
        mv font-$font.pdf PDFS/
        mv font-$font.jpg JPGS/
        rm -f font-$font.tex font-$font.log font-$font.aux
    else
        echo "### PDF for font: $font already exist"
    fi
done

Running the script return two folders: a folder containing PDF’s of all the 73 fonts and a folder called JPGS containing all the JPG’s. Below is a sample of 6 of the fonts – the full monty can be found in the downloads.


Download
A minimal download containg only the bash-script, the template LaTex document and the lists of fonts:
latex-font-test.zip (3 kB)
latex-font-test.tar.gz (2.2 kB)

A full download all files along with PDF and JPEG versions of document using 73 different fonts.
latex-font-test-with-pdfs-and-jpgs.zip (8.1 MB)
latex-font-test-with-pdfs-and-jpgs.tar.gz (8.2 MB)

Share
Posted in Articles, Computer | Leave a comment