12 Aug 2012

CodeRetreat @SteelCityRuby: A Post Mortem

My head has finally stopped spinning from the CodeRetreat at this year’s Steel City Ruby Conference (2012), the fires are extinguished at work, and I’m ready to document the experience. I arrived as the first participant, not because I’m overachieving but because the Pittsburg taxi system is very irregular. I allowed the same time as the day before for a cabbie to pick me up, which was 30 minutes. Instead I was swooped up in 10 minutes and arrived nearly an hour early for the CodeRetreat at 4Mom’s office. The CodeRetreat was lead by the charismatic Corey Haines, the same bloke who set a wonderful tone on day one of @SteelCityRuby by emphasizing personal networking. In fact, the tone set by his keynote speech kept the conference largely free from individuals using their laptops during speeches! Quite a difference from other conference scenes that I’ve experienced :). But back to the point, the CodeRetreat was held in the offices of 4Moms and the food was sponsored by those fine folks. We started the day by pair programming Conway’s Game of Life using Test Driven Development. The first round lasted 45 min and we were then told that the specs had changed and to fix our code in another 10 min. Thankfully our code was relatively modular and the changes needed were minimal. We reviewed the amount of code revision needed to implement small requirement shifts and discussed how to build in flexibility and simplicity into the code.

Notes: Revelations: spending time learning social intricacies of collaborating

06 Aug 2012

Dear OSX Mail.app, go away

Dear Mail.app, I don’t want to open Mail for configuration every time an iCal notification arrives. And no I don’t want to use Mail as my default. And no, I don’t want to setup even a dummy email account in Mail. sudo chmod 000 /Applications/Mail.app PS - You too iTunes sudo chmod 000 /Applications/iTunes.app #fixing_OSX kthxbye

04 Aug 2012

The Way Conferences Should be - SteelRuby Pittsburgh

I’m attending my first Ruby conference this weekend, YAY!

I want to share a great thing that this conference is doing, which is the emphasis on community and interraction. From the first moment of the conference the organizers recognized that the human capital present is not confined to the speakers. With that in mind the schedule is set for 30 min talks and 30 min ‘hallway sessions’ (ie discussing the topic or discussing Ruby/work/code projects/etc).

So, combine this progressive schedule with a keynote introduction by Corey Haines, where he set the tone for the conference, ’these are not strangers, these are friends and colleagues that I don’t yet know.’ (my paraphrase is a loose one to the spirit of the talk and I’m also leaving out the cute photos of kittens that filled his slides).

Corey’s talk, formally about how to get the most out of a conference, ended with the encouragement and challenge to have everyone in the conference meet and get to know 20 new people this weekend. Which sounded GREAT until the slides ended and the absolute introverted terror set in. I tend to share very little personal information in my blog, but I’ll say this: I’m introverted and have difficulty breaking the ice myself. That said, I have little to no trouble interracting, conversing, and carrying a conversation in a group like this, after that initial hurdle is over.

Back to the point, I remember looking around and thinking that a presentation like Corey’s was all well and good. I hoped that this conference would be technically interesting and possibly even some interesting social stuff, but I didn’t expect it to feel radically different than my prior confs. It did/does.

People approached me, shook my hand, asked what brought me to the conference. I talked about being a hobbyist at this programming stuff, but a hobbyist who spends much of the last two years working on Ruby & GIS. I introduced myself to all sorts of people and we geeked, it was great. And each initial experience of breaking the ice was still tough and emotionally expensive, but a little less so each time.

Thanks SteelRuby, you’re doing it right.

Thanks fellow Rubyists, I’m glad to be getting into the community.

PS - Putting names to faces with people that are well known in the Ruby community is cool and each and everyone one of them have been awesome and friendly.

31 Jul 2012

FASD - The Commandline Shortcuts I always wanted

FASD is a shell script that follows in the concept and footsteps of Autojump and Z. It extends the functionality of both of those systems to better differentiate between files and directories. FASD also allows for tacking on different commands to the beginning of a fasd reference such as using vim in an alias, ie: alias v='fasd -e vim'. This VIM alias calls up the most active file matching that pattern and opens it in Vim. Or a simple z searchterm will find the most often and recently used folder and ‘cd’ into it! This is amazing for nested folders. It’s like Vim’s Ctrl-P or Ctrl-T but on the commandline and with more flexibility.

It’s magic and I’ll post back if I keep having good success. Try it out with a brew install fasd or check the install instructions on their github page for more options - FASD.

Update: Still having very good success.  Moving from ~/ to deeply nested folders is a breeze with ‘z SOMEPARTOFPATH’ and likewise using vim to edit a deeply nested file with ‘v SOMEPARTOFNAME’.  It’s nothing short of magical after 2 months of use.

Update Jan 2013: Can’t imagine living in the shell without FASD. This is now included in my environmental setup script.

19 Jul 2012

