Mat Schaffer's Blog

A paragraph on sexism in computer science

Trevor encouraged me to write a paragraph on sexism in computer science and how we can change it. I encourage you to do the same!

Here’s mine:

Angela Harms had a great quote on her recent appearance on the Ruby Rogues podcast. It’s been ringing in my head all month: Stay present, stay vulnerable.

I think it applies in a lot of situations and sexism in the work place is one of them. The news I’ve seen on the topic lately tends to be a situation that could have been avoided if people weren’t trying to be cool or save face. We already build the most complex things that humans make. No need to act cool or demean your co-workers. We’re all smart here. Stay present, stay vulnerable.

Run CI locally on Jenkins

At Mashion our usual pairing setup means we have one laptop that’s not doing much work. It’s handy to have for email, or breaking off to google something but it’s idle most of the time.

When looking for a CI solution on a recent project, it made sense to me to use that second machine rather than spend money on a VPS. So I set out to make a simple local Jenkins server. Here’s what I came up with.

First install the jenkins.rb gem and start the server:

gem install jenkins jenkins-war
jenkins server --daemon

Once the server is up and running (check localhost:3001) use the Java Jenkins CLI to install the git plugin or whatever plugins you need for your setup.

CLI=$HOME/.jenkins/server/war/WEB-INF/jenkins-cli.jar
java -jar $CLI -s http://localhost:3001 install-plugin git
java -jar $CLI -s http://localhost:3001 safe-restart

Once Jenkins restarts you’ll probably want to set up outbound email. I did this using my gmail account and these instructions on the Jenkins wiki. Do this on the Jenkins config page.

jenkins configure --host localhost --port 3001
jenkins create path/to/project --template none

Here I opted not to use a project template. The ones that come with jenkins.rb don’t poll Git or email on failures. I also prefer keeping the build steps in script/ci in the project’s git repo since it’s easier to update and port across languages and frameworks.

So head to your Jenkins server and configure your job to poll git every 5 minutes with this cron expression:

*/5 * * * *

Replace the echo build step with script/ci. And add an E-mail Notification to yourself or whoever should know about failures (space separated). Then save your job config.

You’re all set. Commit some new code or click the “Build Now” link to run a test build. To stop the Jenkins server run:

jenkins server -k

Hope that helps some, feel free to leave a comment or email me if you have any questions.

Creating a minimal Ubuntu VirtualBox image

In my last post, I showed you how to build a CloudFoundry mini-cloud on an Ubuntu VirtualBox. Building that base image took some work and sorting through old blog posts, so I thought I’d post the instructions I ended up using.

First, download a copy of the latest Ubuntu LTS (Long-Term-Support) image. This tutorial follows the 10.04 installation, later versions may vary.

At the boot screen, press F4 which will let you select the type of installation to perform. Select “Minimal Virtual Machine”, then hit enter to start the Install.

Keyboard selection won’t matter much, so I just chose USA/USA.

For the system clock, I recommend UTC. This models most of the cloud provider images you’re likely to come across.

Have it use the whole disk and auto-partition.

Use ‘ubuntu’ for the username and password for now. Once the system is set up, you can install your ssh keys and remove the password with sudo passwd -d ubuntu.

Disk encryption and HTTP proxies is your choice, but I didn’t need to use either.

When you get to select packages, do manual package selection and it will put you into the aptitude program. This is a little tricky to navigate, but these commands should be plenty to get the job done:

  • use /, enter and n to search similar to less or vi
  • + to install the selected package
  • search and install as needed
  • gg to install packages

You’ll need these packages in order to get the VirtualBox guest tools setup. I recommend installing these since it will enable you to detect the IP of the VM and shut it down without having to SSH into it:

  • build-essential
  • linux-headers-virtual
  • openssh-server

Once it reboots, select “Install Guest Additions” from the Devices menu to mount the VirtuaBox guest additions install image. Then log in and run these commands:

sudo mount /dev/cdrom /mnt
sudo sh /mnt/VBoxLinuxAdditions.run

The last important fix is to remove the MAC address cache that this version of Ubuntu has:

sudo rm /etc/udev/rules.d/70-persistent-net.rules

Note that when you import the image using VBoxManage you should also reset it’s MAC address. You can do this using VBoxManage like this:

VBoxManage modifyvm MyVMName --macaddress1 auto

You may also want to be able to shutdown the machine without logging in, you’ll also need to install ACPI support:

sudo apt-get update
sudo apt-get install acpi-support

This will allow you to use the VBoxManage command to shut down the machine cleanly without using SSH:

VBoxManage controlvm MyVMName acpipowerbutton

