Archive for the 'English' Category

How lack of sleep turned my vision red (or: combating insomnia with science)

Saturday, October 22nd, 2011

If, like me, you tend to suffer from sleeplessness you will know it can be exhausting; being awake until the early morning, knowing the number of hours until the alarm buzzes is rapidly decreasing. Staying up late and waking up late might seem like a solution, but it only gets more exhausting. As it turns out, knowing the role a hormone named melatonin plays in your natural wake-sleep cycle enables you to take action to change some of your habits to induce better, more and healthier sleep.

Now, melatonin is the opposite of adrenaline. The latter has an effect of making you more aware, short-cutting the rational mind and switching back to your pre-historic instincts. Melatonin, however, is a hormone produced by the pineal gland somewhere in the middle of your brain and leads to calmness and sleepiness.

Normally, the production and re-uptake of melatonin is synchronous with sunset and sunrise. When the sun rises, the blue and to a lesser degree the green light (or more precisely, light with a wavelength above 530nm) on your retina will inhibit the production of melatonin. In the absence of such light, melatonin is produced and makes one sleepy.

Delayed inhibitation

Now, it is not as simple as stated above of course. For one, melatonin is produced from serotonin, a neurotransmitter that is associated with mood. Depression is caused by a lack of serotonin (in many cases because the serotonin re-uptake is too active or due to a lack of physical activity during the day), so it is no surprise that both insomnia and depression go hand in hand.

Some people also have a delayed inhibition, either by some internal cause but usually due to external light. Especially within IT, people tend to stay up late and sit behind their laptop screens. And guess what, these emit the green light inhibiting the production of melatonin!

Reprogramming the brain

There are various methods one could utilize to help the brain stay in sync with the day and night outside. In many countries, melatonin supplements can be bought (over the counter or in higher dosage with a prescription). Since melatonin is a hormone produced by the body, it is relatively safe to take synthesized melatonin from these supplements.

While these can be very effective (I have found very positive effects with a dosage of 3mg, although off-the-shelf dosage is usually around 0.1mg), there has been very little study regarding the long-term effects. Given that the role in the circadian rhythm is just one of many for melatonin, it might be wise to exercise some caution.

Reprogram your brain

A better and more natural way of resetting your biological rhythm is to pay attention to the light in your environment. This starts in the morning (yes, waking up properly is an important condition for a good nights rest). When you wake up, stare outside for 5 to 10 minutes and get a good dose of green light. This will reset your pineal gland, and stop the production of melatonin.

In winter, it might still be dark when you get up. In that case, you might want to consider getting a full-spectrum lamp, or at least a lamp that has as significant amount of greens and blues in its spectrum. Fluorescent lighting might also do the trick, but be aware that these normally produce very narrow spikes in the visible spectrum on the green, blue and red wavelengths and might therefore be less effective.

Software to make you sleep better

In the evening, a good start is to do the inverse: dim the light, use incandescent light which tends to lack greens and blues. But also take a look at your computer or laptop screen. This is a very rich source of green and blue light, so staying up late behind your laptop will inhibit the onset of melatonin production and delay your sleepiness.

One, quite ridiculous, suggestion is to stop working on your laptop an hour before you plan to get to sleep. I know, it’s heretic. Luckily, we can be a bit smarter about it by simply reducing the green and blue emitted from the screen!

Until recently I used the compiz compositing window manager for the sole reason that it let’s me apply a rendering function to my screen. Rendering functions are transformations applied within your graphics card that combine the red, green, blue and alpha value your software draws on the screen into the output you see.

Compiz has a ‘color filter’ plugin, which can be used to apply a rendering filter. I wrote a simple rendering function (in GPU assembly) that averages the red, green and blue channels and then writes this average to the red channel (leaving the blue and green channel dark). This has the effect of making your desktop monochrome, like a black-and-white tv but with red light instead of white.

This worked wonders. Next to dimming the roomlights in the evening, switching to this red view had a great effect on my ability to fall asleep.

But, recently I switched to xmonad; is a much more rudimentary and efficient window manager. It does support compositing somewhat, but only for useless effects such as transparent terminal backgrounds.

After discussing the matter at my hackerspace, I was put onto the path forward. To start with, one can use gamma correction to color-shift the image on the screen. This is a tedious process though, and getting it right requires some insight in how gamma-values actually influence color.

Luckily, there is software that takes care of all of that. The first I tried was f.lux, but it wasn’t optimal. For one, it was not open source, you could only get a binary. But more annoying, I tend to have at least 2 monitors and f.lux only works on one. So while my laptop screen would redshift, my external screen wouldn’t and the effect would be ruined.

