Posts

Microsoft Office and MAKs

I do most of my work on OS X, and that includes all my word processing. So the world of Microsoft Office's rather odd volume licensing scheme was, up to now, something I was blissfully unaware of. Recently though I had to do some IT work for a small company. They said they wanted their company's MS Office installed on some new laptops they had purchased. One problem: they had lost the installation CD. But they had kept a note of their licence key (it was, according to the scribbled note left by the no-longer-working-there IT bod, a "MAK key for Office 2010 Professional"). Easy, I thought. No doubt you seasoned MS folks are shaking your head at my ignorance, but on Mac and Linux having no discs is usually a benefit - they are always out-of-date anyway. Get your installers from the internet. So off I went and downloaded a trial version of Office 2010. All I needed to do was enter the key and it'd work, right? Wrong. "Your licence key is invalid." Hm...
I'm a (sort-of) java developer, so one of the most frequent sys-admin tasks I have to do is install Tomcat on Linux. Since there's usually quite a lag between Tomcat releases and packages appearing in yum repos, I generally do this "by hand". It used to be received wisdom that the way to run Tomcat was "behind" an apache installation, but given improvements in the codebase, the Java VM and the option for it to use the Apache Portable Runtime library, I don't think that's the case any longer. Why run two servers when I really only need one? This means, of course, that it has to start on port 80, and not the default 8080. Which is a problem on linux, as all ports below 1024 are "privileged" and available only to root. Native programs like apache get round this by starting up as root, grabbing the port, then switching to a n0n-root user for their normal operations. This level of native integration is beyond a JVM. You could run Tomcat as root,...
I'm going on holiday tomorrow. (Pauses to whoop gleefully.) This means setting up a holiday auto-responder on my email. Yeah, I know you folks all have your exchange-enabled outlook auto-responder wizard to do this, or your webmail can set it up with a few clicks. But for us old-fashioned types the thing to use is the vacation program. Originally developed by the near-mythical Eric Allman it's now being developed by Chris Samuel and Brian May. (Of Queen fame? Maybe, maybe not.) Download the source from Chris's site: http://www.csamuel.org/software/vacation if your flavour of linux doesn't provide it. (Hint: before it would compile, I had to "yum install gdbm-devel". Your mileage may vary.) Create a file in proper email format in your home directory, and call it .vacation.msg: From: you@yourdomain.co.uk (Your Full Name) Subject: I am on holiday Thanks for your email. Unfortunately, I am currently on holiday and so will probably not see (or reply to) your emai...

MacBook Pro display weirdness

I own a shiny new-model macbook pro, which I delight in very much. However, a couple of months ago I came across an initially very alarming problem which turned out to have a simple fix. I've finally got round to blogging about it in case anybody else should witness the same behaviour. Now, much as I love Apple's hardware and software, I sometimes find their decisions a bit arbitrary and annoying. For instance, they removed a perfectly good DVI port from their macbook pros and replaced it with the new mini-display-port thingy. This means I had to buy two adapters -- one for DVI monitors and another for good ol' VGA. Anyway, that is by-the-by. This story is about what happened when I connected a "big telly" to this preposterously tiny port on a fine day last August. I did this as I wanted to watch a DVD (the most excellent Lives of Others, since you ask). This procedure went well. When finished, I pulled out the displayport adapter. At this point, I noticed that th...

Safari and JQuery problem with fading in

I was recently working on a site where the client wanted a large image slowly faded in when the page loaded. In the past I might have used flash for this, but thought that the same effect could be achieved these days with javascript -- jquery, to be precise. And it can, as two minutes reading the docs will show you. It's in theory as simple as doing $(document).ready(function() { $('div#intro').hide(); $('div#intro').fadeIn(3000); }); This works, but I noticed it gave me a FOUC when viewed in safari (a flash of ugly content). The div would pop up for a microsecond, then vanish, then perform its gentle fadeIn. I first messed around with trying to hide the div before the document was ready, reasoning that the "hide" call was coming slightly too late. But this appeared to make no difference -- and indeed, if you only call hide() without then calling fadeIn() there is no FOUC problem. The actual fix (and I've no clear notion why this works, other than t...

procmail and .forward

The facts are these: I have a user account (and therefore mailbox) on a unix box (let's call it Acorn) behind Xcorp's corporate firewall. I want all mail received for my account on Acorn to be forwarded to another, external, email address. I used to achieve this quite simply by creating a ".forward" file in my home directory on Acorn. This contained one line: \my_username, me@anotherhost.com which saved a copy of my mail locally and also sent it to my remote email address. XCorp's network policy meant that Acorn couldn't communicate directly to the outside world; instead, all email was sent out via the company's smtp relay. This system worked well for a good while -- right up until a couple of weeks ago when XCorp's sys-admins tightened up their relay's policy. It now refused to relay any messages where the sender's email address (as given in the 'From' header) was not from the xcorp.com domain. This meant that about 80% of the emails...

Setting XCode brace options

Just started working with Xcode. I'm old-fashioned and prefer my code blocks to look like this: if (x) { //do something } rather than like this (which is how Xcode defaults to doing things): if (x) { //do something } After a bit of quality time with the big G, I found that this bit of Voodoo (supplied to the Terminal) does the trick: defaults write com.apple.Xcode XCCodeSenseFormattingOptions -dict BlockSeparator "\n" More of these codes are available from Apple's reference docs .