Stavros' Stuff

Angry rants of programming and other things.

I took a picture: Hope

I took a picture: Hope

Hello! I took another photo! This time it’s rather dark, it’s a forest, at night, with an eerie light coming at the end of the path, through the fog. It has taught me three things:

  1. You don’t need many sophisticated adjustments to achieve most of the effects you will want to achieve. A few simple adjustments here and there can go a long way.
  2. I used to think that, when people said “I wanted to convey this specific feeling”, or “I wanted to achieve this objective with this piece”, it was bullshit. I see now that, oftentimes, you have a specific idea in mind and work towards it, as I did with this photo for the first time, for me.
  3. I shouldn’t dismiss mobile phones so easily. I didn’t have a camera with me at the time, and it was either “take the photo with the phone” or “don’t take it at all”, and I went with the former. It’s probably my favorite photo of mine so far, so you definitely won’t hear me dissing mobiles again. They can be very useful under specific circumstances (mostly when there’s a lot of light and you won’t need a large print).

In this post, I am going to show you the process from the initial, unedited copy, all the way to the final edit. Here’s the latter:

Let’s dive into the actual process, to see how it was created.

Continue reading…

Gweet: Messaging for your things

A message queue for the abhorrently named “Internet of Things”

As you may recall, I have hooked up various parts of my house to a computer so I can control them remotely. To do that, I have an HTTP server for which I open a port, and everything runs on this server, but what if I need to add another device? What if I need to have multiple devices listening for a command?

Having to open a port for each and every one of them, exposing them to the internet and configuring all this is a huge hassle, a security problem and very brittle. Wouldn’t it be much better if there were a centralized message queue where I could post messages and have an arbitrary number of devices read them?

It turns out, the excellent folks at

Continue reading…

I took a picture: Lethe & Seals

I took a picture: Lethe

WARNING: This post has nothing for anyone, it’s just me ranting about photography. Turn back now, you have been warned.

Apparently, photography is now a thing I like. It is also a thing I like a lot, so I have been doing it a lot. I’m not very good at it, but I’m blessed with not caring much about how good I am at a thing I like doing, which is apparently how you get good at things. I decided to write about photography-related things, even though I’m wildly unqualified, because I like having a sort of progression log.

A few days ago, I stumbled upon the ethereal photography of Darren Moore, and immediately fell in love. The outworldly appearance of his photographs

Continue reading…

iRotary - Part Three

Phone slam 3: The slammening

In part two of project iRotary, we actually got the phone to make calls, but we couldn’t talk or hear the other person. In this part, I promised you some hardcore microphone-to-headset action, and that’s exactly what I won’t deliver!

Instead, what I did was to procure the gorgeous phone you saw in the previous posts. That’s right! All this series so far has been a ruse! I didn’t have that phone to start with, I didn’t have it at all!

However, I do have it now, and I managed to enclose the Arduino in the actual phone. Let’s see how that happened.

Continue reading…

iRotary - Part Two

Working towards a phone I can slam

In part one of project iRotary, we got the Arduino to detect pulses from a rotary dial and turn them into a phone number, all in the name of turning this phone:

into a mobile phone I can use on the go. In part two, we will actually connect the Arduino to a GSM shield and place calls with the rotary dial like it’s 1993. I have seen the future, and it is the past. Read on for details!

Continue reading…

iRotary - Part One

Finally, a phone I can slam again!

Lately, my mobile phone (an HTC One) has become very slow. I think it’s mainly SwiftKey, which is slow like dog, but no matter. As a good consumerist, I must purchase a new phone. However, I am also an angry person, and I sorely miss the tactile sensation of slamming the phone on someone’s face.

Because of this, I decided to put my engineering degree to good use, and went out and bought a phone. Thus begins project iRotary, which aims to turn this:

Continue reading…

Netflix for the rest of us

OMG Netflix in Greece!

If you’re nothing like me, you watch a lot of shows and movies, which means you must have heard of the wonder that is Netflix. Tens of movies and shows, all ready to stream in high definition at a moment’s notice for a very cheap monthly fee, what’s not to love? Well, apart from the MPAA not letting them have a larger selection, and the MPAA not letting them work outside the US, not much!

There’s a bunch of services like Netflix that don’t work outside the US, which is an affront to my human rights and sense of entitlement, so I took it upon myself to make watching Netflix and listening to Pandora just a bit easier. To this end, I created a

Continue reading…

Calling single-argument methods in Django templates

No longer are your methods confined to bare calls!

One of my pet peeves when it comes to Django is that you can’t call methods that require arguments in templates. While this is fine most of the time, it does mean that you need to have one property or method per call you want to make, which sometimes gets very cumbersome.

I needed a way to define various dynamic permissions that are calculated at runtime (for irrelevant reasons, Django’s permissions framework wasn’t a good fit), and writing properties like can_register, can_add_tags, can_subscribe got tedious. These tended to be defined all over the place, rather than in one central spot, and it was hard to add more checks without cluttering the classes.

I would much prefer to have a single method (let’s call it can()) that accepted a string with the permission I wanted to check, and return True or False, depending. This is easy to do in the views, but templates would never be able to call it with an argument.

However, since Django can do dictionary-style attribute lookups, I could add a dictionary interface over the method, and allow

Continue reading…

Get a text when there's motion in your house

Who needs friends when you have an Arduino?

Like every person, I have a burning desire to know who’s in my house when I’m not. A few months ago, I decided that I had had enough of the uncertainty of my extradomicilial activities, and that I needed to do something about it. I realized that I had two options. The first option would be to hire someone to be in my house 24/7, but that would get a bit embarrassing when I wanted to watch reruns of Desperate Housewives. The other option would be a motion sensor that texts me when it detects motion.

Luckily, this proved really easy to do with an Arduino. All I needed to get was

Continue reading…

How to safely store your bitcoins

Keep your money close and your bitcoins closer

Let me tell you a story about how this fool and his money were soon parted. About a year ago, I added Bitcoin payments to Dead Man’s Switch, because it seems that people who want to send messages after their death are also the sort of people who don’t like using actual money.

One or two people decided to use that payment method, probably mostly because it was the only thing they could buy with their newly-mined bitcoins, and I was the proud owner of a whole bitcoin, worth about $20 at the time. However, storing it was a bit of a problem, as I would either have to trust a third party with it or use the official client, and store the entire multi-gigabyte blockchain on my computer.

You can probably see where this is going. I didn’t want to store a bunch of gigabytes for $20, so I left my coins on

Continue reading…