Erik Zaadi

The tales of a coding manager addicted to dad jokes

Recent Posts

Cleaning up Jenkins jobs

Jenkins rules, but…

It’s a Java XML consuming monster.

Once you get up to a large number of jobs (We are near 300), it gets a bit tough, especially when restarting.

So, every once in a while, I cleanup old unused jobs that are left over.

delete_non_active_jobs.py

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
import urllib2
import os
from shutil import rmtree

def get_active_jobs():
   request = urllib2.Request('http://localhost/api/python?tree=jobs[name]')
   opener = urllib2.build_opener() 
   json = opener.open(request)
   return [job['name'] for job in eval(json.read())['jobs']]

def get_jobs_dir():
   return os.walk('.').next()[1]


if __name__ == '__main__':
    jobs = get_active_jobs()
    jobs_in_dir = get_jobs_dir()
    jobs_to_delete = sorted([job for job in jobs_in_dir if job not in jobs]
    for job in jobs_to_delete:
        print "Deleting: '%s'" % job
        rmtree(os.path.abspath(os.path.join(os.curdir, job)))

Delete them allz'

Assign an Application to all desktops in Applescript

Back to basics, applescript

It’s been a while since I wrote applescript.

Although the capabilities are truly amazing, I never really connected to the tell syntax, a bit to verbose for me.

Anyhow, I’m using slate for automagically position apps when I change monitors (amongs other things), and I needed a way to pin certain applications to all desktops when using multiple monitors, or to a specific desktop when using just one monitor.

Return of the Mac

After two wonderful years of Linux, mostly with Ubuntu (with a small visit to Fedora), I had the opportunity to switch to a Mac at work. It’s an old 2009 MBP inherited by Vuduchild who left us lately.

At my previous workplace, I had an iMac for about four years, and I’m ashamed to admit that about two and a half years out of those four, I was mainly on the dark windows side of the iMacs bootcamp (NEVER AGAIN). As for the last year and a half out of those four, I started to use Mac OS exclusivly, fell for git and vim, but still developed mainly DONT.NIET apps.

FDD - Fika Driven Development

FDD FTW

There are many different type of development methodologies. TDD, BDD, what have you.

You also got non development centric methodologies such as Pomodoro, which help you make the most of your time.

At our group at work, we have fine tuned a brand new and shiny methodology called:

“FDD” - Fika Driven Development

20120515_114703

[Fika](http://en.wikipedia.org/wiki/Fika_(coffee_break)) is a Swedish custom imported by yours truly.

Every day, at, it’s Fika O’clock, usually announced by SHOUTING in ascii in our IRC channel.

nose-rapido - a rapid feedback plugin for nosetests

I use a tmux + vim development environment which I find really productive. When hacking on python projects, I like to have a tmux window open with nosetests logs, typically using nose-watch.

Every now and then after saving, I’d switch to that window to see how the tests are doing.

I wanted something a bit more small that would give me immediate feedback in my main window that I use, which is of course the vim window. The feedback should on one hand not take up to much screen estate, nor disrupt my vim-fu focus.

Auto Auto Reloading iPython modules

You all use ipython, it’s an awesome tool.

However, it’s kind of annoying to exit and re-enter ipython when you change your python files.

There’s an extension built into ipython called autoreload which can be loaded by entering:

1
2
%load_ext autoreload
%autoreload 2

Now whenever you edit your file, your objects will be updated in ipython without the need to close and reopen ipython.

But entering those lines each time you pop open ipython isn’t fun either.

Fast remote editing with Vim

UPDATED: bash script now even more cool!

There’s a feature in vim of editing files over scp, built in since vim 7.1 (originially the now baked in netrw plugin).

This feature uses scp to copy a local version of the remote file over scp, edit it with vim, and with each save connect via scp and save it to the remote location.

This allows you to edit remote files with your own tailored vim instance (plugin galore!).

Three Amigos One Tmux

TL;DR: telnet gameoflife.erikzaadi.com 1337

This Saturday (8th of December, 2012), was the second Global Coderetreat, and I was amongst the lucky ones to participate from Tel Aviv.

The event was epic, 30-ish geeks pairing up to 45 minutes of hacking sessions on Conway’s Game Of Life.

And that was just in Tel Aviv, about 3500 people worldwide took part in this Geekathon.

The last session I teamed up with Roy Rothenberg and Pablo Klijnjan (Yes that last name is in Klingon), both my day to day teammates at work.

Installing Bare Boned Ubuntu using the Mini ISO

After installing Ubuntu 12.10, I got annoyed by the amount of unneeded software installed, especially the commercial lenses, offering me to buy something for every program I want to launch.

I tried Unity for about two weeks, until I decided I have to change to something else.

I used Gnome 3 with Fedora for a while before, and I really like the native multiscreen support available, that allows you to have a second monitor that doesn’t change when you switch workspace. I missed the diagonal workspace switches from Gnome 2 (and Unity), but it was a pleasant desktop.

Unsubscribing to watching all repos in a Github organization

Github notifications are great, but if you are a part of any organization, it quickly get’s overrun with repositories that you aren’t necessarly active with’s notifications, making it hard to filter the important bug reports on you own repos.

To unsubscribe to all repositories in an organization, open up your watching page (Login first of course).

Copy the gist below and replace THEORG with the organization you wish to unwatch it’s repositories.