Category Archives: Uncategorized

How to install the ruby gem rmagick on Debian 8.2

If you get errors when you run

gem install rmagick -v '2.15.4'

Then you need to install the following packages:

sudo apt-get install libmagick-dev imagemagick pkg-config libmagickwand-dev

Muted audio on Debian 8.2 on Dell Precision M3800 laptop

When you install Debian 8.2 on the Dell Precision M3800 laptop, audio is muted by default. To unmute it, install the pavucontrol apt package. This will allow you to edit pulseaudio settings directly.

sudo apt-get install pavucontrol

Then run the pavucontrol command


Click the tab “Output Devices”, and use the tiny, hard-to-see scrollbar on the right side of the window to scroll down to “Built in Audio Analog Stereo.” In the upper right corner there is a mute button. Click it to unmute, and audio should play.

Connect to U of Chicago wifi using Debian, LXDE and Wicd Network Manager

As a University of Chicago alum, I’m allowed to work out of Regenstein Library on campus and use the wifi. Connecting to it works automatically on mainstream operating systems like OS X and Ubuntu, but I recently installed Debian with the LXDE desktop environment, which uses a program called Wicd Network manager to manage wifi.

When the system work properly, you connect to the wifi network, and the next time you visit a website in your browser, you’re redirected to a login page where you enter your credentials and are allowed in. But when I connected to the wifi network, there was an issue with the wifi network connecting, and disconnecting after a few seconds.My theory is that Wicd Network Manager didn’t want to let the wifi network manage DNS settings to temporarily redirect all web requests to the login page.

The solution was to connect to the wifi network, and quickly note the IP address assigned to my computer by DHCP. Then, take the first two bytes of the IP address (e.g. if the IP address is, take the frist two bytes, “10.152.”) and add “0.1” to make the made-up address “”. Right after you connect to the wifi, before you get dropped, try to connect to this address. You will be redirected to the login page so you can log in and everything is fine.

How to set up selenium grid to test Internet Explorer from a Mac or Linux computer

This blog post explains how to set up Selenium Grid to run your selenium-powered tests on another computer or virtual machine. In this example, you currently run an rspec test suite on a Mac using the selenium-webdriver gem, but you’d like your application to work in Internet Explorer. The example application can be found here. I made it for this blog post, and styled the code to be as simple as possible for learning purposes.

Since Internet Explorer doesn’t run on Macs you could install a VM with Windows on it, and test out the site by hand. But by using the instructions in this blog post, you can simply run your existing test suite directly on IE. The instructions can easily be adapted to other operating systems and web browsers.

First, install VirtualBox on your Mac. VirtualBox is free and open source software that runs on Windows, Linux, Mac and other host systems. Go here to download VirtualBox.

Either install a legitimate copy of Windows in a VirtualBox VM, or download one from I don’t recommend pirating Windows, not least because most pirated copies online are full of exploits and viruses and such things. Go here to download a free, legitimate Windows VirtualBox image from Microsoft. If you already have Windows installed using other VM software, that will work fine too. In fact, these instructions will work even if Windows is on a different computer, e.g. if you have a Windows laptop laying around you can use for this.

Launch your Windows VM. Make sure the Windows VM and your Mac can ping each other over the network. If you have trouble with this when using VirtualBox, shut down your Windows VM, then go into the settings for your Windows VM. Choose Network, and for Adapter 1 “Attached to” choose Bridged Adapter. This will place the VM on the same network subnet as your main computer. When you start the Windows VM back up, launch a command prompt by clicking the Start menu and running “cmd”. Then run “ipconfig” to find your IP address. Once your Windows VM and Mac can ping each other, move on to the next step.

Install Java on both your host computer and the Windows VM. Go here to download Java.

Download the Selenium Grid binary jar file to both your Mac and your Windows VM. Go to the following link and click the folder with the highest version number. In that folder, download the file named selenium-server-standalone-????.jar with the ???? replaced by the version number. Go here to download Selenium Grid.

Download the Internet Explorer Driver to your Windows VM only. It is in the same folder as the Selenium Grid binary. The filename for the 32-bit version is IEDriverServer_Win32_????.zip, again with ???? replaced with the latest version number.

On the Windows VM, unzip the IEDriverServer file you downloaded. Then place the .exe file that comes out in a directory in the Windows PATH. One such directory is C:\Windows\.

Now we need one selenium grid hub, and one node. The Mac will be the hub, and Windows will be the node. On the Mac go to the directory with the selenium-server-standalone file you downloaded earlier. Then run (replacing the selenium-server stuff with the actual filename):