But a bit of additional research led me to redshift. This is open-source and available in most linux distributions (for eg., apt-get install redshift in debian, or apt-get install gtk-redshift to get the applet as well).

I start it after I log in to an X session  (a windows version is available as well) and tell it where I am (by specifying latitude and longitude). It then knows when sunset and sunrise take place, and starts shifting the color of my display in small steps towards less green and blue and more red in the evening and back to the normal whiteness again in the morning.

Note that your phone also is a source of melatonin-production-inhibiting light. If, like me, you tend to check some rss feeds and maybe twitter in bed before you close your eyes, consider using something to redshift your phone display in the evening. Personally, I use an android phone with Cyanogenmod. This aftermarket firmware for your android phone already contains something called ‘rendering effects’. I placed a widget on my home screen that lets me choose between normal and ‘monochrome red’.

Good night, sleep well

The body is an intriguing complex of interacting processes, and while the above tends to work out really well it is not the panacea of sleep problems. There are many other interactions that may interfere with your ability to get a good healthy night of sleep.

For example, depression is known to cause a lack of serotonin and therefore may lead to decreased melatonin production. However, an unhealthy sleep rhythm (not in sync with planetary movement) has again a catalytic effect on depression.

I found that the above techniques (look into the light in the morning, redshift in the evening) greatly increased my ability to sleep at the right times and long enough, and be awake during the day without having to rely on stimulants. I feel more energetic and migraine has become a rare event as opposed to a weekly recurring disaster.

Your mileage may, of course, vary. But just give it a try. And let me know!

Ps: if you use caffeine to wake up in the morning or stay up late, disregard the above entirely; your circadian rhythm is too fucked up and the effects of my advice will likely be unnoticeable.

Flattr this

PostgreSQL conference Europe in Amsterdam

Wednesday, October 5th, 2011

´╗┐PostgreSQL Conference Europe 2011 starts 2 weeks from today in the beautiful city of Amsterdam in the Netherlands. This is the fourth annual conference hosted by PostgreSQL Europe, following on from extremely successful events in Prato (Italy), Paris and Stuttgart, and is aimed at developers, DBAs, technologists and decision makers either using, or considering using the world’s most advanced Open Source database.

This year we have four days on the schedule, with a kick-off day of training sessions hosted by respected PostgreSQL developers such as Greg Smith, Bruce Momjian, Magnus Hagander, Guillaume Lelarge and more. Topics will cover performance tuning, application development, database administration, replication & high availability and geospatial. The training sessions are available on their own, or as part of a regular conference attendance at additional – but very reasonable – cost.

We had a record number of talk proposals submitted this year but we’ve resisted the urge to host even more sessions in parallel – in fact we’ve reduced the number of parallel sessions to three as we all know how frustrating it can be when more than one that you want to see are at the same time. Instead we’ve extended the conference by a day to accomodate over 40 different sessions, which has the added bonus of allowing an additional night of social activities – always a great way to discuss the latest technologies, trends and ideas with other Postgres users over a beer or two.

We’ve got a great range of topics for this year, covering new features in PostgreSQL 9.1 and beyond, developing applications, running Postgres in the cloud, hacking PostgreSQL internals, tools and add-on products and managing large databases, presented by a wide cross-section of users and developers, including a number of this year’s Google Summer of Code students who will talk about their work. You can view the complete schedule on the conference website:

Our opening keynote this year will be presented by Ram Mohan, EVP and CTO of Afilias who manage the .info, .org and .mobi top level domains using Postgres. Ram will be discussing the business decisions and strategy around their use of PostgreSQL. Our closing keynote will be presented by Ed Boyajian, President and CEO of EnterpriseDB who will discuss PostgreSQL’s role in the post-Oracle era.

So, if you haven’t done so already, head on over to the website at to register as an attendee to avoid missing out on what promises to be an outstanding conference in an fantastic location. See you in Amsterdam!

Flattr this

Queer Geeks

Friday, August 19th, 2011

Recently at the Chaos Communication Camp I sat down with a group of ‘queer geeks’. We shared, with the world, our experience with and our feelings surrounding being queer in the hacker-scene. We convened in the middle of a rainy night in a make-shift studio in a tent and had a very profound discussion on the camp radio Binary Voice. I have not really expressed myself in that session a lot, but listening back to the recording I can not help but wanting to elaborate.

