Simon Willison’s Weblog

Subscribe
Atom feed

Blogmarks

Filters: Sorted by date

A Curious Course on Coroutines and Concurrency. David Beazley’s sequel to last year’s mind-expanding “Generator Tricks for System Programmers”, perfect for if you’ve ever puzzled over what exactly you can use Python’s generator-based coroutine support for.

# 24th April 2009, 10:58 am / concurrency, coroutines, david-beazley, generators, python

OAuth Security Advisory 2009.1. It’s a show-stopper: an attacker can start an OAuth permission request flow from a consumer site, then trick another user from the same site in to completing that flow and hence authorising the attacker to act on their behalf. A fix to the spec is forthcoming; in the meantime, don’t start an OAuth flow from an untrusted location.

# 23rd April 2009, 3:06 pm / ouath, security, sessionfixation

And Now For Something Entire... Oooh! Shiny! Alex Russell on O3D, the new 3D browser plugin from Google that makes OpenGL accessible to JavaScript (and embeds V8 so performance won’t suck even on slower browsers).

# 22nd April 2009, 12:19 pm / 3d, alex-russell, google, javascript, o3d, opengl, v8

Finding and fixing memory leaks in Python. Using Dozer, a clever piece of WSGI middleware which displays sparklines of Python object counts and allows you to introspect them, using the gc module under the hood.

# 22nd April 2009, 12:16 pm / amir-salihefendic, debugging, memory, memoryleaks, middleware, python, wsgi

Some Notes on Distributed Key Stores. Another ringing endorsement for Tokyo Cabinet, this time from Leonard Lin.

# 21st April 2009, 9:15 am / keyvaluepairs, leonard-lin, tokyocabinet

Inside the precision hack. How 4chan members subverted a Time.com online poll to reorder the options and spell out their own message. Partly poor application design from Time (the first version used a GET request without input validation), but I challenge anyone to design an anonymous online poll that can’t be fixed using the more sophisticated techniques 4chan eventually deployed based on HTTP proxies.

# 20th April 2009, 8:36 pm / 4chan, polls, security

pubsubhubbub. From Brad Fitzpatrick, a simple but clever way of using web hooks (HTTP callbacks) to inform subscribers that an Atom feed has updated in almost real-time—solving the constant polling problem and making it easier for small sites to offer publish-subscribe APIs. Any Atom feed can delegate subscriber updates to a “hub” server. An example hub server implementation is provided running on App Engine.

# 20th April 2009, 6:49 pm / atom, brad-fitzpatrick, google-app-engine, pubsub, pubsubhubbub, python, realtime, webhooks

peeping into memcached. “Peep uses ptrace to freeze a running memcached server, dump the internal key metadata, and return the server to a running state”—you can then load the resulting data in to MySQL using LOAD LOCAL INFILE and analyse it using standard SQL queries.

# 20th April 2009, 6:35 pm / evanweaver, introspection, memcached, mysql, peep, performance, scaling, sql, twitter

Phusion Passenger for nginx. Passenger (aka mod_rails / mod_rack) enables easy deployment of Rails and Ruby apps under Apache... and the latest version adds support for nginx as well. It works as an HTTP proxy and process manager, spawning worker processes and forwarding HTTP requests to them via a request queue. It can also handle Python WSGI applications—anyone tried it out for that yet?

# 20th April 2009, 4:53 am / apache, deployment, nginx, passenger, python, rails, ruby

Sign in with Twitter. Intriguing: Twitter are now an OpenID-style identity provider... using OAuth.

# 20th April 2009, 4:10 am / oauth, openid, twitter

Haystack (via) A brand new modular search plugin for Django, by Daniel Lindsley. The interface is modelled after the Django ORM (complete with declarative classes for defining your search schema) and it ships with backends for both Solr and pure-python Whoosh, with more on the way. Excellent documentation.

# 17th April 2009, 9:53 pm / daniel-lindsley, django, haystack, orm, python, search, solr, whoosh

Paul Buchheit: Make your site faster and cheaper to operate in one easy step. Paul promotes gzip encoding using nginx as a proxy, and mentions that FriendFeed use a “custom, epoll-based python server” as their application server. Does that mean that they’re serving their real-time comet feeds directly from Python?

# 17th April 2009, 5:19 pm / comet, epoll, friendfeed, gzip, nginx, paul-buchheit, python

Drop ACID and think about data. I’ve been very impressed with the quality and speed with which the PyCon 2009 videos have been published. Here’s Bob Ippolito on distributed databases and key/value stores.

# 17th April 2009, 5:13 pm / acid, bob-ippolito, data, databases, pycon, pycon2009, python

Installing CouchDB from source on OS X. So far I’ve just been playing with it in an Ubuntu virtual machine.

# 17th April 2009, 4:22 pm / building, couchdb, macos, ubuntu

