How to Connect to Freenode IRC via SSL

|

It took me a while to figure out how connect to freenode’s IRC servers via SSL today. Here’s a reference for my future self and anyone else who might find this helpful.

N.B. I use weechat as my IRC client.

  1. Pick a nick that’s not already taken. Weechat kept retrying unsuccessfully when I used one that was already taken.
  2. freenode has instructions here on how to connect via SSL
  3. I run weechat on Ubuntu 12.04 and had to install the intermediate and root certificates mentioned in the link above. Otherwise, weechat complains that it doesn’t recognize the certificate.
  4. sudo mkdir /usr/share/ca-certificates/extra
  5. Copy the Gandi and InstantSSL certificates to that directory.
  6. Let Ubuntu add the new certificates’ path relative to /usr/share/ca-certificates to /etc/ca-certificates.conf by running sudo dpkg-reconfigure ca-certificates.

This should be all. Here’s the weechat IRC configuration for freenode which should be written to ~/.weechat/irc.conf.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
freenode.addresses = "dickson.freenode.net/7000"
freenode.proxy
freenode.ipv6
freenode.ssl = on
freenode.ssl_cert
freenode.ssl_priorities
freenode.ssl_dhkey_size = 1024
freenode.ssl_verify
freenode.password
freenode.capabilities
freenode.sasl_mechanism
freenode.sasl_username
freenode.sasl_password
freenode.sasl_timeout
freenode.autoconnect = on
freenode.autoreconnect
freenode.autoreconnect_delay
freenode.nicks = "davidxia"
freenode.username
freenode.realname = "David Xia"
freenode.local_hostname
freenode.command
freenode.command_delay
freenode.autojoin
freenode.autorejoin
freenode.autorejoin_delay
freenode.connection_timeout
freenode.anti_flood_prio_high
freenode.anti_flood_prio_low
freenode.away_check
freenode.away_check_max_nicks
freenode.default_msg_part
freenode.default_msg_quit
freenode.notify

New Yorker Redesign

|

The New Yorker recently redesigned their web site and made all articles free for a limited time. Everything looks great except for that giant sticky header that takes up at least an inch of your screen. I hope they get rid of it.

Amsterdam 2014

|

I visited Amsterdam after coming going to Stockholm for work recently. It was my first time there. Amsterdam’s canal, bike paths, and green spaces are beautiful.

Indonesia 2014

|

Nanette and I traveled to Indonesia and visited Borobudur, the site of the world’s largest buddhist temple, and hiked Mount Rinjani, an active volcano.

How to Read the Wall Street Journal Online for Free

|

Tired of not being able to read WSJ articles online without a subscription?

You’ll need a Chrome browser.

  1. Download the ModHeader Chrome plugin
  2. Click on the ModHeaders icon and add a ‘Referer’ header with value ‘https://www.google.com’ and make sure it’s checked.

Click on the WSJ article again. Voila!

If this stops working, try clearing your cookies. I recommend the Edit This Cookie plugin

How to Backup and Restore Your Hard Disk by Creating a Disk Image

|

It’s been almost a year since I setup my personal server which I named Jarvis. I haven’t backed-up Jarvis at all and recently grew paranoid that something might happen to him. Jarvis represents hundreds of hours of work, and there are documents and code that are stored only in him.

I spent some time figuring out how to backup everything. The easiest solution is to initialize Git repositories for all my projects and then create bare Git repos for all of them. Then I simply tarballed them up and stored copies of them elsewhere.

But I wanted to also preserve all my server configurations and packages. I wanted a hard drive that if Jarvis’ hard disk suffered some catastrophic failure like fire, I could simply plug into another computer and have a perfect clone up and running in no time. Spending hours installing packages isn’t fun. What I needed was to take a snapshot of the disk and create a disk image. It turns out dd is the command for the job.

How to Setup Your First Scala Project in IntelliJ

|

I stumbled around for quite a while trying to create a basic Scala project in IntelliJ. Here are the steps so you don’t have to waste nearly as much time as I did. I’m also documenting this because I know I’m going to forget it myself.

My environment:

  • Mac OS X Mavericks 10.9
  • IntelliJ IDEA 13.0

My steps:

  • install Scala with homebrew brew install scala --with-docs
    • this installed Scala version 2.10.3 for me
  • brew install sbt (I’m using 0.13.0)
  • mkdir ~/.sbt/0.13/plugins
  • echo 'addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.5.2")' > ~/.sbt/0.13/plugins/build.sbt
  • install the scala plugin for IntelliJ
  • git clone https://github.com/davidxia/hidemyass_api.git
  • import project; choose “import project from external model” and select “Use auto-import”
  • make sure it compiles and runs

Introduction to Public-key Cryptography and GPG

|

Public-key cryptography is an encryption method that uses two keys, one public and one private, to securely communicate with others. Messages are encrypted using the recipient’s public key, but the message can only be decrypted using the corresponding private key. Think of the public key as secure mailbox with a small slit into which anyone can put letters. But only the owner of the mailbox can retrieve letters by opening it with her private key. The security of the encryption scheme is based on the fact that it’s computationally infeasible to calculate private from public keys.

Longer key lengths are better, but only up to a point. AES will have 128-bit, 192-bit, and 256-bit key lengths. This is far longer than needed for the foreseeable future. In fact, we cannot even imagine a world where 256-bit brute force searches are possible. It requires some fundamental breakthroughs in physics and our understanding of the universe…brute-force attacks against 256-bit keys will be infeasible until computers are built from something other than matter and occupy something other than space.

Learning to Skateboard and Ghetto-Couchsurf

|

I bought my first skateboard on a Saturday afternoon at an East Village skate shop. I’d never skateboarded before, but I suddenly wanted to be like those devil-may-care skaters landing varials while weaving in and out of midday Manhattan traffic. I figured it wasn’t too late to start. I had no idea what components to pick, so I just went with the recommendations of the guys at Reciprocal Skateboards: 8.25-inch wide deck, Independent trucks, and Bones Reds bearings.