The free TLS certificate provider Let’s Encrypt automates the request-and-setup process using the ACME protocol to verify domain ownership. Software on your server creates a file in a known location, based on your request. The certificate authority checks that location, and if it finds a match to your request, it will grant the certificate. (You can also validate it using a DNS record, but not all implementations provide that. DreamHost, for instance, only uses the file-on-your-server method.)

That makes it really simple for a site that you want to run over HTTPS.

Redirected sites are trickier. If you redirect all traffic from Site A to Site B, Let’s Encrypt won’t find A’s keys on B, so it won’t issue (or renew!) the cert. You need to make an exception for that path.

On the Let’s Encrypt forums, jmorahan suggests this for Apache:


RedirectMatch 301 ^(?!/\.well-known/acme-challenge/).* https://example.com$0

That didn’t quite work for me since I wanted a bit more customization. So I used mod_rewrite instead. My rules are a little more complicated (see below), but the relevant part boils down to this:


RewriteEngine On
RewriteBase /

# Redirect all hits except for Let's Encrypt's ACME Challenge verification to example.com
RewriteCond %{REQUEST_URI} !^.well-known/acme-challenge
RewriteRule ^(.*) https://example.com/$1 [R=301,L]

These rules can go in your server config file if you run your own server, or the .htaccess for the domain if you don’t.

Continue reading

Ah, memories! These days, setting up hardware on Linux is often easier than it is in Windows. Lots of drivers are built-in and auto-detected, and many are provided through a distribution channel that makes it almost as easy.

Wireless networking, however, is a bit of a throwback to the old days. Half the hardware doesn’t have Linux drivers, and half of the devices that do require you to hunt for the driver — based on the chipset, of course, not on the name or model number on the box — and compile it yourself. (At least these days, you can sometimes run a tool to adapt the Windows drivers if there’s no native Linux option.)

The steps I actually needed to take to set up wifi on my Fedora 13 desktop probably only amounted to about 10 minutes. Unfortunately it took a lot of false starts to get there. I had installed a Zonet ZEW1642 PCI card, which my initial research suggested would be supported by the built-in rt2860 drivers. As it turned out, it wasn’t that simple. Continue reading

A few months ago, my phone stopped syncing contacts and messages (including missed-call and voice mail notices!) after I installed a new app. Email and text messages flooded in the moment I uninstalled it. At the time, I figured it could be the app, or it could simply be that the phone doesn’t sync if it’s low on space.

Now I know: It’s the lack of space.

Last night I updated Gesture Search, which pushed the phone into low-space territory. I figured I’d deal with it later. This morning, I noticed that it wasn’t reporting new messages on Gmail. Reluctant to uninstall any more apps, I followed Katie’s suggestion of clearing out old text messages…and freed up 1.5 MB. (I figure it’s the pictures. They’d better be worth 1,000 words, because they take up a lot more disk space.) A few seconds later, the @ popped into the notification bar.

You’d think that 7+ MB would be plenty of room to download email and text messages, or tell the notification system to pop up a new icon. As near as I can tell, though, if the “Low on Space” icon is visible, Android won’t sync anything.

Next time, I’ll make a point of cleaning things up quickly.

With luck, this won’t be a problem with my next phone. (Yeah, I’m still on the G1.) Whether I go for a Samsung Vibrant, a G2, or something else, it should have more storage on the phone and the ability to install apps to the SD card.

The Social Homes plugin for WordPress displays a list of icons linking to your various social networking profiles* as a sidebar widget. When you update your list of sites, it calls out and automatically detects the location of each icon.

Unfortunately, the detection doesn’t work on LinkedIn, leaving your blog with a broken image, empty square or text label, depending on the visitor’s web browser. The plugin developer is aware of the issue, but several months have gone by with no fix.

So I’ve fixed it. Here’s how you can fix it on your blog.

Technical Details

First, some background. The problem is that Social Homes is expecting to see this pattern:

<link rel="shortcut icon" href="/path-to-icon">

But LinkedIn is using this equally valid pattern:

<link href="/path-to-icon" rel="shortcut icon">

