New Year Blues

It’s getting to that time of year again we we have to pause and reflect on our accomplishments (or lack thereof) during the year. Again.

A time to compare where we are, to where we should be, to where would like to be…

And as is usual for most of humanity, we will all most likely decide: Screw that, we’ll try again next year.

Merry Christmas to all of you, and a very Happy New Year.

Posted in General | Tagged , , , | Leave a comment

Dennis Ritchie (1941-2011)

It is with sadness that I’ve heard that Dennis MacAlistair Ritchie, the noted computer scientist and co-inventor/creator of both the Unix OS and the C programming language has passed away.

This is a massive loss, since the man’s work is the very reason for my career.

So long, dmr, and maybe now would be a good time to join the demigodic party…

Posted in General | Tagged , , | Leave a comment

Steve Jobs (1955-2011)

So long, Steve, and thanks for all the toys…

Posted in General | Tagged , , | Leave a comment

Geektool is even cooler than I thought…

Hacking away at Geektool I decided to try something else: sending raw terminal escape-codes at it and see how it handled it… In short: even better than I thought. So here is an update to my earlier Geeklet to display a calendar:

printf "`cal| sed \"s/^/ /;s/$/ /;\
  /^ Su.*/d;/.*\`date +%B\ %Y\`.*/d;/^$/d;\
  s/\`date +%e\` /\\\\\033[1;37m\`date +%e\`\\\\\033[0m /g;\"`"

I will admit to still using the previous version, though, since I prefer the font bolding in that one.

Posted in General | Tagged , , , | Leave a comment

Of fortunes and Macs and (Xscreen)savers…

Every so often I have the urge to do something quite unnatural; something like, for instance, actually updating the software on my Macbook…

Rather subversive, I know, but we all have our weaknesses.

One go the packages I make a habit of installing, and updating, is JWZ‘s Mac build of Xscreensaver. The biggest down-side of doing that, though, is that, unlike in Linux, it doesn’t by default display quotes the fortune files.

The ability do so is, of course, still very much there, but the Mac build does not have an easy way of enabling it.

Herewith, then, my workflow to get things back to “sanity” once I’ve upgraded.

Firstly, make sure that you have installed fortune from the ports (or any other way that takes your fancy):

eroux@smaug:~$ sudo port install fortune
--->  Fetching archive for fortune
--->  Fetching fortune
--->  Verifying checksum(s) for fortune
--->  Extracting fortune
--->  Applying patches to fortune
--->  Configuring fortune
--->  Building fortune
--->  Staging fortune into destroot
--->  Installing fortune @6.2.0-RELEASE_0+universal
--->  Activating fortune @6.2.0-RELEASE_0+universal
--->  Cleaning fortune
eroux@smaug:~$ 

Once you can run fortune and get a result, you are ready to continue:

eroux@smaug:~$ fortune
I always had a repulsive need to be something more than human.
                                                -- David Bowie
eroux@smaug:~$ type fortune
fortune is hashed (/opt/local/bin/fortune)
eroux@smaug:~$

Now you need the following patch, which we’ll use to convince Xscreensaver that we know what we’re doing:

eroux@norbert:~$ cat <<EOF >~/xscreensaver-text.patch 
--- xscreensaver-text.pre   2011-03-01 18:06:46.000000000 +0200
+++ xscreensaver-text       2011-03-01 18:07:05.000000000 +0200
@@ -247,6 +247,7 @@
   elsif ($text_mode eq '1') { $text_mode = 'literal'; }
   elsif ($text_mode eq '2') { $text_mode = 'file';    }
   elsif ($text_mode eq '3') { $text_mode = 'url';     }
+  elsif ($text_mode eq '4') { $text_mode = 'program'; }

   $v = get_cocoa_pref_1 ($id, "textLiteral");
   $text_literal = $v if defined ($v);
EOF
eroux@norbert:~$ 

All we’re doing here is adding a program text mode to Xscreensaver, which we will then use via defaults to get fortune to run under its auspices.

Now we need to update all the files that actually could use some fortune:

for I in Apple2 FlipText FontGlide NoseGuy Phosphor StarWars XMatrix; do
    cd "/Library/Screen Savers/${I}.saver/Contents/Resources/" && \
        patch -p0 < ~/xscreensaver-text.patch && cd;
done

Now we get to test one of the screen savers. My favourite is one called Phosphor, so lets start with that:

defaults -currentHost write \
  org.jwz.xscreensaver.Phosphor \
  textProgram "/opt/local/bin/fortune";

This tells Phosphor which program to run, but not yet that it should actually use it. Let’s do that now, why don’t we?

defaults -currentHost write \
  org.jwz.xscreensaver.Phosphor \
  textMode 4;

