Watching the Olympics Live on the Internet without Cable

So some of you who have “cut the cord” so to speak in the U.S., may not be able to access Olympic events. But do not fear there are still plenty of ways of to watch the events in their entirety without edits. To actually be able to stream video you’ll need a descent connection though. While you certainly can, I don’t recommend using anything from a free proxy list online for both speed and security reasons. It would be best if there was some sort of VPN or proxy provider that had servers in Great Britain. Because then you would be able to watch everything for free on BBC’s site. Fortunately for all of us this problem has been solved for a long time, but I figured I would write a guide for those who are less technically inclined.

First thing is you’re going to need a VPN or proxy provider. I’m going to recommend the guys over at Tunnelr. Here’s the main thing though. No matter who you use you need the server to reside in the U.K. Make sure you select a server that resides there when signing up otherwise this won’t work. You’ve been warned! If you’re using Tunnelr you only need the SSH plan, and that’s the one I’ll be demonstrating here. If you don’t know SSH very well but know how to configure a VPN, you can pay a couple extra bucks for full VPN access.

Once you have paid for access you’ll want to open your terminal program. On a Mac this is just the Terminal.app located in (/Applications/Utilities). After launching the program you’ll want to log into your provider’s server like so:

ssh username@serverhost -p 22 -C -N -D localhost:8080

Replace username with your username and server host with the server you signed up for. You’ll be prompted for your password as well. If you’re using Tunnelr they have a tutorial on how to do this as well. The only thing I added here was compression with the -C flag. This may not be super effective for video, but it can make page loading snappier, particularly when you’re half way around the world.

Next you need to setup to proxy your browser through this connection. I’m using Firefox of course, so I’m going to explain that here. If you’re not using Firefox you can just Google how to setup your browser of choice with a proxy. In Firefox open Preferences… and go to the Advanced tab. You’ll see something like “Configure how Firefox connects to the Internet” with a Settings button. Click that. Then click on the “Manual proxy configuration” radio button. In the HTTP proxy text field type “localhost” (no quotes), and for the Port use “8080” (also no quotes). Make sure the “SOCKS v5” radio button is checked and then hit “OK“.

At this point you can close out of your preferences and you should be good to go! To test you can go to:

http://www.bbc.co.uk/sport/olympics/2012/live-video

If you see a page that says “I’m sorry, we can’t show this content in your area.” then you didn’t do something correctly. Try going back through the steps again and if you still can’t get it to work you can try leaving a comment here (no promises). If you see a page like the one below then enjoy!

Image

NBC’s coverage is tits-up in my opinion (had to work in some British slang somewhere). The BBC did a significantly better job at covering the opening ceremonies and being able to watch online while you’re working next week or just hanging around somewhere absent of a TV is pretty sweet.

Memory Lane

This slideshow requires JavaScript.

Watched “Moneyball” recently and reminded me of the old days. For those that were there. We had some good times. Maybe we’ll all get together again sometime.

Google SSL Plugin

Today I got a bit sidetracked when I realized that Google doesn’t have an official search engine for Firefox that uses their SSL search. So I took an hour or so and created this search engine plugin for Firefox. I used the OpenSearch format so in theory this could work with other browsers if they support the standard. I haven’t found a way yet to import the XML as a search engine without serving the code via a web server yet(…lame I know). For a quick install you can click here. I would put the page here, but I can’t use the link to the file in the head element or javascript on WordPress.com.

One thing to note. Should you be getting blocked by a content filter, you can try altering references from https://encrypted.google.com to https://www.google.com. A friend pointed out some subtle difference between the two, but if you’re getting blocked on the domain then the latter is better than in the clear.

If you want to install this on Firefox Mobile you can scan this QR code:

Here’s the source code:

google-ssl-opensearch.xml

