PostgreSQL automated daily backups

Filed under: Web/Tech | 2 Comments »

I needed to set up an automated backup of a Postgresql database on an Ubuntu Server 10.04 box and it took more Googling than should be necessary. I wanted to keep nightly snapshots for the past week which makes it a tiny bit more difficult than simply running pg_dump from a crontab. Here’s the one liner shell script I ended up with:

#!/bin/bash
pg_dump -U DBUSERNAME -b -F c -f "/path/to/backups/postgresql/`date +%w`.backup" MYDBNAME

Make sure to setup your .pgpass file if you haven’t already. Test it on the command line and if it’s all good just add it to your crontab file. I have mine running every morning at 2AM.

It’s a Big Ocean

Filed under: Personal | 1 Comment »

A project of mine that hits close to home has just just gone live. It’s a Big Ocean is documenting the human side of the 2010 BP Deepwater Horizon oil spill. We have interviews with fishermen, business owners, park rangers and more people directly affected by this disaster. Content will be posted as it becomes edited, but we have some teaser stuff up now.

What’s Twitterbot/0.1?

Filed under: Web/Tech | 1 Comment »

Some webmasters have seen HEAD requests with the User-Agent Twitterbot/0.1 hit their sites recently and as usual this causes a flurry of questions (I’ve never really cared too much about bots unless they hit hard, but some webmasters take it really seriously). I did some digging and the IP (128.242.241.134) that Twitterbot is using is from the same data center that Twitter is hosted. That’s unusual, most bots following URLs in Tweets come from Amazon EC2 or similar services. I did a little more digging and apparently links in DMs are also being followed which means it must be an official Twitter run bot. Now the question is what is Twitter doing with the data? Is it for analytics? Anti-spam?

Update: Looks like it may be in preparation for launching a URL shortener. I wonder if they will play hardball and rewrite existing links to use their own shortener? That would help future proof tweets for things like the Library of Congress, but would instantly screw Bit.ly and similar.

Update 6/9/10: Bing!

On Google Webmaster Tools site performance tips

Filed under: funny | 2 Comments »

Google Webmaster Tools is a great resource, but the site performance feature makes me chuckle from time to time. I checked how Crossword Tracker was doing and while the site runs really quickly (faster than 88% of sites according to Google), they had two tips. Unfortunately both are impossible…

It suggested that I serve Google Analytics hosted Javascript with gzip compression and that I could cut down on the number of DNS requests by serving the same JS from my domain. Great ideas guys.

Google Webmaster impossible performance tips

iPad claim chowder

Filed under: Apple | No Comments »

John Gruber in December on The Tablet:

One common prediction I disagree with is that The Tablet will simply be more or less an iPod Touch with a much bigger display. … If Apple’s starting with a hardware size where the iPhone OS can’t be used one-handed, then trust me, they’re designing a new interaction model.

Of course, it’s easy to be a pundit after the news breaks. Color me surprised that this was an evolution, not a revolution.

Crossword puzzle database, search engine, etc

Filed under: Python, Web/Tech | 1 Comment »

I’ve become a fan of crossword puzzles and recently started downloading a lot of them and processing them with Python. It was interesting itself (finding the most common answers and what not), but I decided to make a UI for it and create a site that lets you browse both crossword answers and clues, viewing what points to what and related data to both. You can search too, even if you don’t know all the letters. It’s pretty interesting and if you do crossword puzzles you should check out Crossword Tracker.

Impossible job postings

Filed under: Web/Tech, funny | No Comments »

A chuckle-worthy gig came up today on a Craigslist feed that I follow. Somehow I think working for this joker would be an excruciating experience (emphasis mine):

To apply, email your resume along with a link to your greatest Web Development project. Describe your responsibilities of that project and any additional information (looking for writing structure and literacy here). What makes you unique and different than other programmers and Web Developers? Your message will be deleted if this information is not contained in the body of the email. Limit your message to 250 characters or less. Thank you.

They should just cut email out of the process and only accept applications through Twitter. Or in haiku.

AT&T Wireless reverse number lookup

Filed under: Web/Tech | No Comments »

Craigslist never fails to amuse. What a couple they must be.

AT&T reverse phone number lookup

Percentage Django template tag

Filed under: Python | 1 Comment »

Here’s a handy template filter that calculates percentages inside Django templates.

@register.filter(name='percentage')
def percentage(fraction, population):
    try:
        return "%.2f%%" % ((float(fraction) / float(population)) * 100)
    except ValueError:
        return ''

Usage

There were {{ yes.count }} yes votes ({{ yes.count|percentage:votes.count }}) out of {{ votes.count }} responses.

Result

There were 40 yes votes (40%) out of 100 responses.

Constant Contact’s insane API downtime practice

Filed under: Rant, Web/Tech | 1 Comment »

Constant Contact is the leading email newsletter company and hundreds of thousands of businesses use their service to send marketing emails to customers. Constant Contact is a lot bigger than most people think, they are even a publicly traded company with a half billion dollar market cap. However, money can’t buy sanity.

Constant Contact is typically used through a web interface, but they do provide an API to allow some basic functions to be handled remotely. It’s a pretty limited API (you can’t even send email through it!), but that’s a rant for another day. All I’m using it for is adding contacts and basic list management. Simple stuff.

I’ve had a lot of problems with reliability in the past, but last night takes the cake. Constant Contact had a scheduled downtime for the API that resulted in all requests returning a 200 OK HTTP status code and an HTML page explaining the issue. If you tried to search for a contact, you got the page. If you tried to add a contact you got the page. Etc. But the 200 OK status code makes it look like the request was processed correctly and this HTML was the response (which should be XML if everything did go as planned). They’re using a browser error screen for API responses… Insane.

(more…)

Next Page »