penguin cartoon

Repairing a faulty Homecast HT8000 PVR

My much-loved Homecast HT8000 PVR started misbehaving recently. After a bit of web searching, I found this forum post that exactly described the problem, and led me to the solution, which is to replace a defective capacitor on the power control board.

To help the next electronics hobbyist who encounters this problem, here's a step-by-step guide to how I replaced the capacitor.

Because it can't go without saying, you follow these instructions at your own risk, and I accept no responsibility or liability for any loss or damages to yourself, your Homecast HT8000 or anyone or anything else.

Also, read these instructions in their entirety before you even think about following them. You'll need to get hold of a replacement 10V 3300uF 105° C electrolytic capacitor. I bought a 10-pack from China on eBay for just over AUS$4 (in this mad world, buying 10 was cheaper than buying 1). I also recommend you get a new CR2032 battery to replace the one on the motherboard.

The ProcedureCollapse )
  • Current Music
    More Than A Feeling - Boston
penguin cartoon

Bulk harvesting of newpaper articles from Trove on MacOS 10.9 or 10.10 using Retailer

Conal Tuohy (@conal_tuohy) presented a session at THATCamp Canberra 2014 on Retailer, an interface tool he's developing to provide the National Library of Australia's Trove service with an Open Archives Initiative Protocol for Metadata Harvesting-compliant interface.

The aim of the session was to get attendees to install Retailer on their laptops and then perform some searches.
It turned out that installing Retailer on the Mac laptops present wasn't quite as straight-forward as might have been hopedCollapse )
  • Current Music
    The Essential George Benson
penguin cartoon

Fun with Firefox and Java Deployment Toolkit plugin

To start with, we're running a 64-bit Windows 7 environment.

I had a complaint from a user that a Java applet they used to run quite happily in Firefox was no longer working.

Looking at their Firefox (v 24) setup, it was complaining about a plugin named "Java Deployment Toolkit 7.0.250.16" being vulnerable, and it had disabled it. Fine, but there was no sign of the JRE plugin. This was odd in two respects; not only was the JRE installed, it was Java 7 Update 45, a much newer version.

So, about:plugins told me that the Toolkit was located at
c:\windows\sysWOW64\npDeployJava1.dll

I quit Firefox, deleted the DLL and then restarted Firefox.

So, now Firefox complains that "Java Deployment Toolkit 7.0.450.18" is known to be vulnerable, and it has been disabled, but at least the "Java(TM) Platform SE 7 U 45" plugin is listed, and the Java applet will run.

For those who are interested, the new version of the Toolkit plugin is located at
c:\Program Files (x86)\Java\jre7\bin\dtplugin\npDeployJava1.dll

From this, I can only conclude that if Firefox detects the old Toolkit plugin, it doesn't find the newer Java installation. I'm wondering how many of the computers in our managed environment have the old version of the Toolkit plugin left behind to cause problems...
  • Current Music
    S.O.S. by Cherry
penguin cartoon

Solving a strange problem with Armangil's podcatcher

I use v 3.1.6 of Armangil's podcatcher with a cron job to batch download the podcasts I listen to.

This morning, the output from the cron job reported