Here you see us actually using the mode we defined in the patch, earlier. I had to change the scale of the fonts to get the display to fit on my screen, so if it’s too big or too small, you can change that from within the screensaver configuration window.

eroux@smaug:~$ defaults -currentHost read org.jwz.xscreensaver.Phosphor
{
    scale = 3;
    textMode = 4;
    textProgram = "/opt/local/bin/fortune";
}
eroux@smaug:~$

All done… Now you just need to sit back and wait for your screen to lock… Or just press Ctrl-Shift-Eject if you’re too impatient, of course.

Some alternatives to consider: Since the fortune you run is the same program you would find on any Linux machine, you could use “/opt/local/bin/fortune -s” to get only the short quotes, if you wish, or even “/opt/local/bin/fortune -o” for some… other quotes.

Posted in General | Tagged , , , | Leave a comment

Of Geeky Mac Users and their Tools…

One of the toys I’ve come to appreciate running on my Mac, is a little utility called GeekTool

What makes GeekTool cool, is that it allows you to embed different items into your Mac desktop, so it is quite easy to use it to display a text file, for instance (like your system log) or to scrape a ticker-tape from the web and use that to keep track of your favourite Stock Price, but it is also possible to do much cooler stuff…

A quick example of what is possible has been shown on LifeHacker, here, where they embed the venerable Unix “cal” command in the desktop, and using some “sed” slight-of-hand they even mark the current day on the calendar.

“Very Cool”, I thought, “except…”

Well, yes, except. I would have preferred not losing the day, but rather marking it in some way.

But before I get to that, I need to digress a bit first, though.

There are some thinks I would really like in this world. Peace. Children being able to play together for more than a few minutes without fighting. Winning a big one on the Euro Lottery. GeekTool being able to display HTML. But alas…

And since GeekTool would not allow me to embed HTML (or any other markup I could tell: I would have settled for Markdown or even RTF) I tried to work around the problem…

After a couple of iterations (and careful selection of the font GeekTool used to display my resultant calendar) I finally settled on the following:

cal| sed "s/^/ /;s/$/ /;s/.*`date +'%B %Y'`.*//;/^$/d;\
s/ `date +%e` /[`date +%e`]/g;"

This got me a nice-looking calendar with the day-of-week marked by some parentheses:

 Su Mo Tu We Th Fr Sa 
                 1  2 
  3  4  5  6  7  8  9 
 10 11 12 13 14 15 16 
 17 18 19 20 21 22 23 
[24]25 26 27 28 29 30
 31

In doing this, I also got rid of the Month and Year since I already have another Geeklet that displays that on my Desktop:

wpid-PastedGraphic-2011-07-18-14-302.png

That displayed okay, I guess, but I was still (slightly) disappointed. Then it struck me: I was being an utter dunce. I had already been overlaying the other script Geeklets to get the Date/Time display I had wanted; there was nothing stopping me from generating two calendars, one on top of the other, one with the current day edited out, and the other only containing the current day, in the correct spot. That way the second could be displayed in another colour and give me the result I had been seeking.

So, without further ado, I cooked up the following. First, the easy one. Here is the script for displaying the calendar with the current day masked out:

cal| sed "s/^/ /;s/$/ /;s/^ Su.*//;s/.*`date +'%B %Y'`.*//;\
/^$/d;s/`date +%e` /   /g;"

The second stumped me for a bit, till I realised I was doing my usual: over-thinking the problem. This is the script I used in the end:

cal| sed "s/^/ /;s/$/ /;s/^ Su.*//;s/.*`date +'%B %Y'`.*//;\
/^$/d;s/ `date +%e` / ## /g;s/[0-9]/ /g;s/ ## / `date +%e` /"

In these I also deleted the Day strip at the top and added a Geeklet containing the days of the week in the more traditional three-letter format. By dropping the font of that to 18 points as opposed to the other two’s 24 points, I managed to for it all in perfectly:

wpid-PastedGraphic1-2011-07-18-14-302.png

Now all of them fit together rather nicely, and I’m a happy(er) person.

wpid-PastedGraphic3-2011-07-18-14-302.png

For anyone curious enough to know how I had all of these placed to get them to work together (both of you), here it is:

wpid-PastedGraphic7-2011-07-18-14-302.png

For everyone else… I apologise?

Oh, and if you’re wondering about my Desktop Wallpaper, it’s Vlad Gerasimov‘s Mac OS-X Lion wallpaper

Posted in General | Tagged , , , , | Leave a comment

Okay… Colour me impressed by Apple!

From TUAW via Cult of Mac comes the following:

Apple is offering free repairs to those with Macs and iOS devices who had their equipment damaged in the earthquake and tsunami that struck Japan back in March.