<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"
                       xmlns:moz="http://www.mozilla.org/2006/browser/search/">
  <!-- Created on Thu, 17 Nov 2011 19:13:07 GMT -->
  <ShortName>Google (SSL)</ShortName>
  <Description>Google search using SSL</Description>
  <Tags>google search ssl https</Tags>
  <Url type="text/html" method="get" template="https://encrypted.google.com/search?q={searchTerms}"/>
  <Image width="16" height="16">https://encrypted.google.com/favicon.ico</Image>
  <Developer>Xavier Stevens</Developer>
  <InputEncoding>UTF-8</InputEncoding>
  <OutputEncoding>UTF-8</OutputEncoding>
</OpenSearchDescription>

index.html

<!DOCTYPE html>
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<title>Google (SSL)</title>
	<meta name="author" content="Xavier Stevens">
	<!-- Date: 2011-11-17 -->
	<script language="javascript" type="text/javascript" src="google-ssl-plugin.js"></script>
	<link rel="search" type="application/opensearchdescription+xml" title="Google (SSL)" href="google-ssl-opensearch.xml"/>
</head>
<body>
	<span>For Firefox:</span>
	<ol>
		<li>Click on your search box dropdown</li>
		<li>Select "Add Google (SSL)"</li>
		<li>Click on your search box dropdown again</li>
		<li>Click on "Manage Search Engines..."</li>
		<li>Then select "Google (SSL)" (Optional)</li>
		<li>Click "Move Up" until it is the default (Optional)</li>
		<li>Click the "OK" button to save the order changes</li>
	</ol>
	<p>You can also try <a href="#" onclick="javascript:installSearchEngine()">clicking here</a> if the above doesn't work for you.</p>
</body>
</html>

google-ssl-plugin.js

function installSearchEngine() {
    if (window.external && ("AddSearchProvider" in window.external)) {
        // Firefox 2 and IE 7, OpenSearch
        window.external.AddSearchProvider((window.location.href).substr(0, (window.location.href).lastIndexOf('/') + 1) + "google-ssl-opensearch.xml");
    } else {
        // No search engine support (IE 6, Opera, etc).
        alert("No search engine support for OpenSearch plugins");
    }
}

Erase All Posts Tumblr Blog

A couple days ago I started thinking of revitalizing my Tumblr blog into something other than a link sharing farm. But if I was going to do this I wanted to get rid of all of that content first. Tumblr provides a “mass editor” but you have to check each item manually and if you have several thousand entries this isn’t feasible in a short amount of time. I also have two other Tumblr blogs, but this is main one. So I can’t delete it altogether without deleting my other blogs. I searched the interwebs to see if someone had written up something already, but to be honest I couldn’t find anything that actually worked.

I found some python libraries to simplify the task though. The main two worth mentioning that you’ll need are oauth2 and pyblr. After installing these, I then registered for an API key. Don’t think too hard about it. Most fields aren’t required when you’re registering an application. Make sure you request xAuth to be enabled because this is a “desktop application”. Then you can check out my python script I wrote to do the dirty work. Easy peasy! Enjoy your freshly cleaned Tumblr blog.

Here’s the python code:

import pyblr
import oauth2 as oauth
import urllib
import urlparse
import time

'''
!WITH PROPER CREDENTIALS THIS WILL ERASE ALL POSTS FROM THE GIVEN TUMBLR BLOG!

Use with caution and make sure you know what you're doing. That said this is 
probably the easiest way to delete all of your posts if you have thousands of 
posts. If you have less than that it might be easier for you to just use the 
mass editor in the Tumblr UI.

This requires you to get an API key from Tumblr and request xAuth access to 
be enabled.
'''
consumer_key = "YOUR_CONSUMER_KEY"
secret_key = "YOUR_SECRET_KEY"
username = "YOUR_EMAIL"
password = "YOUR_PASSWORD"
blog_name = "YOUR_BLOG.tumblr.com"

xauth_access_token_url = "https://www.tumblr.com/oauth/access_token"
request_token_url = "http://www.tumblr.com/oauth/request_token"
authorize_url = "http://www.tumblr.com/oauth/authorize"
access_token_url = "http://www.tumblr.com/oauth/access_token"