X11 Forwarding: Or How to use my favorite Calculator in OSX

I switched to a Macbook Air a few months ago and I’ve been generally quite happy with the setup.

One thing I’m unhappy with is the availability of my two favorite calculator programs. On Linux distos I’m accustomed to installing ‘qalculate’ and on Windows it’s been GraphCalc. I tried to find equivalent programs under OSX, giving it all of 15 min of effort, but couldn’t find a robust solution with good history, nice data entry, etc.

So, I decided to stick with my favorite (‘Qalculate’). I then tried installing it from source under OSX which didn’t succeed. I then tried to do the same with graphcalc’s Linux source, with the same result.

At this point I remembered toying around with X-forwarding over SSH. Since I had already installed the X11 environment for running GIMP (GNU Image Manipulation Program), it was trivial to que up a virtual instance of Debian Linux under Parallels. I installed Qalculate in that virtual instance and used the ssh command for X-forwarding: ssh -X username@server\_name 'qalculate-gtk &'

The result is that I have a virtual instance of Debian running in the background, my normal OSX interface, and my favorite calculate ready to go (as if it were a native OSX application).

Thanks SSH!

15 Jul 2012

My Firefox confuzzled my Nokogiri

I’ve been working on a project to import a large dataset from HTML pages where the content isn’t very clearly divided with CSS classes. The tool that normally works for me is Ruby’s Nokogiri library.

I’d had some trouble in the past where Nokogiri insists that a certain xpath doesn’t exist, while it can clearly find it through the css selector. This time instead of going with the css, I investigated to see why it wasn’t finding the ‘correct’ xpath. After playing with it in a Pry session, I figured it out. Here’s the xpath that Firefox/Firebug/Firepath all report: //html/body/p[4]/table/tbody/tr[3] Here’s the true xpath as parsed by Nokogiri: //html/body/table/tr[3]

Notice that the ‘p[4]’ element disappears along with the ’tbody’ element. After reading on StackOverflow.com about the issue it sounds like Firefox ‘corrects’ improperly formed HTML by adding tags. So thus the disparity between what Firefox sees (the orderly HTML standards) and what Nokogiri sees (the cold hard real-life web).

Now I want a browser plugin that shows me what is truly there so I don’t have to interpret and modify the information that Firefox gives me. Please speak up in the comments if you know a better way to avoid this annoyance.

06 Jul 2012

File under 'Commands I should Know'

#shutdown now -h Pretty important but didn’t know about the ‘-h’ flag until today. When run as root this will shutdown system (Linux specific) now and send it to a init-level 0, ie a full halt. Good to know =D. As pointed out in comments ‘shutdown -p now’ is the BSD equivalent.

05 Jul 2012

Awesome tool for recovering ecryptfs from Ubuntu/Canonical

During the process of recovering an encrypted filesystem from an old server of mine, I found that I couldn’t access any of the data. It appears that I encrypted my home folder on the server using Ubuntu’s default ecryptfs.

I ‘Googled’ my way through locating the encrypted ‘.Private’ folder and tried unsuccessfully to mount the folder. I then used ecryptfs-unwrap-passphrase to unwrap my unique passphrase using the old login password.

Armed with that and a tool from Dustin Kirkland over at Canonical (ecrypt-recover-private) I succeeded in using the following command to recover my data sudo ecryptfs-recover-private .Private(at appropriate location) (Note - replace .Private with whichever location it’s at) Then type in the login password, which yields the passphrase, which leads to mounting the data as a read-only directory in /tmp.

Thanks Canonical!

05 Jul 2012

Linux Command of the Day

No fancy commands today, just good ol’ functional admin action. I was setting up a couple of new Virtual Private Servers (ala EC2 or DamnVPS) and came across the following helpful command ssh-copy-id -i ~/.ssh/id\_rsa.pub username@remote\_server\_ip\_or\_domain What it does is copies (appends) your ssh key to the list of permissible keys on the remote server.

Need to make an SSH key for this purpose? ssh-keygen -t rsa -b 4096

Need to install ssh-copy-id on OSX? brew install ssh-copy-id

04 Jul 2012

Installing JungleDisk on Mint 13 (12.04)

I’m setting up a home server (which will be a blog post for a later date).

But in the process of setting up Amazon S3 backups, I was installing JungleDisk. This allows mounting of a remote S3 bucket as if it were a local drive.

After installing, I received the following error stating that it could not find ’libnotify.so.1’. I used the locate command to find libnotify (currently libnotify.so.4) and used symlinked it into place. sudo ln -s /usr/lib/x86\_64-linux-gnu/libnotify.so.4 /usr/lib/x86\_64-linux-gnu/libnotify.so.1

After the symlink everything started up correctly :).

Btw, server is a quad core AMD (Phenom), 12 GB RAM, plenty of storage, SSD for boot drive, spinner platters for storage… and ZFS =D.