java -jar selenium-server-standalone-????.jar -role hub

You will see some console output about “Launching a selenium grid server”. Now go to the url http://localhost:4444/grid/console. You should see that your hub is up and running, but not offering any browsers yet.

Before you begin this step, make a note of your Mac’s IP address. Let’s say it is Now go to your Windows VM and open a command prompt. Navigate to the selenium-server-standalone-????.jar file directory, and execute the following command, replacing the ???? with the proper filename, and with your actual Mac’s IP address:

java -jar selenium-server-standalone-????.jar -role node -hub

You should see some terminal output about “Launching a selenium grid node”. Now go back to your grid console webpage and refresh it. The one at http://localhost:4444/grid/console. You should see some web browsers on offer! You now have a selenium grid running.

Now it is time to run a test over the grid. Go to my sample project on github here.

Follow the sample project’s instructions and get the server and tests running locally. Once you have done that, use git to checkout the selenium_grid branch. Then open the spec/index_page_spec.rb file in a text editor. You will see the following code in a before block

@firefox = Selenium::WebDriver.for(:remote, desired_capabilities: :internet_explorer)““)

Edit the IP address on the argument to be your Mac’s IP address. Then in the project’s root directory run bundle exec rspec. In your Windows VM you should see Internet Explorer launch, visit the webpage, and close, followed by rspec reporting that the test passed.

Congratulations! You have set up a minimal selenium grid and run a test using rspec against a local web application. I hope this guide was useful for you, please leave any questions in the comments!


The Selenium Grid wiki

Hacker News discussion of this post

Using Selenium and Rspec to test any web application

Recently I set up selenium and rspec to test a single-page javascript application. While building that test suite and teaching the other developers on my team how to use it, I grew frustrated with the minimal documentation for selenium. So today I put together a simple web application and test suite you can use to learn how selenium works. It is fully functional and should allow you to quickly get up to speed.

I kept the web app and the test suite separate to show that one can use rspec and selenium-webdriver to test any kind of web app. Simply start the web app in one terminal and go run the test suite in another terminal. You can even run the test suite against your production system to make sure there were no problems with your last deploy.

Later I will write up how to use Selenium Grid combined with a VirtualBox VM to run your tests against a browser in a different operating system. [Edit: I have now written the post, here it is.] Let me know what you find confusing about selenium and maybe I’ll blog about the answer! Check out the sample app here.

How I used bitcoin to replace wire transfers and save money

I live in Berlin, and I need to send money to the US every month to make student loan payments. I am paid in euros, and my student loans must be paid in US dollars. Because of this I need some way to convert currencies and send money from Europe to the US.

The traditional way to do this is a wire transfer. That is very costly. My US bank, Chase, charges me $15 to receive a wire transfer. My bank in Berlin, Deutsche Bank, charges me 39€ ($48) to send one. Together that is $63 in fees.

Instead of wire transfers, I use bitcoin to send money. First, I use SEPA (the free system Europeans use to send each other money) to send euros to my account. Once they arrive, I use all the money I sent to buy bitcoin. I then send the bitcoin to my Coinbase account. Once the bitcoin arrives, (which only takes a few minutes) I immediately sell the bitcoin and end up with US dollars in my Chase account.

Bitstamp charges a transaction fee of 0.5% to buy bitcoin. Coinbase charges 1% to sell. Together, that is 1.5% of the amount of money I’m sending. In my case, that is much less than the $63 it cost to send a wire transfer, and this method is saving me over $40 each month with no downsides.

If you were to send more than $4222, then paying $63 would be less than paying 1.5%. If you’re making regular wire transfers I strongly encourage you to use this method and save money.

Economics Study Idea

Open source software projects assume that “many eyes makes all bugs shallow.” However, the recent heartbleed vulnerability in OpenSSL revealed that showstopper bugs can exists for years.

Your paper would look at the biggest, most used open source software projects (like OpenSSL), and examine their development practices. For example, in OpenSSL, there is no proper intermediate code review step in between “random coder commits code” and “code goes out to the world.” In contrast, Chromium has a review step that the original author is completely excluded from, where multiple people read the code.

Once you have categorized review practices, you will examine the number of severe vulnerabilities that have made it past the review and been deployed to the world.

Sadly I can’t see a way to do randomized trials of software development. Coders are expensive and there are only a few projects that are as important and high-stakes as OpenSSL.