1984 – the techblog

(Hopefully) useful various sysadmin and other stuff.

January, 2012

Bash: Handling various versions of wc

I really love the wc tool. For those who don’t know it, it sim­ply counts words, lines, char­ac­ters and bytes of any input it receives on STDIN. You’d be sur­prised how often one needs this func­tion­al­ity! But, as with many things POSIX/UNIX, there are dif­fer­ent flavours avail­able; while many tools have the same name on all […]

Get the sum of a column in shell (using awk) or: find out cumulative memory consumption

The title already gives it already away, awk is the tool to use here: awk ‘{ SUM += $YOUR_FIELDNUMBER} END { print SUM }’ where YOUR_FIELDNUMBER is the num­ber of the col­umn you want to sum (the dol­lar sign is required!). I needed lit­tle one­liner to find out how much mem­ory php was con­sum­ing on a […]

Compiling transmission fun (FreeBSD)

Com­pil­ing trans­mis­sion can be a bit funny (read: not fun) some­times. I faced this task on a locked down FreeBSD sys­tem. Here’s what errors I encoun­tered, and how I was able to solve them. Don’t for­get to do a make clean after you’ve mod­i­fied a file (per­haps even re-run con­fig­ure). make: don’t know how to make ./libtransmission.a. […]

Hidden Gems: Boolean Spotlight Queries

By now, any decent user of Mac OS X will know and have used Spot­light. Maybe loved, maybe hated it (I’m slowly com­ing to terms with it). In clas­sic Apple fash­ion, it’s dead sim­ple to use and needs only a text input field, where you enter what­ever comes to mind when you’re look­ing for that […]