Facebook Questions? Gone!

The Problem

If you use Facebook regularly, you've probably noticed that your news feed has recently been cluttered with "questions" being answered by your friends. These "questions" are like a new type of status update - they merge seamlessly into your feed, and are not an "application" so can't be hidden except on an individual basis.

The Solution

As it turns out, the "question" posts have a unique class which can be used to target CSS rules to them. Using a CSS one-liner in conjunction with a browser extension such as Stylish to inject it into Facebook pages, you can hide all "question" posts from your news feed! Just follow the steps below:

  • Install Stylish (or an alternative extension which allows injecting custom CSS into specific websites) - for Firefox or for Chrome
  • Go to the FB Question Hider userstyle page and click the "Install" button
  • Go back to Facebook and refresh the page, then browse without your feed being cluttered with "questions"

Wibbly-Wobbly, Timey-Wimey Stuff

JavaScript's Date object is pretty useless for all but the most basic of tasks, as it doesn't allow for conversion between timezones - or for proper display of a raw date with no concern over timezone. Your options are to output it in the user's timezone or to use the very limited set of UTC functions; these just don't cut the mustard sometimes.

Faced with one of those cases where the Date object doesn't do as needed, I wrote a new function: Date.toUTCDateString(). It does as it says on the tin - it ouputs the UTC date as a string, in the same format as Date.toDateString() does. It's a bit of a dirty hack, as it uses a second temporary Date object internally to generate the output - but I felt that it was better to do that than use arrays for day and month names...

Without further ado, here's the function:

Date.prototype.toUTCDateString = function() { var utc = new Date(); utc.setFullYear(this.getUTCFullYear()); utc.setMonth(this.getUTCMonth()); utc.setDate(this.getUTCDate()); return utc.toDateString(); }

Please feel free to use this, as it stands or as a base for either an improved version or ...

More Motorola Madness

As should already be clear to anyone who's been keeping up with the Motorola situation, Motorola failed to meet (or even acknowledge) my recent challenge to them. They have, however, been releasing brief snippets purporting to be information on features in the promised Froyo update for the Milestone A853.

The third of these posts states that the update will support "the storage of apps on the SD card through the download of a free app." One commenter on their Facebook discussion boards asks, "since when do you need a certain app for the Apps2SD-feature in Froyo?"

That's a very good question, since neither the initial Apps2SD implementations in custom ROMs nor the offical Froyo-and-beyond storage of apps on the SD card have ever required an app to work; the former was done by tricking Android into using a partition on the SD card as if it were a folder on the internal storage, and the latter is embedded within the Android framework.

If Motorola have for some reason opted to disable the "real" Apps2SD feature in Froyo and instead implement some kind of bizarre standalone Apps2SD through an app, I could see why they've taken so long ...

Motorola Europe, I Challenge Thee

I hereby issue a challenge to Motorola Europe:
Show that you love your customers this Valentine's Day by unlocking our bootloaders. Start with the Milestone A853, as we've been waiting the longest, and then work your way through all the phones you've abandoned already, followed by those which you still claim to support at present.

I believe that, given an unlocked bootloader, the community could do what you say you couldn't, and get at least 2.1 (probably 2.2 or 2.3) running nicely on the CLIQ XT MB501 - along with updates for the other phones you've abandoned.

If you can't/won't support the phones you make and sell, at least let the community try to support them for you - there's a willing and able community out there, but you prevent them from making your phones live up to their true potential by preventing them from providing the support/updates that you don't.

Note: This challenge has also been posted on the Motorola Europe Facebook discussion pages, and the Motorola Europe Facebook wall. I'm reposting it here in the hopes that the more public I can make it (i ...

Windows file sharing stupidity

A couple of months back, I did a nice fresh installation of Ubuntu 10.10 on my laptop - on a shiny new Seagate Momentus XT drive. All was well, and I could connect to my Windows machine's file shares just fine.

Fast forward to today. I hadn't tried connecting to the Windows file shares for a while, but wanted to grab something off my desktop machine. No matter what I tried, I couldn't get the laptop to connect to the Windows machine's file shares. I ended up attempting to manually invoke smbclient, with the debug flag set to maximum debug level, in the hopes that it would shed some light on the situation. The best that I got from that was these two lines:

SPNEGO login failed: Invalid parameter
session setup failed: SUCCESS - 0

which didn't really shed much light on it.