At the end of the show I say I think it is fantastic to be queer. While that sounds like an easy thing to proclaim, I have not always thought so. In fact, up until around 20 I really hated myself for being gay. My environment constantly gave me a lot of signals that being gay is somehow wrong, and although I never had to endure the physical violence that, for example, Mitch Altman had to endure it did scar me psychologically.

I denied that part of myself until I ended up with suicidal tendencies with a psychiatrist. During those sessions I first explored this part of my identity. By then, I had reverted to substance abuse (alcohol, weed, xtc, hallucinogens, you name it) to aid in the impossible task of pretending I had no sexual preference for boys. I mean, sexuality is such an integral part of our being, to deny that is like to deny that one breathes.

Imagine the constant struggle, fantasizing about boys and falling in love with your male classmates while at the same time strongly believing it is wrong and must never surface. That’s hard. Really hard. I don’t think I can aptly describe what that did to me to anyone who has not gone through the same struggle.

When I came out to friends and family and labelled myself gay, I thought I was there. I partied like mad in the local gay scene, thought I was complete. Yet, the years of denial and coping mechanisms were not easily dismissed. Somehow, the feeling it was somehow wrong persisted. It was hard for me to assimilate within a new group and tell them I am queer. It really felt like an obstacle, I feared I would not be accepted for who I am.

The way the world was treating me still lead to a lot of frustration. The Dutch word ‘homo’ was (and still is) being used as a derogate term. It is a word some reserve for their worst enemies, for the people they deject the most. I got really angry about that, but instead of using that anger to change things in a positive way I let it build up inside me like a cancer.

I still feel hurt when people use the word ‘gay’ as a derogate term. Within certain subcultures of the hacker scene, especially those where kids measure their hacking abilities bragging about their conquests in some sort of nerdy masochism, it is socially acceptable to use language that hurts people. It is encouraged even. Bashing queers is, unfortunately, an easy way to get accepted within certain peer groups.

Usually the usage of the word gay as a way of dismissing someone is out of carelessness though. I have rarely found anyone who really has problems with queerness. It is habitual use of language, no conscious speech act. I tend to say something when I observe this. I try to explain how that same careless use of words almost drove me to end my life, kill myself.

I hope that will make people think. I know it has made people think. And I hope that with that I can contribute in making it easier for young kids out there who have similar issues as I did have.

For myself, I have found peace in that regard. I am openly queer, and will take every opportunity I can to let the world know. I love my life as such, and while I am still struggling with the psychological scars and addictive behaviour left from that time I do celebrate my queerness every opportunity I get.

It really makes me cry when I think of those young ones out there who might be gay, bisexual or whatever and are going through what I went through. I want to help them become themselves. I am glad that The Netherlands has the COC, an organisation that furthers queer emancipation but also supports anyone who is going through the process of coming out of the closet. I know some of my friends take issues with their political ways, but for me the real value of the COC is the sheer support one gets from being safe among peers who have had similar issues. When I finally acknowledged my homosexuality at 20, it helped me so much just to be able to go there and talk, listen and make friends with like-minded people. I have deep respect for the volunteers going into the classrooms, educating adolescents about the rich tapestry of queerness.

A few years after I came out, I had a profound experience. A friend whom I knew from the hardcore scene (gabber, speed, happy is for homos) called me, and started talking about how he heard about my coming out. To my surprise, he told me he was gay too. I had never expected this to come from that particular peer group, yet just by being openly queer it all of a sudden became acceptable for others as well. And that, for me, acknowledges the fact that just by being myself I can help.

I am therefore very proud of the show we did at CCC. We had a unique gathering of queer geeks at the table, openly talking about their deepest feelings, most horrible experiences and also the joy of being who you are. I really hope kids (and adults!) out there who struggle with their own sexual identity listen to it and can find support in the wise words spoken. Already a day after the show, Mitch told me about people coming out right there and then.

As a final thought, I want to emphasize that just putting the label ‘gay’ on myself is not the end but merely the beginning of the exploration of my own sexuality. Yes, I really like guys. And for a while I even went to the other extreme: I would deny every feeling I could possibly have for someone of the female (or whatever other) sex. I am slowly coming around, and realize things aren’t binary.

I have several friends who also do not tend to fit in the dominant social paradigm (to quote Mitch from the aforementioned show) of the monogamous heterosexual relationship, and are finding ways to deal with that while still existing within that dominating model. It is hard sometimes, but it is a lot of fun as well. And true hapiness, I believe, can only be found by following ones heart without regarding what others might think or judge you by.