consumer = oauth.Consumer(consumer_key,secret_key)
client = oauth.Client(consumer)
client.add_credentials(username,password)
client.authorizations
params = {}
params["x_auth_username"] = username
params["x_auth_password"] = password
params["x_auth_mode"] = 'client_auth'

client.set_signature_method = oauth.SignatureMethod_HMAC_SHA1()
resp, content = client.request(xauth_access_token_url, method="POST", body=urllib.urlencode(params))
if resp['status'] != '200':
    raise Exception("Invalid response %s. => %s" % (resp['status'], content))

token_dict = dict(urlparse.parse_qsl(content))
access_token = oauth.Token(token_dict["oauth_token"], token_dict["oauth_token_secret"])

pyblr_client = pyblr.Pyblr(oauth.Client(consumer, access_token))
counter = 0
while True:
    try:
        posts = pyblr_client.posts(blog_name)
        if len(posts) == 0: break
        for p in posts["posts"]:
            pyblr_client.delete_post(blog_name, params={ "id" : p["id"] })
            counter += 1
    except ValueError, err:
        print "ERROR: %s" % (str(err))
        print "sleeping for 5 seconds before retrying"
        time.sleep(5)

print "Finished clearing blog: %s" % (blog_name)
print "Deleted %d posts" % (counter)

How to Mount a Samsung Galaxy Tab 10.1 on a Mac

I recently got a Samsung Galaxy Tab 10.1 from Mozilla to do some testing of our browser. The bonus of course is that I have a tablet I get to use everyday at no expense to me. So I quickly went into the market and started installing all of my usual apps that I normally have on my phone. This includes Amazon’s Kindle app. I’ve never actually bought anything from the Amazon store, but I have purchased a couple of books from O’Reilly before and I wanted to transfer those to my tablet.

So I innocently plugged in my tablet to my laptop via the provided USB cable. First thing that immediately jumped out at me is that my tablet wasn’t charging (WTF! Samsung). After a few choice words I had for that, I tried to get over it and just transfer my books. There’s no icon on my desktop. Hmmm…okay. Lets mess with the USB settings since my phone has different modes, maybe this does to. Nada. Now this is getting frustrating. Lets do a quick Google search to see if anyone has found an easy way around this that I’m not figuring out on my own. I saw two different things come up. One was download the Android File Transfer application. This seems unnecessary, but okay let me download this thing and see if it works. Nope. Really. Come to find out there is quite a number of people that have this issue. So then I came across a piece of information that if I turn on USB debugging (Applications->Development->USB Debugging), then I should be able to mount my tablet with the Android SDK tookit in Eclipse (in Eclipse Windows->Open Perspective->Other…->DDMS). Sure enough this actually works.

Being a developer who writes software everyday I can do this, but that isn’t really my point. Who’s the person over at Samsung decided this product should ship without this capability? Do you really expect the average user to go through this process? Because they most certainly will not. What they will do is return their tab and go buy an iPad 2. And when they plug it in, it’ll just work. When you plug a device into your USB port there is an expectation for it to do two things: 1) charge and 2) be automatically mounted as a storage device. The latter can also be done as a setting if it’s not the default, as long as it’s easy to find. I would think that this would be a non-issue to release as part of a software update. As far as Samsung is concerned, the sooner the better.

Mozilla Manifesto

This pretty much says it all. It’s the reason why I work for Mozilla. Haters would say I’ve drank the Kool-Aid, but the place lives and breathes by its founding principles.

We’ve had a hell of a week so far. The launch of Firefox 4.0 picked up speed yesterday and continues today. Since the official launch on Tuesday at 6 a.m. we’ve had a total of 20,419,820 downloads according to our super cool download stats page. I am humbled to be a part of it all and hopefully we’ll continue to provide a better future for all Internet users and not just ours.