Welcome to the wonderful world of Andrei!

Cheap Wireless Carrier in England

May 25

As soon as I landed in London, I quickly looked for a wireless carrier. Luckily, when I picked up my luggage, there was a vending machine selling SIM cards. I looked for one that had a lot of data — I wasn’t interested in calling or texting anyone, but I definitely needed to use Google Maps all the time. Out of all the SIM cards there, one stood out: Three’s All-In-One 15 plan with unlimited data. “Unlimited” was the key word I was looking for.

I paid £20 for it, put it in my phone, and within seconds I ...

- read more -

A minimal Pomodoro-style timer

Apr 27

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 -

NGINX Reverse Proxy for ZNC

Apr 11

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 -

Mirroring a Git Repository

Mar 25

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 -

How Pocket Parses Titles

Mar 22

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 -

Upgrade Gnome Terminal on Ubuntu 14.04

Mar 11

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 -

Endless Reboot with Cron

Mar 06

Sometimes I come up with bad ideas. This is one of them.

* * * * * root /sbin/shutdown -r now

And yes, it does work perfectly. Needless to say, you shouldn’t do this. You might be able to make it worse by using @reboot, but I’m not sure which version will end up executing earlier. To be safe, use both!

- read more -

TOTP and HOTP in Rust

Mar 02

Lately I’ve started writing libraries which implement missing functionality in Rust. This is my second library and it implements OATH protocols in Rust according to the relevant RFCs. So far it supports HOTP and TOTP.

This blog post is intended to show some simple usage for version 0.1.1 of the library; if I change the API, I’ll put a link here to an updated blog post.

If you’re interested, the code for this library is on GitHub.

Using rust-oath

First, you need to add the dependency to your Cargo.toml:

[dependencies]
oath = "0.1.1 ...
- read more -

My First Rust Crate

Feb 27

Today I created my first Rust Crate and published it on Crates.io! Check it out: https://crates.io/crates/changecase

I’m used to being able to change the case of strings in Python, but unfortunately Rust doesn’t provide an equivalent; you can only change case of individual characters. Clearly, the solution is to write a library for it.

Currently the library supports uppercase, lowercase, AlTeRnAtInG cAsE, inverting case, and capitalizing. Future work is to implement title case. I’ve already started to work on it by porting titlecase.py. The regex syntax is identical as far as ...

- read more -

My Attempt at Inbox Zero

Feb 21

I’ve taken a few steps today in an attempt at Inbox Zero. I tend to leave mail in my inbox to deal with it later, but it’s been bugging me lately and so I decided to do something about it.

Inbox Zero is an approach by Merlin Mann to maintain an empty (or almost empty) inbox. The benefit is that you get through your email more efficiently and spend less time thinking about it.

I’ve decided to go a bit further than only maintaining an empty inbox; I now aim to keep my entire mail account clean ...

- read more -
Page 1 of 5   older »