Apr 27, 2015

A minimal Pomodoro-style timer

Yesterday I decided to make a very minimal Pomodoro-style timer to keep me on track. It doesn’t offer too many features; it just gives you options for the lengths of time, and 3 buttons to control the timer. If you want to reset the timer, just refresh the page.

It’s available here: https://timer.80x24.ca

schematic

When I said this was very minimal, I didn’t mean just the interface; the code is very minimal too. There are no dependencies; all necessary code is within the one timer.html file. Just put it on a flash drive and ...

- read more -
Apr 11, 2015

NGINX Reverse Proxy for ZNC

If you want to have the ZNC web interface behind NGINX (maybe you want to specify a different server name), this is how to do it.

Firstly, you want to create a NGINX config file. I’ve got ZNC running on the same server, so I use the following config file:

server {
    listen 443;
    server_name irc.example.com;

    location / {
        proxy_pass          https://127.0.0.1:6667;
        proxy_set_header    Host              $host;
        proxy_set_header    X-Real-IP         $remote_addr;
        proxy_set_header    X-Forwarded-For   $proxy_add_x_forwarded_for;
    }
}

If you only do this, however, ZNC will complain about the X-* headers. You can remove those headers, but then it’ll think you’re ...

- read more -
Mar 25, 2015

Mirroring a Git Repository

For the past couple of years, I’ve been mirroring repositories locally so that I always have the code accessible even without Internet access. When I saw that FoundationDB’s GitHub account was wiped when Apple bought them, I figured other people might be interested in mirroring repositories, too.

I currently mirror Git, Mercurial and Subversion repositories, but here I’ll just focus on how to mirror Git. The other two will be separate articles.

How to do it

First, you want to do the initial clone. This is slightly different than a regular clone because you want to get ...

- read more -
Mar 22, 2015

How Pocket Parses Titles

Based on a few trials, and looking at many other people’s sites, I think I figured out how to get Pocket to show the correct title when people add your article to the app.

It figures out where the article is (I use <article>), but initially it didn’t realize that the <h1> within the article <header> was the title of the article. This seemed to be because the nav bar also had an <h1> (because I copied a Foundation example), as did the banner at the top of the page. These extra top level headers confused Pockets, so ...

- read more -
Mar 11, 2015

Upgrade Gnome Terminal on Ubuntu 14.04

In Ubuntu 14.10, Gnome Terminal can rewrap long lines when you resize the window. Unfortunately this feature wasn’t ready for 14.04, so we’ll have to upgrade gnome-terminal and libvte-2.90 to the latest versions ourselves.

The easiest way to grab the new versions is to get them from the Gnome3 Staging PPA. We don’t want all the packages from that PPA, though, so we’ll use apt pinning to specify which packages we want to upgrade.

First, add the PPA:

$ sudo add-apt-repository ppa:gnome3-team/gnome3-staging
$ sudo apt-get update

Next, we’ll create our apt pins ...

- read more -
Page 1 of 9   older »