Trouble with apt-get and Squid

I recently started having trouble with APT transactions on my Kubuntu desktop. “apt-get update” would fail for some source entries with the error “The HTTP server sent an invalid reply header”. I thought it was something specific to (K)Ubuntu, but when I had the exact problem on my NSLU2 running Debian I figured the problem must be elsewhere…

I’d recently updated the machine that provides the transparent web proxy function for the network; one of the updates took Squid up to version 3.0 (from 2.6). This was the first thing I was suspicious of.

There’s an option in Squid that controls how it handles an “If-Modified-Since” request from a client. The default is for Squid to respond based on the age of the item in the cache, not based on the real item on the source web page. The comments in the Squid config file indicate that some clients use an IMS when requesting a reload — looks like APT is one of those clients.

Setting this option to “on” (from the default of “off”) in squid.conf fixed the issue for me:

refresh_all_ims on

Tags: , , ,

Comments

Classic Mac sounds on my mobile phone

We watched WALL-E the other day. A bit of trivia for Apple Mac fans (if you didn’t already know) is that WALL-E’s startup sound — heard when he’s finished his solar recharge — is that of a post-1997 Mac computer (with Steve Jobs on the board of Pixar and Disney, WALL-E was never going to make The Microsoft Sound (: ). Coincidentally, at around the same time as I saw WALL-E I was going through that modern malaise of mobile-phone-alert-tone-taedium… So, inspired by this bit of cinematic crossover coolness, I decided to get some Mac-chime action for my handset.

The first thing was obviously to get hold of the audio file. This turned out to be surprisingly easy, thanks to Google pointing me to a piece of software called MacTracker. MacTracker is actually a reference guide for Apple products (computers all the way back to the Macintosh XL, the MessagePads, printers, displays, even iPods and mice), but part of the information it holds about the computers is their startup and death chimes.

There’s no option in MacTracker to export the audio files, but by opening the app package (”Show Package Contents” in Finder) it’s possible to navigate to where the chime sound files are stored. Then from Finder, all I had to do was zap the file to the phone via Bluetooth. On the phone, opening the Bluetooth message gave me an option to save the “music” file, which I did — this adds the file to the Music Player, but importantly makes it easily selectable in the configuration of the alert tones.

So now when I receive an SMS I hear the death chime of a Macintosh LC, and the startup sound of the Twentieth Anniversary Macintosh alerts me to incoming e-mail. I’m going to apply similar configuration to my desktops: on-and-off for the last ten years I’ve been using a Homer Simpson soundbite to advise incoming mail, and it’s a bit tired now…

Next task will be to replace the startup sound on my N810 with something a bit retro-Mac! :)

Tags: , ,

Comments

Comments and Downtime

Observant readers will notice that they are no longer able to respond to posts. The blog-spammers have won the battle but, as they say in the classics, they will not win the war…

I've turned off the comment capability, until I can get something in place to bring the rubbish under control (a recent update to PolarBlog helped a bit, in that the crap doesn't display on the site any more, but when I log on I get to see the mess). I'm thinking of a new site, where I can discuss technical stuff a bit more and thoroughly while keeping the private stuff separate if I need to.

The site has had a bit of downtime recently, due to my non-existent monitoring of what's happening on my hosted server. This will change shortly, and I'm looking forward to things returning to the stability they had when I was self-hosting.

Tags: ,

Comments

Time off from work

I'm taking a bit of time off. There's a few projects going on around the house, plus I've been letting a few things get to me recently and I think I need a break from work. A couple of weeks off, with a few days on the Sunshine Coast to unwind, could be a good thing.

Comments

Photo printing pain

S went to print some photos the other day, and what was supposed to have been a simple exercise turned out to be a very frustrating one for both of us. I was utterly amazed to discover that even on the eve of 2009 there are web sites that think the world is only viewed through Windows…

S's and my respective creative sides are being adequately satisfied by the iLife suite on the Mac, but there are times when we need to get the pictures out of the silver tower and onto other media—on this occasion paper, for albums and so on. A large retailer here has part of their floor space in each store set aside for those photo printing kiosks, and I introduced S to the art of putting photos onto a USB stick so that she could print some photos when next she went there…

On her return from the shop, she reported that we hadn't successfully put the photos she wanted onto the stick. When she'd plugged the stick in, she'd found only less than half of the photos we'd stored there. Sure enough, when I plugged the stick in all the files were there safe and sound. Strange thing was I could find nothing in common about the files (uppercase/mixedcase filename, long or 8.3 filename, datestamp, etc) that would have yielded the number of photos that the kiosk had found on it.

Annoying, but life is too short to worry about it. After all, this same retailer was plastering adverts of their new web-based photo printing service… S could submit the photos online for printing and pick them up from the store later.

<sarcasm>This is where the fun really started.</sarcasm>

