Posts for year 2012 (old posts, page 1)

pssst! wanna darktable package set for Solaris 11?

A few months ago I got Darktable built on my Solaris 11 Express system. Between then and now I was distracted by $DAYJOB (getting Solaris 11 ready for release seemed to take a few cycles ;->), so it wasn’t until last Friday night that I got around to trying the new version, 0.9.3.

Having learnt something from the previous effort, I used gcc 4.6 from the start, for all the prereqs and darktable itself. I want to make this available to others, too, so I’ve spent a few hours building IPS packages and getting things just right. They’re not _quite_ 100% yet, a few rough edges remain. However, I think they’re generally ready to offer up for feedback.

I’ve built them against Solaris 11 FCS on the x64 platform; they might work with OpenIndiana build 151 too.

You WILL need to add the SFE repo so you can get the GCC 4.6 runtime. To do this, utter

# pkg set-publisher -g http://pkg.openindiana.org/sfe sfe

Then download the gzipped p5p archive for Darktable 0.9.3, and utter

UPDATE: Shawn’s comment alerted me to a need to change the syntax here:

# gunzip /path/to/darktable-0.9.3.p5p.gz
# pkg install -g /path/to/darktable-0.9.3.p5p 'darktable*'

This will pull in the prereq packages that I’ve identified and should add the darktable elements to your system’s gconf schema.

Here is the content of the p5p archive:

$ pkg list -g /scratch/web/htdocs/Packages/darktable-0.9.3.p5p

NAME (PUBLISHER)

VERSION

IFO

darktable/darktable (JMCP)

0.9.3

i--

darktable/library/OpenEXR (JMCP)

1.7.0

i--

darktable/library/exiv2 (JMCP)

0.22

i--

darktable/library/flickcurl (JMCP)

1.22

i--

darktable/library/ilmbase (JMCP)

1.0.2

i--

darktable/library/lcms2 (JMCP)

2.3

i--

darktable/library/lensfun (JMCP)

0.2.5

i--

darktable/library/tiff4 (JMCP)

4.0.0

i--




Need to work on the heart rate

Did a shortish ride around the district with Tim this morning. Rather than going over Arrabri Ave and back via Mt Ommaney Dr, we headed left up Mt Ommaney Dr so we could freewheel down the hill to the Jindalee boat ramp. I really noticed my lack of fitness – had to stand all the way up to the summit, and my hr didn’t recover to my normal spinning level for about 90 seconds. I’m going to have to do lots of this before I start trying to train up Mt Coottha.

MtOmmaney_Dr



Happy to knock a minute off

Last weekened I did a 40k ride into town and back. Rather than stopping for coffee at Cup in West End as I frequently do when riding with friends, I thought I’d see how I went without any more stops than required for traffic lights and intersections.

I did almost the same ride again today (less 80m), and was interested to see that I was faster over that distance by about 100 seconds. Also, while my pace was better (22.4 vs 22.1 km/h), I burned fewer calories.

For a giggle, I looked at the last 4 rides I did along that course, where I’d ridden more than 40km, and then the last 4 rides I’d done over that course with at least 39 km. That covers 7 weeks or so, from 1st December. I’m intrigued to see that while my average pace has improved a little (19.5 to 22.4), my calorie count has decreased. I don’t feel like I’m more fit, and my weight is still fluctuating between 87.5 and 88.5kg on a daily basis. I still need to move more (note to self, GET ON THE TRAINER DURING THE WEEK), and I am trying to eat less.

last4_40krideslast4_40ishk






Stereotactic radiosurgery

We went to see an oncologist today, to get a second opinion about what could be done re J’s meningioma. After the pre-Christmas teariness seeing the neurosurgeon, it was really nice to get some potentially good news.

J’s going to get stereotactic radiosurgery. We’re not sure whether that’ll be all in one session, or fractionated (multiple sessions). We’ll know that after they’ve done the planning stage and performed their simulations. She won’t need to go into hospital for it, just rock up to a clinic on as many days as required.