Cross Browser Base64 Encoded Images Embedded in HTML (via) Scarily clever. View the PHP source to see what’s going on—most browsers get image tags that use data URIs starting with data:image/png;base64, but IE gets served a Content-type:message/rfc822 header and a MIME formatted multipart/related document, as used by e-mail clients to embed inline image attachments.

# 17th April 2009, 4:12 pm / base64, browsers, hedger-wang, internet-explorer, mime, php

Developing Django apps with zc.buildout. Jacob went ahead and actually documented one of Python’s myriad of packaging options.

# 16th April 2009, 9:50 am / jacob-kaplan-moss, packaging, python, zcbuildout

(Yet) Another DiggBar Update. Digg are responding in exactly the right way in my opinion—the DiggBar will start returning 301 redirects for anonymous users, while users who are logged in to Digg can opt-out of the feature if they want to (usage statistics show that most Digg users are fine with the feature).

# 16th April 2009, 12:50 am / digg, diggbar, redirects, urls

10 Cool Things We’ll Be Able To Do Once IE6 Is Dead. Highlights include child and attribute selectors, 24bit PNGs and max-width and min-width. Simple pleasures, but I can hardly wait.

# 15th April 2009, 2:17 pm / brothercake, browsers, css, ie6, maxwidth, minwidth, pngs, selectors, standards

London’s abandoned Underground Stations on Google Street View. “The network is littered with buildings that belonged to stations that closed their doors to the public because routes were changed and diverted, or because there was just too little traffic to make them viable. Here are some of the remnants of disused Underground stations that you can see on Google’s Street View of London.”

# 14th April 2009, 2:51 pm / google, london, martin-belam, streetview, underground

Counting the ways that rev=“canonical” hurts the Web. Mark Nottingham complains about misapplied trust (a page can falsely claim to be the canonical URL for another page), the easy confusion between rev and rel and the lack of discussion with relevant communities.

# 14th April 2009, 2:11 pm / mark-nottingham, revcanonical, standards, urls

Reducing XSS by way of Automatic Context-Aware Escaping in Template Systems (via) The Google Online Security Blog reminds us that simply HTML-escaping everything isn’t enough—the type of escaping needed depends on the current markup context, for example variables inside JavaScript blocks should be escaped differently. Google’s open source Ctemplate library uses an HTML parser to keep track of the current context and apply the correct escaping function automatically.

# 14th April 2009, 9:26 am / ctemplate, django, escaping, google, html, open-source, security, xss

Visualising Sorting Algorithms. Aldo Cortesi dislikes animations of sorting algorithms, so he designed a beautiful technique for statically visualising them instead (using Python and Cairo to generate the images).

# 14th April 2009, 8:55 am / aldo-cortesi, algorithms, cairo, python, sorting, visualisation

Amazon Says Listing Problem Was an Error, Not a Hack (via) “A friend within the company told him that someone working on Amazon’s French site mistagged a number of keyword categories, including the ’Gay and Lesbian’ category, as pornographic, using what’s known internally as the Browse Nodes tool. Soon the mistake affected Amazon sites worldwide.”

# 14th April 2009, 8:32 am / amazon, amazonfail, csrf, security

tinyarchive.org. Blaine Cook’s archive of 301 and 302 redirects—needs to be automatically updated by a crawler for it to be really useful though.

# 13th April 2009, 9:57 pm / archive, tinyarchive, tinyurls, urls

How to cause moral outrage from the entire Internet in ten lines of code. Looks legit—the author claims to have sparked this weekend’s #amazonfail moral outrage (where Amazon where accused of removing Gay and Lesbian books from their best seller rankings) by exploiting a CSRF hole in Amazon’s “report as inappropriate” feature to trigger automatic takedowns. EDIT: His claim is disputed elsewhere (see comments)

# 13th April 2009, 7:48 pm / amazon, amazonfail, csrf, prdisaster, security

favikon.com. Small, easy to use online favicon generator.

# 13th April 2009, 12:09 pm / favicons, favikon

I like rev=“canonical”. Les Orchard summarises the current debate over what colour to paint the rev=“canonical” bikeshed.

# 13th April 2009, 10:41 am / les-orchard, revcanonical, urls

django-shorturls. Jacob took my self-admittedly shonky shorter URL code and turned it in to a proper reusable Django application.

# 13th April 2009, 9:31 am / django, djangoshorturls, jacob-kaplan-moss, python, revcanonical

17-year-old claims responsibility for Twitter worm. It was a text book XSS attack—the URL on the user profile wasn’t properly escaped, allowing an attacker to insert a script element linking out to externally hosted JavaScript which then used Ajax to steal any logged-in user’s anti-CSRF token and use it to self-replicate in to their profile.

# 12th April 2009, 7:22 pm / csrf, security, twitter, worms, xss

Years

Tags