Their app is Flash-based but seems to have some Java involved as well. While it loaded quickly enough, the app portion of the web page had an incongruous grey background that just looked dodgy. S had to create an account and sign onto the site just to get this far though, which was a bit annoying.

The workflow seemed to be to create an album, upload pictures to the album, then select photos from the album for processing. Creating the album went fine, but when the upload function was selected there were no action buttons visible to complete the operation! S was using Safari, but Firefox made no difference.

Then I suggested she use her laptop, which runs Ubuntu 8.04. The situation actually seemed a bit better to start with, as instead of the upload function showing an embedded file selection dialog like it did on the Mac we got a "normal" GNOME file dialog box. However, only some of the photos showed again: this time, it was because they had hard-coded a non-modifiable filename filter for the dialog that was only picking lower-case file extensions!

Trying to work around this, I mounted the stick manually with different mount options. I succeeded in getting all but one of the files showing with a lowercase name, and a rename fixed that one. Back in the web page however, it still didn't like us: any file chosen from the dialog box resulted in a nonsensical error message followed by a "You have selected no files to upload" dialog.

S was beyond caring by this stage (she has a very low threshold for being stuffed around by technology). She went to Snapfish after a friend's recommendation, and found a well-designed and easy to use WEB site that required no downloads or other junk.

So why did this wind me up to the point of spending all this time blogging it? Because nowhere on Big-W's site is there any mention of browser or operating system compatibility. Not even a "we've tested only on Windows, Mac users may experience difficulty"[1]. Not a blessed thing. Their Help page has a single paragraph about trouble uploading, blaming "your IT Department" for "setting certain network properties that inhibit the upload tool from working".

I wonder if the developers of the app were just so blind to believe that their gunk would just work wherever it was run, or whether they really think that it's a Windows world. Of the two I hope it's the former. ;-)

So Snapfish gets a recommendation for being not just an application hosted on the web but a web application. They do good photos too!

[1] I never expect to see Linux mentioned on these things and get pleasantly surprised on the occasions it is; even if it says "Linux is not supported", someone there at least knows enough to mention it.

Comments

BOM Radar for Cisco 7970

I’ve written an XML app to display rain radar images from the Australian Bureau of Meteorology on the screen of a graphics-capable Cisco IP phone. It seemed like it would be simple to do, and I couldn’t work out really why no-one had done it. Well it wasn’t hard to do, but I can see now why it hadn’t been done…

While the screen of the 7970 looks nice on it’s own, and is certainly a drastic improvement over the 7940/7960, it doesn’t have the resolution to be able to display anything useful other than text and simple images. The BOM images are 524×564, while the largest image the Cisco can show is 298×168.

Here’s an example of my app in action:

bom7970

Because the phone’s image viewer can’t scroll a large image I’ve had to scale and crop it, losing a fair amount of detail in the process (I did try just scaling it to fit the entire image, but it was totally useless to view). Plus, one of the key attractions of the BOM radar site is the animated images, and the phone has no way to display animations.

So what do you think, lazyweb? I’ve learned a bit more about coding Cisco XML apps, but other than that have I wasted my time? I will put it up on my Projects site eventually (once I’ve put in some more error handling etc), but let me know with a comment here…

Tags: , ,

Comments

Living with an iPod touch

I held out for a long, long time. I'd even talked myself entirely out of getting one. Like they say in the classics though, "you think you've escaped, but they pull you back in". I now have a 32GB iPod touch and it's doin' alright, even though it took me nearly a week before I bothered putting any media on it!

I think what finally did it for me was the App Store. I love being able to simply go to an app on the device and easily look for software, installing what I like with no fuss. I especially like the fact that my downloads are synced with my computer, so that I don't have to keep track of all the individual items I've installed (unlike my phone; I can't think where all the sis and sisx files for different stuff I've installed might be).

My Facebook friends will know that I'm much more active there suddenly. Why? The Facebook app on the Touch — I no longer have to start up a computer or open a browser to update my status or reply to comments. I had a bit of this function with Fring's Facebook interface on my phone, but the large screen of the Touch makes things like this much more friendly.

I came very close to getting an iPhone actually — but not to use as a phone. This was after I'd realised that it's just as valuable as an Internet-connected device as an actual phone. The cost of iPhone service is still a bit prohibitive to me though, especially for an occasional-use device.

One of the things that had turned me off was the closed nature of the iTunes ecosystem (iPod, iPhone, Apple TV, iTunes). People sometimes ask me about Skype, and I say that the worst thing about it is that it Just Works. I mean, it's a closed system with no interconnections other than those provided by Skype themselves — by this nature it should fail, and yet because it works (arguably) better than any other desktop VoIP product it enjoys immense success. Same goes for Apple's stuff: the iTunes ecosystem Works And Works Bloody Well.