Compared with surgery, this form of treatment has major advantages. With surgery the skull is opened, you need to spend 6-9 hours on the table, up to a week in ICU post-op, then around 3 months of rehab. With stereotactic radiosurgery, they don’t crack your skull open (the beams are highly and specifically targeted to the correct places within the brain cavity), if you can get it done in one hit it’s ~2 hours of being in a mask; if you need fractionated doses then it’s X times 15-20 minutes. The likelihood of hearing loss and facial nerve paralysis (let alone any other cranial nerve impact) is significant with surgery, but the chances of that happening with stereotactic radiosurgery are significantly less.

We’re a bit apprehensive about it all, but feeling generally positive.










First ride of the year (yes, #lazy #fatbastard #slacker)

Part of my recovery from the meniscus op has been to go riding. It’s the part which I’ve been least successful at so far, but which I am determined to do more of. For starters, I need to lose at least 7kg, and I want to lose 15kg, to get me down to the 74-75kg range. When I get back to 80kg I’ll be able to fit into my suit, and more importantly, be able to wear some really awesome tailored Italian shirts I got in Firenze during our trip in 2005. There’s also a nice tailored jumper from Paris that I want to get back into come winter..

Then there’s the small matter of the Bicycle Queensland annual Coottha Challenge. I missed out last year because I was playing safe just before the arrival of A. This year, however, I will be doing that ride.

So yes, I’ve got motivation to get on the bike.

I was going to head off for a city ride via Dewar Tce at 7am, but A’s teething meant we were awake at 11pm and from 2-3, a rather rotten night. Managed to get out the door by 0830 when the temp was starting to rise, and rather than add the extra 10km of going via Sinnamon Park and Seventeen Mile Rocks Rd, I went along Ashridge Rd in Oxley.

While I appreciate the reasoning, I was mightily annoyed to see the traffic calming stuff at the intersection of Dewar Tce and Hilda St. Prior to today I’ve been able to get up to about 60km/h, but today … a mere 31.7km/h. Booooo.

I managed to get to my favourite cafe, Cup by about 10 – it was packed. It’s a small business which has been going for just on 3 years, and while I don’t like that sometimes I have to wait for my coffee I remind myself of the bigger picture – more customers points to operational longevity which points to it being there when I want a single origin expertly poured coffee.

From Cup I went through the Southbank Parklands where the artificial beach was packed full of screaming littlies, across the Goodwill Bridge and back home via the Bicentennial Bikeway. The work that Brisbane City Council has done on the Hale St East upgrade is tremendous, and it was a delight to ride back home. (Next time I’m going along that way I’ll try to get some pics to post).

It was also a delight to be able to hop in the pool with the family when I got back. And since today is proving to be so hot, we might have another dip before dinner, too.

Summary, via my Garmin 705:

  • Distance 51.97 km

  • Time 2:30:56

  • Average Speed 20.7 kph

  • Calories 2,363 C




Multiple recipients with Python’s smtplib sendmail method

I’m currently the defacto maintainer for the Solaris 11++ gate tools, and recently found a need to add support to our mail utility for sending to multiple recipients. We use the mail utility from most of our Mercurial gatehooks so we can notify Relevant People(tm) when things happen.

TL;DR – skip to the Summary

Anyway, my first cut of the change didn’t work, even though the debug log seemed to show the right stuff:

lib $ ./mail.py -n -s "This is a test, please to be ignoring" -x "nofilter" -r jmcp -T alan@domain,valerie@domain,bart@domain
This is yet another test, this time with text in the body.
jmcp
.
send: 'ehlo localhostname\r\n'
reply: '250-localhostname Hello localhostname [myIPaddr], pleased to meet you\r\n'
reply: '250-ENHANCEDSTATUSCODES\r\n'
reply: '250-PIPELINING\r\n'
reply: '250-EXPN\r\n'
reply: '250-VERB\r\n'
reply: '250-8BITMIME\r\n'
reply: '250-SIZE\r\n'
reply: '250-DSN\r\n'
reply: '250-ETRN\r\n'
reply: '250-DELIVERBY\r\n'
reply: '250 HELP\r\n'
reply: retcode (250); Msg: localhostname Hello localhostname [myIPaddr], pleased to meet you
ENHANCEDSTATUSCODES
PIPELINING
EXPN
VERB
8BITMIME
SIZE
DSN
ETRN
DELIVERBY
HELP
send: 'mail FROM:<jmcp> size=264\r\n'
reply: '250 2.1.0 <jmcp>... Sender ok\r\n'
reply: retcode (250); Msg: 2.1.0 <jmcp>... Sender ok
send: 'rcpt TO:<alan@domain>\r\n'
reply: '250 2.1.5 <alan@domain>... Recipient ok\r\n'
reply: retcode (250); Msg: 2.1.5 <alan@domain>... Recipient ok
send: 'data\r\n'
reply: '354 Enter mail, end with "." on a line by itself\r\n'
reply: retcode (354); Msg: Enter mail, end with "." on a line by itself
data: (354, 'Enter mail, end with "." on a line by itself')
send: 'From: jmcp\r\nTo: alan@domain, valerie@domain,\r\n\tbart@domain\r\nSubject: This is a test, please to be ignoring\r\nX-gate-filter: nofilter\r\nX-gate-script: ./mail.py\r\n\r\n\r\nThis is yet another test, this time with text in the body.\r\n\r\njmcp\r\n..\r\n.\r\n'
reply: '250 2.0.0 q050HwfD015209 Message accepted for delivery\r\n'
reply: retcode (250); Msg: 2.0.0 q050HwfD015209 Message accepted for delivery
data: (250, '2.0.0 q050HwfD015209 Message accepted for delivery')
send: 'quit\r\n'
reply: '221 2.0.0 localhostname closing connection\r\n'
reply: retcode (221); Msg: 2.0.0 localhostname closing connection

There’s only one rcpt in that output, which isn’t what I wanted at all.

After much re-reading of the python library pdf I realised that I needed to add the recipients as a list, rather than a string. One quick mod later and I was adding elements correctly – or so I thought. Having an actual list in the email headers made the email.Message.as_string() method die horribly. Back to the drawing board.

I eventually realised that I should use the email.Message.add_header() method instead of the lazy shorthand of just appending to msg['To']. That got the right headers added and email.Message.as_string() didn’t die any more. However, calling

connection.sendmail(self.msg['From'], self.msg.get('To'), self.msg.as_string())

still only gave me one recipient. Fortunately, there’s email.Message.get_all(), which does what I want.

Summary

So the summary is this: If you want to use smtplib to send email to multiple recipients, use email.Message.add_header('To', eachRecipientAsString) to add them, and then when you invoke the sendmail method, use email.Message.get_all('To') send the message to all of them. Ditto for Cc and Bcc recipients.

For the curious, here’s a link to the diff of the lib/mail.py changes




A few blog posts I’ve found interesting in the last few days

Before I forget, I’d like to mention a few blog posts that I’ve come across recently which I think deserve a wider audience:

One teachers approach to preventing gender bullying in a classroom.What this teacher did for her students is truly inspiring.

Why I flipped off “Kiss Cam” at the Boxing Day TestFor a long time now the game of Cricket as managed by Cricket Australia and the ICB has made me despair for the future of the game. Placing advertising on everything that moves is bad enough, but Twenty-20? Can’t Stand It(tm). Add to that the arrogance displayed by the Australian team and you’ve got a real turn off. Reading Megan’s post about the “kiss cam” made me wonder WTF Cricket Australia and their sponsors were thinking. Were they thinking at all? With their small heads? Sadly, but unsurprisingly, about half of the comments attached to Megan’s post display a lack of understanding about why the “kiss cam” is a bad thing for Cricket, and sport in general.

The insecure, unfulfilled life of the true scepticTeaching children to think for themselves, and to nurture their critical faculties while doing so, is one of the best things a teacher can do for a student. I’ve always had teachers who insisted that I think for myself, and showed me how to winnow the chaff. If your child’s teachers aren’t doing that, then your child is missing out on essential life skills which are even more important now (with digital natives, like my kids) than they were when I was at school and could still find an encyclopedia on the library shelves.