One-Liner Bash-Based Continuous Integration (OLBABACI)

Continuous-IntegrationIt’s all about CI these days: Jenkins, Buildbot, numerous SaaS service embedding these fine FLOSS and hoping for a recurring credit card based subscription,… and for a reason. Continuous Integration allow for quicker feedback, shorter dev iterations, better communication.

The principle is simple: as soon as their is a change in code, configuration, datasets, automatically retest the whole application and send automated output (and diffs from previous runs, dashboard, etc..)

Yet, Jenkins or else CI solution, everything takes time to setup. Here with this same principle of CI but with simple bash-one liner, here on Mac:

brew install fswatch

fswatch my_dev_script.py | while read a; do echo “========= Executing $a at `date +%Y%m%d-%H%M`”; $a; echo “========= Done $a”; done

Simple and Stupid right? As soon as the file is changed, fswatch (or inotifywait on Linux) will let the loop run and a new run of your code will happen. Soon enough, you’ll see that every development, no matter how small should always gets its CI.

Then you can go a bit further as when you code, you don’t necessarily always look at your terminal where CI is running. So actually you can track the runs with various metrics into a text/CSV file generated through your one-liner:

  • Date of run
  • PID (as it is often sequential)
  • Number of lines in your source code
  • Latest GIT commit hash
  • Number of lines in output
  • Number of lines matching (case insensitive) “error|warning|traceback|exception”
  • Input file name for your program

The sky is the limit (please pronounce with a thick Texan accent).

 

New code at /tmp/lab: ss7calc

ss7You certainly know about ipcalc, this simple but pretty utility that enables people to calculate netmasks and IP addresses notations easily? What about ss7calc (download)… Well, to start with, SS7 is even more complicated than IP netmasks. SS7 is the network protocol that enable you to send SMS, to receive calls on your mobile and even to change location while staying on the line. But SS7 “addresses” are not like IP addresses, mainly because they can be coded on 14 or 24 bits. They are called “Point Codes or “Signaling Point Codes”.

Now a new open source project by /tmp/lab member helps you calculate ss7 signaling point codes: http://github.com/philpraxis/ss7calc. Thanks Github. Thanks ipcalc for the model.

There will be a workshop on SS7 hacking at 26C3. Get in touch on /tmp/lab mailing list. If requested, we can do a pre-workshop session at /tmp/lab before.