Stavros' Stuff

Angry rants of programming and other things.

How PostgreSQL's SR (Streaming Replication) works

Recently, I have come upon the need to deploy a high-availability/performance postgres cluster, and I looked into various replication solutions. Of the ones I saw, Streaming Replication was the easiest to set up, fairly performant and a good fit for what we wanted to do, and it’s built into postgres 9.0+.

Unfortunately, checking the documentation and howtos, I gained little insight into how it works. There are plenty of detailed guides on how to set it up, but none explain how exactly it works, so it was a bit of a black box for me. Fortunately, the guys in #postgresql are extremely helpful, and quickly explained to me the specifics of replication, which I am going to post here for

Continue reading…

App Engine pricing changes revisited

As anyone who knows me will already have noticed, I’m a quite an outspoken proponent of Google AppEngine. Many of my projects nowadays run on GAE, including this very blog, as I love the ease of deployment, the provided services and low cost. I decided to migrate this blog to it from a VPS after many troubles with Drupal (lack of customizability, security problems, etc). It didn’t help that it get

Continue reading…

Secrets of Power Negotiating

A few weeks ago I was recommended Roger Dawson’s Secrets of Power Negotiating, and decided to give it a try. I was pleasantly surprised to find that it is full of practical tips and helpful pointers about negotiations of every type, be it salary increases, house purchases, and even negotiations between countries (especially helpful if you’re eyeing some islands in the middle of the atlantic).

What I especially liked about this book is that it contains useful information, examples and techniques without veering into the all-too-familiar territory of most self-help books nowadays, which is to inundate the reader with a series of irrelevant or inapplicable anecdotes about how people who used technique X became rich and handsome.

Continue reading…

Book clouds

As someone who is on the road a lot, I frequently have a lot of downtime during road trips. I don’t like driving, because it’s mostly wasted time, so I thought I would do something useful while driving. Unfortunately, about the only useful thing you can do while driving is listen to music, but there’s something better: Audiobooks.

Audiobooks are a fantastic way to read (or, well, listen to) books on the road, and it’s largely made long car trips bearable, if not desirable. On the last trip, I decided I would listen to some Lovecraft, as I enjoy his writing and the genre of horror in general, so I loaded “At the Mountains of Madness” on my mobile phone and off I went. While listening, however, I was struck by his frequent use of words like “terrible”, “horrible” etc. I know he’s trying to convey a sense of foreboding, but, come on, Howard, not every rock has to be grotesque.

Continue reading…

Blog migration

The old blog software was showing its age, so I decided to write a few lines of code and move the blog over to Google App Engine. Most things should work properly, but if you notice any broken links please let me know by emailing me on the address on the “About me” page.


Continue reading…

Πρόγραμμα καταχώρησης αποδείξεων

Note: Apologies to non-Greek readers, this post is not for you.

Πριν μερικές μέρες είχα την ιδέα να φτιάξω ένα πρόγραμμα καταχώρησης αποδείξεων. Μια μικρή έρευνα έδειξε ότι ήδη υπάρχουν αρκετά τέτοια προγράμματα, αλλά κανένα δεν ήταν αρκετά εύχρηστο, και μου φάνηκε αρκετά καλή ιδέα για να μάθω λίγα πράγματα για το Django στο AppEngine.

Οπότε, δύο μέρες αργότερα, είναι

Continue reading…

My Y Combinator interview.

As many of you will know, for the past few months I’ve been working on the bookmark search engine startup I created, called historious. Shortly after creating it, I applied to Y Combinator because, well, it couldn’t hurt. I didn’t really think I’d get in, with all the thousands of people applying and their rather str

Continue reading…

How to finally understand how to use Unicode.

This post is not going to be long. It’s not going to have any examples, details, or anything of the sort. It will just teach you what Unicode is, how to use it, what an encoding is and what UTF-8 means (hint: it’s an encoding). If you sort-of, semi-understand what Unicode is, this should clarify everything.

Understanding Unicode is really simple. The first thing you need to know is that Unicode i

Continue reading…

How to extend the Django admin site with custom views

Often I find that I need to include administration views in my site, such as statistics, management, etc etc. When these are more than just model CRUD views, a good idea is to extend the builtin Django admin site, as it’s the easiest to do.

While looking at the docs, however, I realised they were a bit cryptic and lacked good examples. It didn’t take me long to figure out how to do it, but here’s

Continue reading…