This would be okay if it simply failed to find the icon, because it would fall back to /favicon.ico … which happens to be correct for LinkedIn. Instead it’s skipping past the end of the tag and picking up the next reference, which is currently a stylesheet.

The Fix

The simplest fix** is to just make sure it stops at the end of the tag, and let it fall back to favicon.ico.

Here’s what to do. Open up social-homes.php and look for the section titled, “Social Homes service parser.” The function you want is called widget_socialhomes_parse_service

Look for the section labeled, “grab the favicon” and find these two lines:

$tmpIcon1 = split('"shortcut icon"', $contents);
$tmpIcon2 = split('href="', $tmpIcon1[0]);

Add the middle line below, and change tmpIcon1[1] to tmpIcon1a[1] in what’s now the third line:

$tmpIcon1 = split('"shortcut icon"', $contents);
$tmpIcon1a = split('>', $tmpIcon1[1]);
$tmpIcon2 = split('href="', $tmpIcon1a[0]);

That’s it! All you have to do now is go back into your Widgets config, open up the Social Homes widget, and re-save it!

*Technically, you can link to any website, whether it’s a social networking profile or not, but that’s the original intent.

**A more proper fix would be to change the way Social Homes looks for the icon so that it doesn’t depend on the link attributes being in the same order, but this is a simpler change.

Sometime last week I noticed that I hadn’t received some alerts sent by text message to my phone. I figured it was probably a transient problem with the email-to-SMS gateway and didn’t think much more of it. Then on Sunday I added a contact to my address book in Gmail, and it still hadn’t synced to my phone a half-hour later. Again, I figured it was just a hiccup.

Yesterday, some more email-to-SMS texts vanished into the ether. I figured something must be up with the gateway, so I changed the alerts so that they would also send to my Gmail account, figuring that if the text messages failed, I’d still get a notice.

They didn’t show up either.

That’s when I realized that nothing on the phone was actually syncing: Not Gmail, not the contacts, not the calendar…and it just wasn’t receiving text messages at all.

I tried turning sync off and back on, manually syncing, restarting the phone (both a hard reset cycling the power and a soft reset, sort of the Ctrl-Alt-Delete equivalent using the green, red and menu buttons together), even clearing all the local data for Gmail, Gmail storage, and Calendar storage.

Well, none of that worked. It marked all the apps for syncing, but wouldn’t actually start.

So it was time to backtrack: What had I changed recently?

Well, I’d updated several apps. Off the top of my head I could think of Twidroid Pro and the Weather Channel, but I couldn’t remember what else.

I’d also installed a new app, Layar, an augmented reality app which I’d seen in an ad for some other phone last week, but hadn’t actually gotten around to trying out. Adding it triggered a low space warning, but the phone still had 6.8 MB free, which ought to have been plenty.

Curiously enough, the last successful sync was right around the time that I installed Layar. Hmm…

Okay, what the heck. I uninstalled it. Within seconds, the phone bleeped and picked up the test messages I’d sent to Gmail. Within a minute, several text messages arrived, including my test from this morning and two alerts from last night.

Well, that was certainly suspicious.

So I installed it again, and this time actually opened the app to try it out (making it display the location of pizza places as seen from my desk), and sent myself a test message at Gmail. I can’t say I was surprised when the test message showed up on my desktop, but not on my phone, even when I manually refreshed my inbox in Gmail. Within a minute of uninstalling the app again, the message showed up.

So, no Layar for me. I don’t know if it doesn’t work with the G1, with Android 1.6, or with something else I have on the phone…or if it’s not Layar at all, and the phone just needs more space to sync.

The message is clear, though: If your phone stops syncing, or stops receiving text messages, look at what’s changed. There’s a good chance that the problem is related.

Update: It’s been about half an hour, and the voice mail notice just popped up…for a couple of messages I received on Sunday! It looks like the problem was blocking everything that used the standard sync/notify system on the phone. Twidroid was working, so I guess it must use its own system.

Update 2: I’ve confirmed that it’s just the low space, not the particular app, that causes the problem.