A piggy bank of commands, fixes, succinct reviews, some mini articles and technical opinions from a (mostly) Perl developer.

Jump to

Quick reference

Bash arithmetic/command expansion

Command expansion, I use a lot
echo something $( date +%s )

Backticks also work for command expansion
echo something `date +%s`
...but do they work any differently to $( )?

Conditionals, like an if statement, use square brackets
if [ "$end_hour" = "24" ]; then ....; fi

Arithmetic, like 1 + 2, uses this:
i=$(( i + 1 ))
let i+=1
See http://www.softpanorama.org/Scripting/Shellorama/arithmetic_expressions.shtml


Temporarily suspend a process

At times, you may find it necessary to temporarily suspend a process, and then resume its execution at a later time. The following two commands will suspend a process, and the resume it, respectively:

# kill -STOP 945
# kill -CONT 945

Bash getopts

Use named command line parameters in Bash scripts.

Evidence Based Scheduling

Currently only available in Fogbugz 6.

This is a system that learns from your work estimates, decides how good you are at estimating, and automatically adjusts as you go along to give a more realistic estimate. It works on the principle that people tend to consistently either over-estimate, under-estimate by the same factor. It will also automatically factor in and balance out any delays that occur.

Test Coverage Vim Mappings

From the vi text editor, see which tests cover the file you're working on, or which modules are covered by the test you're in.

Features on the way: Being able to know which tests cover a particular line of a file!

http://search.cpan.org/dist/Devel-CoverX-Covered/lib/Devel/CoverX/Covered.pm