If you want passwordless sudo access (also common on cloud images) run:

sudo su -c "echo 'ubuntu ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers"

At this point, disconnect the guest additions and shut down the VM. You should now have a super-minimal Ubuntu image that’s confiured similarly to the Ubuntu images you’ll see on cloud services like EC2.

Running CloudFoundry with VirtualBox on OS X

So you might have seen the “one click” installer for CloudFoundry that my esteemed colleague Trotter Cashion posted yesterday. This is very cool. If you have an Ubuntu server handy you can run that script and you have a cloud. But I like to keep things local so I started working to get it installed on VirtualBox. And here’s the solution, packaged as a script.

To use this script you’ll need:

  • A Mac (Linux or Cygwin would need some tweaks, pull requests welcome!)
  • VirtualBox

Then run this:

curl -O https://github.com/matschaffer/vcap/raw/vbox-install/setup/vbox_install
curl -O https://github.com/matschaffer/vcap/raw/vbox-install/setup/install
sh vbox_install

Accept the host key (should be 5f:f4:1f:14:4c:b8:5c:ad:11:b1:85:f3:f1:0d:a5:2c) and enter the password “ubuntu” once.

That’s it! This script will import a minimal Ubuntu VM from our S3 bucket, set up bridged networking to your default interface, install your SSH key and kick off Trotter’s install script.

It’ll take an hour or so depending on your internet connection. When it’s done, you’ll get some instructions on updating your hosts file, registering with your new cloud and accessing the VirtualBox image. Follow those and enjoy your new personal cloud!

How to hire a Rails developer

As the co-founder of Mashion and organizer of Philly.rb I get a lot of emails from people looking for Rails developers. To help spread the word and maybe do a little less typing, I decided it was time for a blog post.

Before we get into it you should know that finding a good developer in any technology is difficult. Even in larger developer pools like Java or .Net, isolating the top talent is difficult. The pool of Rails developers is of course smaller, but also contains some extremely high quality developers. Here are some of the key points I’ve settled on when helping people find the right developers for their company.

1. Get involved

There are probably some user groups near your area. Maybe even a Ruby user group. Google them, go to a meeting. This is easier when you know a little programming, since the conversation will be mostly technical. If you have even one developer now, send them. If you’re the only person in your company, just show up anyway. Establishing a presence in the community goes a long way. The more often people see you, the more likely your company will come to mind when people think about changing jobs.

2. Be a Presenter or a Sponsor

This is a continuation of the first point. Being at the meeting is a great start. Being at the podium is even better. And it’s a bonus if you’re talking about cool technologies or business ideas. If no-one in your company can present on a technical topic, sponsor a meeting. Most groups accept sponsors for food, space, or giveaways. So you can probably find an option that works even if your budget is pretty tight. In exchange you’ll usually get mentions in the meeting promotions or a chance to talk about your company while everyone’s paying attention. This varies between groups, so contact the organizer for info.

3. Don’t talk about your degree

Whether it’s technical or business-related, most of what interests Rails developers doesn’t come from a classroom. People are much more interested in hearing about your experiences in real companies, delivering real products. If you don’t have any experience, that’s okay too. Just be honest about it. Rails developers are very aware that good business ideas can come from anywhere.

4. Have a business plan

How are you going to make money? Knowing your target market and having a marketing plan is best. Having a good shot at a buy out is passable. Selling advertising is unlikely to get anyone’s attention. If you’re profitable today, pitch that. If you’re not profitable yet, emphasize what your company has to offer in technology or lifestyle interest. Having VC backing is fine, but it’s not a big selling point. Same goes for equity offers. Most of us experienced what happened in the dot-com bubble and are not eager to repeat it.

5. Don’t hire a “Rails” developer

The best developers I know don’t classify themselves as “Rails” developers. They might do most of their business in Rails, but they also do JavaScript, Clojure, Erlang, Objective-C and a multitude of other languages. They have side projects using technologies even I haven’t heard of yet. The web development landscape changes rapidly, so you’ll need people who are constantly challenging themselves to learn more.

As with any blog post, these are just some ideas that have helped me. If you have some points of your own, please comment. I welcome the feedback.

Good hunting.

mat@schaffer.me

I live and code in Philadelphia, Pennsylvania. I also run Mashion, my own consulting company. I travel and take pictures when I can and also have family in Japan.

マイホームページへよこそう!フィラデルフィアで働くウェブのプログラマです。旅行へ行って写真をとることがすきです。

twitter.com/matschaffer
  • Loading tweets...
JavaScript RegExp Example: Using a regular expression to change data format