A guide on Apple’s Japanese website (Google translation) states the company is offering free repairs to Macs, Cinema Displays, iPhones, iPads, and iPod touches for people who live in the municipalities covered be the Disaster Relief Act of 2011.

For those affected, Apple will pick up and repair your equipment at no charge, then deliver it back to you once the repairs are complete. The company is also offering free access to the AppleCare Service & Support Line for those who can solve issues over the telephone. Apple has been keen to help those in Japan who have been affected by the recent disasters: It has opened up its stores as ‘communication centers’ and allowed people to access the Internet to contact their loved ones through email, FaceTime and Skype. It has also offered donations from app proceeds and allowed customers to donate to the Red Cross through iTunes.

Maybe some lessons to be taken here by the rest of Tech…

Posted in General | Tagged , , | Leave a comment

When Lions Roared…

If you ever have the urge to reformat John Lions’ “A commentary on the Sixth Edition UNIX Operating System”, this patch might help you:

--- Lions.old/lionc.tex 1994-05-19 04:40:49.000000000 +0200
+++ Lions.new/lionc.tex 2011-04-07 15:38:14.000000000 +0200
@@ -1,7 +1,16 @@
 %
 % The Lion's Commentary, file lionc.tex, version 1.3, 18 May 1994
+% Updated 07 April 2011 to generate PDF Bookmarks
+% and to fit LaTeX2e slightly better
 %
-\documentstyle[twoside,fancyheadings]{article}
+\documentclass[twoside,a4paper]{article}
+\usepackage{fancyhdr}
+\usepackage[plainpages=false]{hyperref}
+\hypersetup{%
+    pdfborder = {0 0 0},
+    pdftitle = {Commentary on 6ed UNIX OS},
+    pdfauthor = {John Lions}
+}
 \font\twlrm = cmr10 scaled \magstep1
 
 % Set the page dimensions
@@ -38,7 +47,7 @@
 
 % Set up the headings for the document
 
