26 Nov 2012

Script to Update Sandy Knolls Metes and Bounds Software on OSX

After frequently finding myself not using the current version of Metes and Bounds, I wrote a Ruby script to automagically do that very thing.  It checks current version, downloads the current version, and installs it into /Applications (BEWARNED, it nukes your current version of Metes and Bounds.app, use at your own risk):Thanks to this random blog for the hint on mounting DMGs from commandline!

01 Nov 2012

Migrating NeoRouter Server to new VPS

Migrating from a flaky VPS to a more reliable one has generally been a hassle. But one easy part was migrating NeoRouter Server to a new Xen VPS. tar -zcvpf OUTPUT\_FILENAME.tar.gz /usr/local/ZebraNetworks/NeoRouter Rsync or scp that file over to new VPS wget http://download.neorouter.com/Downloads/NRPro/Update\_1.6.3.3150/Linux/Ubuntu/nrclient-1.6.3.3150-pro-ubuntu-amd64.deb sudo dpkg -i nrclient-1.6.3.3150-pro-ubuntu-amd64.deb Decompress file into place in /usr/local… etc Log into NeoRouter dashboard and redirect domain to new IP address (as found by running ifconfig on NeoRouter Server VPS) Save dashboard settings, click ‘Domain Status’ tab, and gloat in your success!

12 Sep 2012

OSX and Linux Tools I can't live without

I’ll keep it short and sweet but here’s the top list of tools that I’m using in various tech areas of my life.

FASD - Making me more of a speed daemon on cd’ing around terminal along with instant vimming from anywhere. PEW PEW!

Alfred - Speed daemon in graphical environment with starting new programs, running terminal commands, etc. Akin to Launchy, Gnome-Do, Quicksilver (which I wish worked better on my Mac). [This one is Mac specific but see other programs for different OSes]

iTerm2 - Customizable and nicely integrates with tmux. [Mac specific, but on Linux I’ve been super happy with Terminator]

tmux - Terminal multiplexer. Like screen, but much more easily customized. Feels like a VIM take on screen control once it’s tweaked.

VIM - My favorite editor. Mainly used in the terminal but occasionally I use MacVim for the glitz.

Vimium - Bring the powers of VIM into the Chrome Browser. Very very slick interface, especially for opening links, scrolling … just go install it.

VimRepress - Blog with Wordpress from the safety confines of VIM (as I am now)… in MARKDOWN!

GoogleCl - Commandline access to Google features such as Contacts and Calendars. Great for adding events from the commandline. Python tool IIRC.

QuickCursor - Lets me use VIM to edit just about anything. It opens a new VIM instance/buffer with the highlighted text, say from an email and pushes it back into that spot after editing w/ Vim.

BetterTouchTool - Nice easy way to assign keystrokes to open a program, move window to specific region of screen, etc. Also complemented by BetterSnapTool.

TaskWarrior - Task manager on the commandline. Like Todo.sh but with more commandline power and no Android/iOS app. Worthwhile trade at the moment after 3 weeks use. Does have a Sinatra app with TaskWarrior integration… and I’m tempted to scrape together a Ruby tool to have commandline Pomodoro tracker that integrates with Growl and TaskWarrior (as an annotate function)

And in no specific order:

-Dropbox, Evernote, DashExpander, Pomodairo, TweetDeck, Sparrow/Thunderbird (Sparrow for slick integration, Thunderbird for extensions and power), and last but certainly not least Z-Shell.

Let me know in the comments or on Twitter if I’m missing any good tools!

@_zph

22 Aug 2012

CodeRetreat @SteelCityRuby - Things I learned

I attended the CodeRetreat at @SteelCityRuby 2012 and this post is an abbreviated recap of my experience.

It was great! I had fun. There, I’ve thoroughly explained it. Go forth and try it out when CodeRetreat comes to a city near you.

Oh, you wanted more of an explanation? It was an event lasting from 8am to 5pm and it involved turning programming on its head. Corey Haines led the event with the space donated by 4Moms (thanks!!!).

We ran through a series of 45 min pair programming sessions interspersed with lecture sessions and short breaks. Each session was with a new random programming partner and had its own evil (but useful) coding constraints. Think of the constraints as a way to shake free many coding habits and relearn more maintainable patterns.

So what did I and others learn from this day of intense and fun coding? 1. Re-usable and easily modified code is worth its weight in rubies. 2. Think of the ways that constraints may change in the future, code to allow this (ie is true/false sufficient or should it be more than a binary choice?). 3. Tests are more than tests, they’re a roadmap for talking with fellow programmers on your team. 4. Communication is very important, sometimes more than programming skill when working as a pair. I found myself spending time and effort working on communicating well and understanding what my pair partner was envisioning. 5. Contemplate why you’re passing primitives as output from methods. Consider where passing an object could be better. 6. Short methods are maintainable methods, also helps with easier testing. 6b. The idea of a ‘screen-full of code’ being the max for a method came from our elder days when very few lines fit on a screen …. not from now with a 1080p screen with 9 pt font. 7. Possibly the most important learning of the day: Rubyists are very fun and supportive, even of newer programmers.

So think of a CodeRetreat as a sassy, challenging, sometimes infuriating exploration of ’the code less written’, with apologies to Robert Frost.

Give CodeRetreat a try when its in your area. I’ll be hitting up the next one that comes this way.

19 Aug 2012

Swap out BAD line endings for Unix standard

:setlocal ff=Unix :w

Converts and saves current buffer as Unix standard line endings. n FTW!

Update

brew install dos2unix Then use dos2unix to easily swap line endings into Unix format dos2unix \*.rb

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!