/usr/bin/podcatcher:1028:in `<': comparison of Time with nil failed (ArgumentError)

for each of the podcasts it attempted to download, and didn't download anything.

Something was obviously wrong. Here is an example of my call to podcatcher:

podcatcher -d /usr/local/podcasts --size 0 -H 2013.07.01 <URL of podcast RSS feed>

podcatcher is written in Ruby, a language I know nothing about, but a quick look at the relevant section of the code directed me to the votes file. podcatcher creates the votes file in the directory where you tell it to save the download (/usr/local/podcasts in my case).

The votes file looked like this:

---
ping-probability: 1.0
last-ping:
last-session: 2013-08-07 00:00:07.279195360 +10:00


Lines 1027-1028 of podcatcher look like this:

when 'last-ping'
     @data[key] = value unless @now<value


@now is the time at which podcatcher was invoked, so it was trying to compare a date value it thought should be against last-ping: with the current time. Since last-ping: was blank, it was throwing an error.

I copied the date/time from last-session: into last-ping:, and after that podcatcher was happy. Presumably the previous time I'd run the cron job, last-ping: had somehow ended up being updated with a null value.

I'm happy it was a easy fix, and wasn't the result of a ruby update rendering the code obsolete.
  • Current Music
    Bette Davis Eyes - Kim Carnes
penguin cartoon

Restoring hidden folders in Time Machine on MacOS X

We had a user who tried to set up iCloud address book syncing between their MacOS X laptop and their iPad. As you can imagine, they ended up syncing an empty address book (from iCloud), down onto their Mac. Fun fun...

Fortunately we had good Time Machine backups. Unfortunately the address book is in

~/Library/Application Support/AddressBook

and ~/Library is a hidden folder, and so doesn't show up in Time Machine.

The solution was:

  1. Log on as the administrator

  2. Open a Terminal

  3. Enter defaults write com.apple.Finder AppleShowAllFiles true and hit return.

  4. Enter killall Finder and hit return.


The invisible folders are now visible in the Finder and in Time Machine. After restoring the appropriate folder, I entered the following two lines into the Terminal to turn off display of hidden files/folders:
defaults write com.apple.Finder AppleShowAllFiles false
killall Finder
I did this as the administrator because it turns out that if you make ~/Library visible as the user, Time Machine can't open it to allow the user to perform their own restore. This is almost certainly a good thing :-)
  • Current Music
    Love Grows - Ralph McTell
penguin cartoon

Setting an environment variable from a value in an AD field using PowerShell

To cut a long story short; we store a value in the employeeid field in the AD, and needed to copy it into an environment variable so that various less-than-magic things could access it easily.

We're running a Windows Server 2008 R2 domain, with Windows 7 64-bit clients. There are various command-line tools that can extract this information from the AD, for example:
dsquery * -filter "(samaccountname=%username%)" -attr employeeid -l

does the job quite nicely. However there is no easy way to take the output from that command and attach it to a permanent environment variable. If you put it into a logon script, the variable only lasts as long as the script runs.

After a great deal of web searching, and putting together information from a number of sites, it turned out to be quite easy to get PowerShell to do the job. But since I didn't find this exact sequence of steps when I went looking, here it is to prevent the next person struggling with the vagaries of PowerShell.

Use group policy preferences to run the following PowerShell when the user logs on, and it will set the environment variable permanently (it will survive a logout or a reboot, for example).

The Powershell script


$samaccountname=$Env:username
$employeeid=(get-aduser -f {samaccountname -eq $samaccountname} -properties "employeeid").EmployeeID.ToString()
[Environment]::SetEnvironmentVariable("EMPLOYEE_ID", $employeeid, "User")
  • Current Music
    Time (Clock of The Heart) - Culture Club
penguin cartoon

"Fun" with the HTML5 <input> pattern attribute

We've been using the following code in a web form to ensure that a user's fax extension number is entered correctly (the initial value is populated by information from an LDAP lookup):

<input type="text" name="facsimiletelephonenumber"
value="<?php print $userData[facsimiletelephonenumber]; ?>"
size="5" maxlength="5" pattern="[5|7]{1}[0-9]{4}"
title="fax no. must be a 5-digit extension starting with 5 or 7" />

The pattern attribute is a wonderful addition to HTML5. It lets you use regular expressions (not a full implementation, but workable) to perform client-side verification of values in (some) form values.

In modern Firefox and Chrome, this is works a treat; if the user enters something that doesn't match a valid extension number, the browser outlines the text box in red, and won't let the user submit the form until they have corrected the entry. If you hit the "submit" button with an incorrect value in the text field, both browsers pop up a little balloon saying "Please match the requested format" along with the text of the "title" attribute.

This is fantastic. But then we get to Internet Explorer...

No version of IE prior to v.10 supports the pattern attribute (understandable), but with the advent of IE10 for Windows 7 I've been doing some testing before we push it out to all our users. The result...

IE10 supports the pattern attribute in a completely different way. It doesn't prevent the user from submitting a form with incorrect information. It would appear, instead, that it looks at the incorrect value when the "submit" button is clicked, says "that doesn't match the pattern", and discards the value in the field. So instead of preventing progress until the value is corrected (the behaviour I want), it passes an empty string through to the web server.

Argh!
  • Current Music
    "Whisky in the Jar" - Thin Lizzy
penguin cartoon

Enforcing new settings in Firefox 15

In a previous post I detailed how to enforce some settings in Firefox (it was version 10 at the time). We're about to push out Firefox 15 to our users, and have determined there are a few more settings we need to enforce.

lockPref("privacy.donottrackheader.enabled", true); - turns on the "do-no-track" header.

lockPref("toolkit.telemetry.enabled", false);
lockPref("toolkit.telemetry.prompted", 2); 
lockPref("toolkit.telemetry.rejected", true);


The above three lines stop Firefox asking about sending usage stats back to Mozilla, and turns off sending of such stats.

lockPref("browser.newtabpage.enabled", false); - forces new tabs to open up as blank tabs, rather than showing the user's most commonly accessed pages.