Anyway, I encourage each and everyone (also if you do not consider yourself to be queer) to go and download that recording. And most of all, I encourage everyone out there to be themselves. And if that is hard somehow, know that there are a whole bunch of persons that have gone through it already and that are more than willing to talk. To listen. Do not hesitate to contact any of us on the panel (me, Mitch, Jimmy, Maha, Socialhack, Willow, Fabien and Tomate).

Be excellent!

Flattr this

Reverse tethering for android

Friday, June 17th, 2011

Since I’m on a road-trip and don’t have a SIM-card with data for every country I’m visiting (I’m fine in Germany and Belgium, but did not get a SIM-card for the Czech republic where i’m just for 24 hours) and never connect with my phone to an untrusted wifi network, I thought i’d do the reverse of tethering: connect my phone to my laptop (which has a tunnel to my server-rack in the datacenter) and surf through that. So mostly as a note for myself, here’s what I did:

Connected the USB between phone and laptop, then enabled tethering (this is Cyanogen 2.2 on a G1, rooted). This brings up the usb0 nic on both ends with some default ip’s. Then went into the terminal on the phone (probably can do this with adb shell as well) and checked I could ping:

# ifconfig usb0
usb0: ip mask flags [up broadcast running multicast]
# ping
PING ( 56(84) bytes of data.
64 bytes from icmp_seq=1 ttl=64 time=0.519ms

With that running, it is time to enable forwarding on my linux laptop:

sysctl -w net.ipv4.ip_forward=1

And enable some firewall rules to have traffic from the phone get NATTED on the outgoing tunnel endpoint on my laptop (tap0, remember usb0 is the usb nic that connects to my phone):

iptables -A FORWARD -i tap0 -o usb0 -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A POSTROUTING -t nat -o tap0 -j MASQUERADE
iptables -A INPUT -i usb0 -j ACCEPT
iptables -A FORWARD -i usb0 -o tap0 -j ACCEPT

Then I set the default route:

route add default gw

And finally, I need to tell the android that my nameservers are and

# setprop net.dns1
# setprop net.dns2

And we’re done!

Flattr this

The Last Ninja Tour is on the road

Tuesday, June 14th, 2011

One of the things I have always wanted to do is visit Vienna and attend Ninjacon (previously known as Plumbercon). So when I learned that this years Ninjacon is actually going to be the last one (it will continue as B-sides Vienna, you know, B-sides, the next hippest thing since sliced bread), I had a crazy idea: let’s just drive down to Vienna, stop at some hackerspaces along the way and attend!

As it is with me and crazy ideas, I then stopped thinking and just did it. So here I am writing from a comfy couch in Das Labor. This hackerspace in Bochum (Germany) is my first stop on the way to Vienna, and I must say: not a bad choice at all. But more on that later.

In about an hour, I will be heading out to Kassel where there is Flipdot. From there on to Weimar (Maschinenraum) and Prague (brmlab). And then I will hit Vienna just in time to unload and set-up the audio gear for Ninjacon. Yes, the audiogear. You know how these things go. You plan a quiet vacation, but before you know it your car is full of equipment or fiber or what-have-you. So in this case, the crew at Ninjacon asked if I could bring some audio gear, since that was one of the things they had not covered yet.

So with all the audio gear of the Signal studio (graciously sponsored by Hxx of course) and some borrowed PA speakers I will do the audio at Ninjacon. Great, I won’t get bored then! Luckily, i’m staying an extra day to leave on Monday again. Of course I want to check out Metalab and the city and whatever else Socialhack is going to show me!

From Vienna, it is on to Munich (I hope, haven’t yet heard back from then) and then Stuttgart, where I will revisit Shackspace. Well, that is, visit their new location because they have moved since my first (and also last) visit there about 6 months ago. And then it’s Luxembourg, for that long-due visit to syn2cat. En passant, I will join celebrations of the duke’s birthday (sort of like queensday back home, but with dukes and duchesses instead of queens and princes).

If that’s not enough, after a day of recovery, I’m heading to Charleroi in Belgium to arrive in time for the opening weekend of a fresh new hackerspace by the name of Wolfplex.

So yeah, quite the trip. I haven’t planned much, just announced my arrival at certain dates in certain cities and hope I will be able to find a place to crash. I mean to spend the days contemplating and reflecting. I’m due for a re-evaluation of all my projects, priorites and life. What better way to do so than lounging at all those hackerspaces!

Looking forward to all of it. And I hope I will find a 74HC125N along the way somewhere to complete my USBTinyISP. Stay tuned for updates.

Flattr this