Monthly Archives: June 2010

Moving the mouse with Python

I’ve been using KDE4 in Ubuntu, and I really like it – it’s slick, has everything I need, and it all seems to gel together pretty well. Yet, the power management is really starting to make me angry. I’ve turned all of it off, checked ps and other tools for any signs that it’s still running, and despite my efforts, my screens still turn black after 10 minutes unless mplayer is running. So, I decided to fix that using Python, which actually turns out to be pretty nifty. I got the original idea from here, and modified it to loop a bit. Here’s the result:

[gist id=454364]

This moves the mouse around just a tiny bit, and works well enough to watch flash video for extended periods of time. To kill it, just hit Ctrl-c. Thanks, Python!

Blocking Facebook’s Like Button with Squid

So, I read this story today, which says the following:

Even if someone is not a Facebook user or is not logged in, Facebook’s social plugins collect the address of the Web page being visited and the Internet address of the visitor as soon as the page is loaded–clicking on the Like button is not required. If enough sites participate, that permits Facebook to assemble a vast amount of data about Internet users’ browsing habits.

Well, that’s creepy. Even though I deleted my Facebook account, they’re still trying to collect information about me by embedding themselves in other websites. Well, that happens to be really easy to fix for my entire network running through a Squid proxy server:

# Facebook Like Button Denial
acl facebook dstdomain
acl facebook_like urlpath_regex -i ^\/plugins\/like\.php
deny_info error-facebook-like facebook_like
http_access deny facebook facebook_like

I also had to create this file in my error_directory: /usr/share/squid/errors/en/error-facebook-like

<p>This just in: <b>Facebook Sucks.</b></p>

Now, when I go to a site with a Like button on it, it looks like this:

But Kelsey can still get to her beloved Facebook directly! Thanks, Squid team.