I've been thinking for ages about sync for calendar and contacts and stuff; I've been hunting for services and software and tools for ages. I could build something myself, and indeed started to (I've looked at Google Apps, used Chandler, checked out Ovi, and played with Sync4J before it was called Funambol). I could spend time and effort coming up with something myself…

Or I could just buy an iPod.

Tags: ,

Comments

The difference between pipe and redirection

Newcomers to UNIX-like operating systems are often confused by the difference between the shell operations pipe and redirection. The difference is easily explained with an example, in the context of web development. The shell command echo "st=1" | ./lifeswork.pl shows how a pipe is used to supply command line input to a script usually invoked via CGI in a web server. This allows the script to be more easily debugged by testing at the command line. The shell command echo "st=1" > ./lifeswork.pl shows how redirection uses command line input to overwrite a script file, destroying the file and the web developer's sanity. Hopefully this example illustrates the difference between pipe and redirect, and helps you avoid the idiotic mistake I just made.

Tags: ,

Comments

Security blows

I was about to post about how pleased I was with Synergy in helping me tidy up my desktop clutter (by removing a keyboard and mouse from the surface). Ironically, I’m instead posting about a problem with the configuration that will cause me to throw it out and look for something else. Why the title? Because the default configuration of a Linux distribution nowadays has given me no way to fix this ridiculously simple problem without powering off the running PC, VMware guests and all.

The problem is that Synergy and the VMware console don’t play well together (I could have sworn that when I first started using Synergy I had no trouble with it, but there are a few hits around that describe problems like I’ve now hit). The problems people are reporting are that keys like Shift and Ctrl are not passed to the VM (some described here and here).

My problem is slightly different: the screen of my Synergy client (the one that’s running VMware) locked while a VMware guest had focus. Now, the Shift and Ctrl keys are not picked up by gnome-screensaver to unlock the screen. Even the real keyboard attached directly via USB doesn’t work. Big problem, for the following reasons:

* Thanks to password strength rules enforced on the Linux build I use, my password now has a Shift-obtained punctuation character.
* I can’t switch to a virtual console, since that requires Ctrl (e.g. Ctrl-Alt-F1).

Okay, so the keyboard doesn’t work. This client machine just happens to be a tablet PC, and I had hacked gnome-screensaver (to display the onscreen keyboard to allow the screen to be unlocked in tablet mode). I grabbed the pen and tapped out my password, but it *still* didn’t work: even the output of the virtual keyboard gets the Shift modifier dropped. Hmm… Starting to fume now.

Never mind, I’ll connect via the network…

* Fedora does not start SSH by default (okay, yes, and I didn’t make sure it gets started after I’d finished the install).
* There is no remote desktop (VNC server, XDMCP) configured.
* The shiny web-based management interface on VMware Server 2.0 only listens on 127.0.0.1 (or is being blocked by the Fedora firewall).

So with no way to get access to the machine to try and fix it, a power-off is the only solution. Some readers are probably thinking “boo-hoo, diddums had to kill-switch his widdle poota, how tewwible,” but I hate having to do that; not because the system doesn’t recover, but it’s “problem resolution, Windows-style”.

Even though the real problem was between Synergy and VMware, I’m blaming the (perceived) need for security since without that I wouldn’t have a cryptic password that I can’t enter without Shift and a system I can’t administer over the network. Red Hat and Fedora doing everything in their power to ensure I don’t fall prey to nasty Internet fiends (rich analogies to governmental nannying, but that’s probably over-thinking things).

So in summary: Synergy is great, just as long as you’re not using VMware console and have a password with punctuation or uppercase… Remember to have your SSH or other network access enabled before you play!

Tags: , , , ,

Comments

We finally meet K (a.k.a. Clinker)

To our beautiful baby girl, the warmest and fondest welcome!

The post I made here last night was going to be a comment about how ironic it was that we didn’t want to know our baby’s gender and yet the time of the birth was known. Well as fortune would have it, I would have been wrong on both points!

We were due to arrive at hospital at 1:30pm today for a 2pm induction, but our baby had different plans! S went into labour spontaneously at about 1:30am this morning, so we had the dash to the hospital that we never thought we’d have. By 2:30am we were in the birthing suite, and just over one hour after that our baby girl K arrived!

As for the gender thing, although we were obviously going to be happy to have a healthy baby of either gender we’d both been hoping for a girl. This time, something was telling me that it was in fact a girl–I guess you’d say I was very confident. So confident in fact, that S was quite angry at me about a week ago for not committing to a name for a boy. :-)

N met his baby sister this morning… he has a very proud-looking smile on his face whenever he looks at her! He’s a wakeup to our grownup tricks though–we’d bought him a present to take home with him “from the baby”. When given the present, he reportedly (and in his best “hang-on-a-minute-you-can’t-trick-me” voice) said “that’s not from the baby, babies can’t go shopping!”

PS: What’s Clinker? That’s the nickname that S’s work friends gave to her baby-bump!

Tags:

Comments