-\setlength{\headrulewidth}{0cm}
+\renewcommand{\headrulewidth}{0pt}
 \renewcommand{\sectionmark}[1]{\markboth{#1}{}}
 \renewcommand{\subsectionmark}[1]{\markright{#1}}
 \rhead[{\it UNIX 6th Edition Commentary}]{\it \leftmark}

If you have no idea what I’m talking about… Well, then, erm… Never mind… :-)

Posted in General | Tagged , , , | Leave a comment

Change is good: at times it’s the only constant in my life…

Posted on by eroux | Leave a comment

I have always wondered: should we consider caffeine to be a “performance enhancing drug” (which it most certainly is) or a “nutritional supplement” (since most of us would be “dead on our feet” without it)? These kinds of thoughts keep me up at night…

Posted on by eroux | Leave a comment

The wheel turns…

It’s with distress that I’ve witnessed soldiers using live ammo on protesters in Libya and Iran this week, and the brutality of the soldiers against the paramedics in Egypt last week.

As someone who spent more than just a few years in the military and who had been involved in a few riots, and you have to have been in a riot in South Africa in the mid to late eighties to really understand the significance of that statement, I do know the fear and uncertainty involved in standing in a line; just a few soldiers against thousands of rioters. I can still remember the anxiety and can still actually remember “tasting” the fear.

What I can also remember is standing there with rifle uncocked and pointing down. We were warned that there would be actual hell to pay, court-martial style, if we ever shot a civilian; no matter the reason. The rioters were of course not aware of it, or if they were, were not always believing it, but that was immaterial; our job was not to quell the riot but to marginally control it; it was to keep people not involved as safe as we could. The rioters would only very rarely attempt to break through the lines and make our job impossible. Even in those bad old days, the military was respected by the civilians; the police… not as much.

It was during those times that I had learnt to equate the tasks of the soldiers and the police to those in certain medieval city-states: the difference between the Watch and the Guard.

In those cities who might actually have had both, the guard’s primary task was to defend the gates and wall of the city, the watch was to police the city and the wards… Well as much policing as happened in those times. Point being, while these groups would support each other in crises, these groups had their own expertise and zones of authority: the guard would watch for external threat and the watch would police the city.

It is just wrong then, that a “weapon” (there is no other way of really describing the military machine) would be used by their own government on their own citizens. The very existence of military forces is to protect the people, not to oppress them.

A note to the soldiers involved in this: these actions will come back to haunt you, and when it does please remember your beating up the poor paramedics while you lie there bleeding after it has done so…

The wheel turns. It always does…

An erstwhile buddy of mine, the joker of the platoon, would always claim you can smell fear… It smells like sh… Ah. Never-mind…

Posted in General | Tagged , , , , , , , , , | Leave a comment

Deathspiral…

It is not often one gets to witness the end of an era, and it’s probably a commentary on both my age and the time I’ve been in the industry that I’ve been witness to several…

Be that as it may, however, it’s been quite some time since I’ve been witness to one as sad as this.

Nokia has been struggling for some years now, trying to fend off the upstarts who initially snapped at its heels and eventually started to overtake it as a company, providing more capable and able handsets with more consolidated product lines and much more modern interfaces.

Part of Nokia’s problem was that they’ve been stuck in a backwards compatible API (mostly by choice) and took too long to recognise the problem and develop an upgrade strategy. They eventually bought “TrollTech” (the company behind KDE’s QT widget set) but, again, took way too long to mature their exit strategy.

Now, in the age-old mind-set of “when you’ve hit rock-bottom you start digging” Nokia has started digging…

On Friday 11 Feb 2011 they’ve announced that Microsoft will become the new provider of Operating Systems (in the form of Windows Phone 7) for all Nokia smartphone handsets. Thus fittingly ending a series of fairly stupid moves with an absolute humdinger and finishing the Finnish era. Or at least start to.

Update:

Can you say “ouch?”:

wpid-NokiaShare201102141805-2011-02-14-12-351.png NYSE:NOK at Google Finance

Posted in General | Tagged , , , | Leave a comment

For something which is supposed to aid open and universal access, OpenID might be the most Byzantine system I’ve encountered since Kerberos…

Posted on by eroux | Leave a comment

Promises Made…

Yes, yes… It’s all very cryptic and very melodramatic, indeed. I’m sure you’re all really impressed.

Though, spare a thought for those poor buggers reading this via the RSS feed to Facebook, and not on this blog. They’ll be even more in the dark…

But, to return the… <dramatic pause> promise.

Here’s the link to the Widgets I use to display my “Currently Reading” (as well as my “Previously Read” section) as well as the badges I display on the blog:

Do with them what you will…

Posted in General, Site News | Tagged , , , | 4 Comments

Of WordPress, Plug-ins and Widgetey Things…

I’ve finally decided to re-hack my Template/Theme on JADB and get rid of two points of contention (AKA “I need to fix this at some stage”), the “Currently Reading” and “Snippets” “Badges” sections in the sidebar.

I suppose there’s no point in having dynamic sidebars if you don’t do something, erm…, dynamic with it, is there?

I have managed to now stop using “Custom Fields” in posts to populate the “Currently Reading” section (it had the advantage of time-stamping the posts with the primary book I was busy with, but it was also a bit of a schlep to keep up to date) instead just updating the widget directly…

I’ll put them up for download on WordPress’ Website as soon as my Plugin Access had been granted.

Posted in General | Tagged , , | Leave a comment

Zapiro for Government Tribunal

The real tribunal that’s needed in South Africa is not one to protect the public from the media, but rather to protect the public (including the media) from the government…

And people like Zapiro seems to be at the forefront of that action. In this cartoon, he asks a very important question, and one I would love to have seen answered…

A Good question

Wishful thinking, I know…

Posted in General | Tagged , , , , , , , , | Leave a comment

Ar, me hearties; and shiver me timbers! It’s “International Talk like a Pirate Day“! So best ye get at it or I’ll have ye walk the plank!

Posted on by eroux | Leave a comment

On abuse of power and being called to book…

And still the Saga continues.

Mzilikazi wa Afrika, after being arrested, released and then threatened by the NPA, now has had his charges formally dropped. But, it has to be added, only provisionally… This is also known as throwing mud with the hope of getting some of it to stick.

What this is really known as, and I’m certain the ANC agrees — or at least they should — is an extreme abuse of power.

We’re all aware that the Nationalist Government were past masters of this type of action, but it seems that the ANC has taken to the lesson extremely well; so well, in fact that the student might still become the master.

Stephen Grootes, in another brilliant piece in The Daily Maverick covers the “Stench of Abuse of Power” that lingers over the Mzilikazi wa Africa saga…

Since the proposed “Media Tribunal” is meant to serve as a recourse to the poor (embattled politicians), I fully expect that Stephen will become one of their first supressions. Erm, I meant “rectifications”, of course… And the bloody ANC politicians wonder why everyone with half a brain is edgy about it?

Tagged , , , , , , , | Leave a comment

Strange how life works: time after time I find that messages or missives I had originally intended for other people ended up, years later, becoming notes to myself… I’m either very wise or the universe has a very wicked sense of humour…

Posted on by eroux | Leave a comment

Had an idle thought (to be frank, I think I seldom have any other) in the gym yesterday evening: Some of us might have been put on earth to lead as an example, but most of us, I believe, have been put here to serve as a warning…

Posted on by eroux | Leave a comment