neverpanic.de

Downloading Google Web Fonts for Local Hosting

| Comments

I am trying to make this blog completely tracker-free. To achieve that, I need to avoid fetching resources from any third-party servers, such as Google Web Fonts. There are some articles discussing how to download the different formats required for cross-browser compatibility, but manually downloading a series of files using different browsers isn’t what I had in mind – I’m a computer science student after all. So I toolchained it. Meet the Google Web Font download script (requires Bash 4.x), available from its new home on GitHub.

The script provides a command line interface to specify the fonts to be downloaded as given in the ?family= parameter of the URL generated by Google’s Web Font service. It uses curl to emulate different user agents (since the CSS file returned by Google’s setup depends on it), downloads the font files into the current directory and generates a CSS file that provides the font definition using Fontspring’s Bulletproof @Font-face Syntax. The generated file is a drop-in replacement for the file previously fetched from Google’s servers. Since it includes all font files and doesn’t depend on the user agent it might not be as efficient as the original, though (I have not actually verified this). If efficiency is key for you, you may want to limit the number of formats you provide, because WOFF support is pretty widespread in modern browsers.

Don’t forget to configure the MIME types for the font files on your web server.

Changelog

  • Version 1.2, 2015-06-13
  • Version 1.1.1, 2015-04-09
    • Switch user agent to IE 8 for WOFF to fix problems
  • Version 1.1, 2014-06-21
    • Remove colons and spaces from file names for Windows compatibility, patch from campino2k
    • Add check for Bash version, 4.x is required
    • Correctly handle fonts without a local PostScript name
    • Change format('ttf') to format('truetype') in CSS output
    • Add license header and comments
    • Added sed extended regex flag detection
  • Version 1.0, 2014-03-19

Shiny New Blog

| Comments

This blog has been overhauled completely. My old website had not been updated in three years and was beginning to fall apart in some places. Note that I have not completely moved all content from the old site, which made this move easier and quicker.

First things first: If you were subscribed to the old blog’s RSS feed, please check and update, if necessary, your feed URL from http://www.neverpanic.de/blog/atom/ or http://www.neverpanic.de/blog/rss2/ to https://neverpanic.de/atom.xml. The old URLs now are permanent redirects to the correct new URL, so if you see this post in your feed reader you’re probably fine and don’t have to touch anything.

This blog was previously using the free 1.9.x version of ExpressionEngine from EllisLabs called ExpressionEngine Core. The software had been giving me update notices for quite a while, but when I wanted to update it to the latest version I noticed the free version had been pulled from the downloads page. It’s back in version 2.x now, but I’m not going to make the same mistake of relying on closed source software again. I switched to Octopress, a static site generator based on Jekyll. I don’t particularly like software written in Ruby because most Ruby projects aren’t even trying to get into the standard Linux/BSD/OS X package managers, and this one is no exception, but it works reasonably well for me. I didn’t follow the installation instructions where it says to use rbenv or RVM but just installed ruby 1.9 and bundler from MacPorts and ran

bundle install --binstubs --path=vendor/bundle

That puts all the dependencies self-contained into vendor/bundle (no, I don’t want to install gems as root into system locations or install yet another package manager) and creates a series of wrapper scripts for binaries in ./bin. Now I just have to remember to use bin/rake $command instead of rake $command to work with Octopress.

I chose to selectively pick the posts I moved from the previous blog software and completely removed the separate “About me” and “Portfolio” sections. I felt most of the stuff I removed didn’t represent very well what I’m currently doing, since I’m not really into websites anymore. I made sure all old URLs either redirect to the new versions or return a proper HTTP 410 Gone page.

Chaos Communication Camp Badges

| Comments

I’m currently attending Chaos Communication Camp 2011 in Finowfurt near Berlin.

Apart from the cool location within an used-to-be military airport open-air aviation museum, the coolest thing so far definitely is the electronic badge handed out at the entrance: The r0ket, an ARMv7 micro controller with back-lit LED-display, several LEDs (of which one is also used as a light sensor to determine whether it’s night and the badge display needs back light), a multi-way jog, a rechargeable battery and some extension-connectors.

The badge also features mesh-networking capabilities, although the firmware for that does not seem very stable or reliably usable at the moment. I will definitely be keeping this tool toy – there’s no better name-tag than this, I guess.

A rocket-shaped PCB with a display

GSoC Welcome Package

| Comments

I have been accepted into Google’s Summer of Code program this year to work for the MacPorts project. In a nutshell, I will be writing an equivalent to Gentoo’s revdep-rebuild – if you’re interested in the details, check out my proposal.

At the beginning of GSoC, every student receives a welcome package from Google, with a few goodies and a prepaid Visa card through which they will be paid. I have received this package yesterday and want to share my unboxing experience ;)