A bit of googling around found a few people who'd done the same thing to debug smbclient connection failures, but they mostly turned out to be trying to create null connections (no user/pass - not even the "guest" user), which Windows doesn't like. Then, I managed to find this post, which ...

Ubuntu 10.10 and laptop touchpads

After several iterations of not getting around to upgrading Ubuntu, and subsequently deciding that I may as well wait for the next version as it's nearly here now, I finally upgraded to Ubuntu 10.10 this week.

All was going well, until I tried to play Minecraft. I couldn't be bothered finding a mouse, so I was going to play using my laptop's touchpad. At first, it seemed to be working fine - but then everything was very jumpy, with my touchpad input seemingly freezing up and then jumping around. I figured it must be either lag or something wrong with the version of Java I was using, but then, on a whim, plugged a mouse in. The mouse worked fine.

I didn't think much of it at first, thinking that it's not a huge deal if it's just Minecraft - I can use a mouse for that. Then I noticed that it was happening everywhere - even on the desktop. I wondered if there was something wrong with the touchpad driver, causing it to lock up whenever there was keyboard input, but soon discovered the real culprit - a new setting, and its default value.

To fix ...

Cisco.com's lost a letter...

And by a letter, I don't mean a single character - I mean all instances of the lower-case letter "t" in the HTML source of the site.  This includes all HTML tags and their attributes (names and values) - leaving the site without styles and javascript:

Here's the top of the page:

Update: Cisco seem to have fixed the issue - whatever it was.

Android issue 8636 workarounds

If you've found this post, chances are you're suffering from Android issue 8636 - you're trying to add a Google Account to your Android device, but you're receiving an error stating "Can't establish a reliable data connection to the server" every time you attempt to add it.

There are several suggested fixes or workarounds for this issue - but many don't work, and the main one involves performing a hard reset, which wipes your data... and doesn't always seem to help. This post aims to compile workarounds, since Google doesn't seem to want to acknowledge the issue and resolve the underlying problem.

The YouTube Workaround
This is the most recent workaround I've come across. It also seems to perhaps be the most reliable workaround, and has no negative side-effects. I have personally used this workaround successfully.

  1. Go to youtube.com and sign up for a new account, using the email address you want to add to your phone
  2. Open the YouTube app on your phone, sign out of your account if you're currently signed in (menu button -> sign out)
  3. Sign in - menu button -> my account, log in with your EMAIL ADDRESS (not ...

Smoothwall, cbq.init and bugs

I've recently been attempting to get per-IP ratelimiting implemented on a Smoothwall Express 3.0 box, with very limited (if you'll excuse the pun) success. The stock SWE3 kernel is lacking many things which are needed for such ratelimiting, so I had to resort to setting up a virtual machine with the development version of smoothwall and compiling a new kernel and a bunch of modules for myself - more on that later, probably.

Once I got the kernel and modules sorted, I discovered that cbq.init (version 0.7.3), the script I intended to use to perform the ratelimiting, has a bug in it - one which prevents it from working at all. After making a couple of minor adjustments to the script, it works quite well. For future reference, the "-maxdepth 1" arguments on lines 579 and 585 need to be moved up to just after the $1 in the previous lines.

The error in question was repeated once for each config file in /etc/sysconfig/cbq, and read as follows:
find: warning: you have specified the -maxdepth option after a non-option argument (, but options are not positional (-maxdepth affects tests specified before it as well as ...

Xen swap issues

Note: This is mostly for my own future reference, but I thought I'd post it here in case somebody else might find it useful.

The Problem
Some of my websites (such as ShrinkThisLink, the free link shrinker) run on a Debian VPS, running on Xen.  It had a swap partition configured, but was not using it, and didn't seem to want to.  I found that different methods of getting partition information seemed to be returning conflicting information:

  • the VPS control panel stated that /dev/sda1 was a 1GB swap partition, and that /dev/sda2 was a 5GB ext3 partition
  • `fdisk -l` seemed to agree with the VPS control panel, but added that each drive "doesn't contain a valid partition table"
  • parted also seemed to agree with the VPS control panel
  • `df -h` listed /etc/sda1 as mounted on / and being 5GB
  • /etc/fstab listed /dev/sda1 as a 5GB ext3 partition to mount on /
  • `swapon -a`was returning "swapon: /dev/sda2: Invalid argument" - which seemed to state that /dev/sda2 was the swap partition

So, of those I tried, three methods suggested that sda1 was swap; three methods suggested that sda2 was swap.  With it being a ...