I am not really a web guy, coming from an operating systems and Java background. But for some reasons, I’ve been working on a Symfony3 project for the past year. I learned a lot and developed a deep love-hate relationship with both PHP and JavaScript. They have their strengths and weaknesses and I can respect that. But man, the way Apache and PHP are configured is just evil!

Today, I wanted to kill all user sessions, that have not been accessed for at least two hours. Now, there’s two ways to go about this.

Set session variables in php.ini and let PHP do the job

PHP brings it’s own session cleaning mechanism that involves these three settings in the php.ini:

session.gc_maxlifetime = 1440
session.gc_probability = 1
session.gc_divisor = 100

That translates to:

  • A session is dead after 1440 seconds (24 minutes) of inactivity
  • The chance that the garbage collection will be started is 1 in …
  • …100 session starts (user logins)

That’s neat, if that you have lots of user logins. I was working on an internal tool with only 50 registered users. The chance to kill the session of one inactive user if all other 49 users logged in right after the two hours mark where still less than 39%. (1-0.99^49) Not ideal. So, what’s the other option?

Release the Kraken Cronjob

Most Debian/Ubuntu systems come with a cronjob that kills stale sessions for you. It doesn’t care for your fancy session settings. Well, it only cares for one fancy session setting session.gc_maxlifetime is still the deadline for stale sessions.

Now, you could combine the two approaches, but since my symfony was already tripping over itself with complex permission problems, I decided to rely on just the cronjob. I set the session.gc_maxlifetime to 10 and the session.gc_probability to 0, logged into my system, waited for 10 seconds, manually started the cronjob-script and voila… I was still logged in.

No Mr Session, I expect you to die!

Why? Why did the session not expire? Why was it still there? Taunting me from within the session folder. What did I forget? I ran the crobjob-script again. Nothing. So I started to augment the script with some ‘printfs’ and read the output. It said: “24 minutes max session lifetime”. Wait. What? I looked at my active PHP version: 7.1. I looked into the ‘/etc/php/7.1/apache/php.ini’ AND the ‘/etc/php/7.1/cli/php.ini’. Both said: Max lifetime is 10 seconds. What went wrong?

What went wrong?

I still had my old PHP 7.0 ini-files. Although PHP 7.1 was active, the cronjob-script looked at ALL possible ini-files and searched for the HIGHEST max session lifetime. Once I also changed the inactive ini-files to 10 seconds, all stale sessions where gone.

Two years ago, I got my wife pregnant. That’s one of those sentences, I never imagined saying. “I got somebody else’s wife pregnant”, sure, totally possible. But “my wife”? Still sounds weird. And it wasn’t by accident, either! This kid could not have been more planned, if it had been pre-ordered online.

We decided not to wait three months before telling anyone. We knew stuff may happen, but it would not be less sad just because we kept our mouths shut. Also, it’s hard to keep a secret when you are constantly throwing up. And crying. And collapsing. And generally being a complete mess of a human being. Not me of course, I was fine! But my wife … not so lucky.

In the 11th week, we went to visit Nepi (that’s what we called our unborn child) in his crib (that’s what we called the uterus of my wife). A routine checkup. The midwife gave us some pamphlets and then we watched the ultrasonic monitor for the beating of our child’s heart.

There was none.

No heartbeat, just a lump of cell mass attached to some tissue. The blow was devastating. Somehow, we managed to sit through the listing of our options by the gynecologist. Outside, we collapsed into a crying puddle of misery. We’ve lost our child. Nothing prepares you for that.

But we knew we were not alone. A friend of mine lost her child at the same stage and since she was the one who inspired me to not keep it a secret — neither the pregnancy, nor the miscarriage — I knew what to do. We immediately told everyone.

But why didn’t we wait? Why did we not do the sensible thing and wait for a three months before announcing the pregnancy? Here is why:

It’s natural
Sometimes, during the complex process of rearranging genes and duplicating cells and stuff, things go terribly wrong. There is not much room for errors. Ever tried to read a broken copy of a file on your computer? Our child was something like that. A broken file with a read/write-error. It couldn’t survive.

It’s common
Depending on who you ask, the chance of having a miscarriage is somewhere around 20%. That’s one in every fifth pregnancy. And that’s only accounting for the pregnancies that were detected! When we told our story, we were amazed how many people had first- or second hand experiences with a miscarriage.

It’s nothing to be ashamed of
My wife met a former classmate at a reunion, who suddenly broke down in tears, because she had a miscarriage and didn’t tell anyone. Not even her family. Listen, it’s not your fault! Don’t let them tell you otherwise! We had to go through some “Maybe if you would have eaten meat…”-crap ourselves. But overall our friends were very supportive.

It doesn’t mean anything
My friend is pregnant with her second child. We have a huge and healthy son that we call “Grunt, the destroyer of worlds”. So, a miscarriage doesn’t mean that you can’t have a child. You just need to try again. And the pain subsides, though it never goes away.

I’ve hated ultrasonic monitors ever since.

I outed myself as a big JetBrains a couple of times over and I am still madly in love with almost everything they do, despite them not paying me one cent for this endorsement! Heck, I even have to pay for their products, these ungrateful bastards! Still, they are the best and usually I am very happy with their products. But even they screw up sometimes.

Today, I have spent several hours trying desperately to get my copy of PhpStorm to talk to my local Trac server. It should have been a simple task. Open Settings and go to Tools->Tasks->Servers. There you can chose between different bug and issue trackers, including Trac. But here’s the catch: It doesn’t work.

Without further explanation PhpStorm just refuses to talk to Trac.

Without further explanation PhpStorm just refuses to talk to Trac.

Cannot connect to http://localhost:8008 it says. “That is odd.”, I think to myself, “I am pretty sure that this should work as I have this URL open in my browser and it looks just fine!”. So I opened the log file logs/trac.log and found that:
WARNING: [] HTTPBadRequest: 400 Bad Request (Invalid request arguments.)
“Well, that’s a start. I am pretty optimistic, with this I can find an explanation on the internet in no time!”. Boy, I was wrong. Neither Edgewall Software nor JetBrains nor any of the usual forums had a clue what I was talking about. I was ready to give up and try any of the other supported trackers, when I found a note about the Trac XML-RPC Plugin, which might help. Of course, installing it was not as straight forward as I would have liked it to be, as Trac only supports Python-2.7 and my system defaults to Python-3 but this is how I got it working:
cd && sudo python2.7 -m easy_install -Z -U https://trac-hacks.org/svn/xmlrpcplugin/trunk
Then I had to enable the plugin inside Trac under Admin->Plugins and press apply. Finally, I changed the Server URL in PhpStorm from http://localhost:8008 to http://localhost:8008/login/rpc and voilà! PhpStorm and Trac finally got along!

Conclusion: While it is possible to connect Trac with the task system in PhpStorm, it is not really self-explanatory. It also seems like there are some features missing – e.g. I can’t get read task descriptions from Trac only the titles. I remains to be seen if my workflow profits from this the new liaison between Trac and PhpStorm.

Well, this is a wordy headline. But if you are running into this problem – like I did – you might search exactly for this and this is called effective seo or something. Here is the premise: You are using Vagrant, like any self-respecting developer would do and you also have soft spot for JetBrains products, i.e. PhpStorm, then you might want to start and stop vagrant directly from your beloved IDE. As you should! You paid good money to be spared from entering commands into a terminal.

These buttons were expensive. So I will use them!

These buttons were expensive. So I will use them!

But there is a catch: In case some commands are triggered during that process that require sudo privileges – like the awesome hostupdater-script – you will be greeted by the following message:

sudo: no tty present and no askpass program specified

Now what? I have read some suggestions, that you should change your sudoers configuration, but that doesn’t seem right. I found a simple solution inside PhpStorm. Go to Settings->Tools->Vagrant and add SUDO_ASKPASS=/usr/bin/ssh-askpass to the “Environment variables”.

Change the "Environment variables" to this and you will be asked for the sudo password whenever it is needed.

Change the “Environment variables” to this and you will be asked for the sudo password whenever it is needed.

And next time your sudo password is needed, you will be asked to enter it. On my system, that looks like this:

Thanks OpenSSH! I can now enter my sudo password with ease!

Thanks OpenSSH! I can now enter my sudo password with ease!

Ain’t that neat? Of course, if you use Windows or iOS, you might have to adapt the variable accordingly (read: I have no idea what you should do, you’re on your own, buddy).

Hope that helps!

In 2008, my girlfriend of that time (coincidentally my wife at the moment) and I decided to go on a little adventure of our own. We bought two Interrail tickets and vowed to see as much of Europe as humanly possible within the next four weeks. It was a disaster. The good kind. A disaster I will tell my children about, like “In 2008 I almost killed your mother by accident, by trying to catch a train. And then again by catching a wave with my body board! Oh, fun times…”

Sadly, I didn’t find the time to translate it from German into English. Yet. But those of you, who speak German, Here is a free eBook for you, that you might enjoy.

Auf dem Zahnfleisch durch Europa - Cover

Download: PDF | ePub

I am an elementary OS fanboy. There. I admit it. Sure, it is always a bit behind most of the other Ubuntu derivatives, as it is built upon the last lts-release, but what it lacks in shiny new features, it makes up for in pure beauty and elegant design. That is, except for the application icons.

Plank icons in elementary

Plank icons in elementary

The application icons are not really bad, but they are not great either. I find them to be unbalanced and nonuniform. This is because the elementary icon theme only contains icons for applications, that are part of elementary OS. Everything else is left to find a suitable icon somewhere else. With varying degrees of ugliness (I am looking at you Tex-Studio!).

Wingpanel icons in elementary

Wingpanel icons in elementary

But here comes Moka to the rescue. Although I am not a fan of the Moka themes “Paper” and “Orchis”, the Moka icon set is stunningly beautiful. At least the application icons are. The other icons (folders, actions, etc) of the elementary set are a much better fit for the overall elementary OS look and feel. 

Plank icons in Moka

Plank icons in Moka

So I did what every obsessive engineer with little to no knowledge about themes and icon set would have done: I mashed them together. It’s not pretty – well the result is, but not the process of getting there – as it involves a lot of symbolic linking. But if you don’t mind that, feel free to give this icon theme a spin.

Wingpanel icons in Moka

Wingpanel icons in Moka


  • The original elementary OS theme
  • The original Moka theme or my fork (you know, for them extra jetbrains icons)(Sam might pull them into the main repository as we speak, so maybe just wait a bit)


chmod +x Install

Use whatever you use to set the icon theme. I am lazy and use elementary tweaks which
is deprecated, so I won’t link to that. But this also works:

gsettings set org.gnome.desktop.interface icon-theme 'Mokamentary'

You might have noticed the lack of new content here (all three of you). It is not the usual loss of interest that comes so often after the initial rush of writing your own blog has faded. It’s because I had to leave the US of A on a pretty short notice. Like a four-day-notice. Contradictory to popular belief I wasn’t kicked out by the authorities after they have found about my “secret hobby”*. I got sick, my condition worsened and I wanted to get home to receive the treatment I needed, in the environment that I felt comfortable in. Besides that, as I mentioned here, I didn’t want to single-handedly bring down my insurance company with outrageous bills. It’s been a couple of very rough months, not only for me but also for the people around me. Some folks claim it’s because of Saturn being in the house of Ariel the Mermaid or something but I don’t believe in that sort of stuff. Also, Nasa has declined my wish to nuke that f*cker. So there is that.

During the last 180 days I learned a lot about me and — I guess — life. I learned that sometimes you have to ask for help and I am still deeply grateful to the nice girl working for Global Medical Management that listened to me and calmed me down when I was freaking out. I learned a lot about being homesick, too. I found new friends, realized the importance of old ones and will emerge a different, more mature person than I was before.

I also learned that our educational system has some blind spots of its own. For example let’s say you are a good student and almost done with your thesis but you somehow managed to fall ever so slightly behind the “Regulstudienzeit” — the number of semester you should need to complete your studies if you were Sheldon Cooper — you are no longer eligible for “Bafög” — the nicer form of student loans without interest. But you need to stay enrolled in order to write your thesis. Now imagine you get sick and are unable to work to support your extravagant lifestyle. Or maybe you cannot work because writing your thesis consumes ALL your time and energy and also you are on a deadline. You could go and ask for welfare — or “Harz IV” as we poetically call it. But that would mean you have to drop out of university. Without a degree you would then be able to pick up one the paid retraining programs that are offered by the government to learn a job where you end up less qualified and therefor less likely to earn as much as you could have if you had just finished your studies which in return means you can pay less taxes to support other poor bastards in the same situation. Also it takes much longer and costs more money. If you trust the credibility of the “Statistische Bundesamt” (federal bureau for statistics I guess) not even 40% of students complete their studies within the given time window. Why it is still called “regular time” and not “exceptional time” is beyond me. This shows that I am not the exception to the rule but the rule and that I have to get by just like the other 60%: By relying on friends and family. And that feels so good at the age of 34.

Anyway, I am back. I will have to rethink what I am going to do with this blog but I’ll figure something out.

*Please, that is just a joke. Don’t look into it! I am making it look worse by the minute, don’t I? It’s Guantanamo isn’t it? I knew it…

It’s time to dwell into what I consider to be two of the most (de)pressing issues of the American system: Health care and food. Let’s start with the latter. Food plays a big role in the American way of life, that turns rapidly into the American waddle of life when staple foods shift from wheat and water to burger and soda. With the introduction of high-fructose corn syrup, artificial sweeteners and fat-free products the portion of the population in the US that is overweight or obese has spiked (here is a good talk about that). Since I’m not a nutrition expert, I don’t want to go too deep into that, but I may have some ideas that I would like to propose. First of all: Stop drinking soda all the time! I know your tap water tastes awful because of all the chlorine you put into it and I know that bottled water is expensive and evil (just do a quick google for “nestle” and “water”), but there are alternatives. You can filter the tab water or buy spring water by the gallon at Whole Food’s. And no, diet sodas don’t cut it. There are good reasons to believe that they are even more harmful than sugary drinks. Yes, there are unlimited refills for your super sized cups of Mountain Dew but that doesn’t mean you have to drink the dispenser empty to get your dollar’s worth. Right now there is a proposition for taxing soft drinks that have a high content of sugar in them and man there is some backlash against it. And by that I mean TV spots that claim the new tax would hit the poorest families the hardest, because they are the main consumer of soda drinks. Also businesses selling these drinks would lose millions. First of all, the business argument is weak by nature. If you are selling something that is harmful to the health, you should not be protected on the grounds that this is your business model. Chose something else. Second, the idea behind that whole proposition is that poor people with poor access to health care should not be drinking so much soda because they are the ones who cannot afford to be treated for diabetes! Which would be a great segue to the health care system, but I’m not done here. Besides rethinking your beverages of choice you might want to take a look at your comfort food. I went to Santa Cruz two weeks ago and walked along the Boardwalk, California’s oldest amusement park and for the first time since my arrival in California I have seen some really fat people. At the UC Berkeley the food is actually quite good, as is the sports program. Also there seems to be an incentive for girls to show off their shortest pair of hot pants together with the skimpiest top they can find while boys have to wear muscle shirts and shorts. So although there is always a bunch of ‘big guys’ around the hamburger and pizza station in the cafeteria, it’s not the norm. Here, at the Boardwalk, Average Joe and his girlfriend are wheezing and sweating their way from one food booth to the next one, shoving funnel cakes (google it) with ice- and whipped-cream into their gaping mouths or enjoying a dozen of deep-fried Oreos (just imagine it). This is NOT healthy by any means! And don’t say that’s the exception! There is a food chain that sells a french toast that comes in at 2780 calories. While we are at it: Why do you applaud your nine year old daughter for putting on a ton of makeup and perform to a Nicki Minaj song in a cheerleader uniform? Aren’t you the guys who want their girls to be virgins until they marry and go crazy whenever there is a hint of a female nipple on television? But I digress.

Giant Dipper (sounds dirty to me)

Giant Dipper (sounds dirty to me)

Now we can turn our attention towards the health system. Unfortunately, I have some first hand experience with it now and my conclusion can be summarized into one short abbreviation: WTF!? Let’s start with the fact that I have health insurance. A pretty good one as I was told. Still I had to pay $300 up front for a basic health check including some blood tests. This was the discount rate at the UC Berkeley Health Center and I didn’t even see a doctor. I saw an advanced nurse. Now, I don’t want to say that she was not qualified for the job, but for 300 bucks I would have liked to see the highest ranked doctor around. My plea for a bill that I could send to my health insurance company was answered with a harsh “We haven’t done this in 13 years.” and the ringing of my VISA card. I wanted to come back to discuss the results, but that would have been another $140 and even though I may get the money back at some point in the future (when the original copies will have arrived in Germany and been processed) I can not afford to do that regularly. I scheduled a phone appointment, which was free of charge. Later on I learned, that my trip to the hospital in an ambulance on my first day in Berkeley (yeah, I know, what a lucky fellow I am) was something around $3000-$5000 and I am still not sure if I have to pay for that, because my health insurance is never mentioned on any of the “accepted insurances” pages on any of the health center websites I have visited. Yeah, that’s right. Not all hospitals accept all health insurances. That is something that has not once crossed my mind, that you can have a health insurance and still not be treated because there is no contract between the health center and your insurance company. That is something that I have seen on “House MD” but never assumed to be real. Again: WTF?! Health is a big topic in the media, but it’s mostly fear mongering about how Ebola could kill us all within weeks interrupted by commercials that either go “How to get slim and ripped by being lazy? Take one pill of ‘Lazyripped 4000’ to every fried-cheese-donut-orgy and we guarantee [certain restrictions apply] that you’ll look like Gerard Butler in 300 in no time!” or “Are you taking ‘Lazyripped 4000’ and are you bleeding from one or more orifices? Call 1-800-GREEDY-LAWYER and make some mad money!!”. I don’t think that’s helpful.

Please ignore the two bottles in front of this beautiful landscape.

Please ignore the two bottles in front of this beautiful landscape.

One last thing I learned last week is that nuclear power passes for green clean energy here because it’s not a fossil fuel. I could overlook the imminent threat of a nuclear meltdown or a leak in the system or the theft of radioactive material by bad guys who want to build a dirty bomb, but the fact that we still haven’t figured out how to safely store nuclear waste for the next couple of thousand years makes me think than the term “clean” is inappropriate. It may be glowing green though.

Artsy picture symbolizing the end of our road trip.

Artsy picture symbolizing the end of our road trip.

I don’t know how he did it, but my advisor Daniel somehow tricked me into going to a real night club in the San Francisco Mission District. I haven’t been clubbing in ages which primarily has something to do with my age, but also with my somewhat twisted taste in music (see my playlists). Still, he got me to pay $20 for admission, which I found vastly overpriced until I realized that we had stumbled into the “Monster Drag Show” and a two meter tall queen was just about to sodomize a leather slave while singing “Wrecking Ball” by Miley Cyrus. I cried tears of joy. Daniel cried too, but that was because he spent another $20 on two (!) cups of beer. But after the first sips of tear flavored beer we were both dancing to what I assume was a mash-up of Michael Jackson and Katy Perry, thoroughly enjoying ourselves. As the evening progressed I remembered why I didn’t go clubbing as often as I did when I was younger: It’s the other guys. And by guys I mean boys and girls, because they both eagerly play their parts in what I call “The Spiral Of Sexual Despair”. Soon I was trapped between boys drenched in too much cologne frantically trying to catch the attention of one of the dance floor goddesses who pretended to be way too drunk on beer that cost more than the minimum hourly wage. I just wanted to dance. When that became impossible due to the pushing and shoving and making out I was forced to leave the dance floor asking myself if I was a party pooper (which I am) or if other people just suck (which they do).

I came in like a wreeeecking baaaaaall!

I came in like a wreeeecking baaaaaall!

I don’t have cable. A few weeks ago this sentence meant nothing to me, because even without cable there are some pretty decent TV channels to watch in Germany. Say about the GEZ what you want (please not here in the comments) but I have never missed Öffentlich Rechtliches Fernsehen (public broadcasting) as badly as I do now. It’s not like I only have a few couple of channels to chose from. Oh hell no, I have about 70! But half of them are in a language I don’t speak (Chinese, Vietnamese, Japanese, Spanish and even Hindi). Then I have a bunch of local news channels that show live web cam feeds of the traffic on the Golden Gate Bridge or have a slick guy in a suit explain the weather to me. There are some channels that feature reruns of TV shows from the 50s and 60s. Others have moms present their favorite meat loaf recipe. About ten are trying to sell me something. At all times there is at least one crazy priest, one aggressive lawyer commercial and for some reasons one really long AAA spot on air. The “Cool Channel” doesn’t play cool music. “Zulu – The Country Channel” does play country music though. One channel is for lease. The rest is divided into cartoons and crime. I’m glad I have Netflix and YouTube.

Electric work done definitely by a professional electrician.

Electric work done definitely by a professional electrician.

Even after almost a month on the streets of America, I’m still struggling to grasp the concept of “right of way” in the US traffic system. Today I was being honked at furiously because I declined to smash my bike into the oncoming traffic. I sometimes stop at a red light, even though I want to take a right turn. For which I am being rightfully honked at. But my favorite thing around here are the “four way stops” that just choke all flowing traffic to death. Every car has to stop and the first one to arrive can then continue to drive. This is silly, but the best part is when, after a series of four way stops on one crossroad, two of the lanes don’t have to stop. More than once I have narrowly escaped death because I assumed the other car would have to stop since I had to stop as well. Of course more honking ensued.

Wary be thee who cometh to late to class!

Wary be thee who cometh too late to class!

I think the US exhibits capitalism in a very troubling form. For instance, competitive marketing has become the only kind of advertisement there is. It’s like watching children arguing about whose father is the strongest, while you already know both fathers haven’t seen the inside of a gym for a very long time. Maybe the comparison between children and advertisements is not ideal. Advertisements are more like politicians. They will go to great lengths to not tell you the true cost of what they are trying to sell you. The car is only $399 a month (if you pay $5999 in advance, by purchasing the in-house insurance and excluding tax). For example, T-Mobile made their pay-as-you-go model ridiculously hard to understand. It’s $10 for the card, then you have to pay at least $10 that are being converted to 100 credits, that are then divided between the next three months and 30 credits per month are reserved for the monthly fee and everything else is being taken from the deposit on the card BUT after three months you have to pay ANOTHER $10 to not lose the money that is still on that card. At least that’s how I think their system works after I asked in three different T-Mobile shops. But they are only playing the game everyone else is playing, so I won’t blame them. Okay, I will, because I lost $10!

Is this art? Seriously can anybody tell me?

Is this art? Seriously, can anybody tell me?

I often feel like a sheep among wolves, a resource that needs to be exploited. Yesterday I read a bulletin inside a store that specifically described how their staff has to approach and engage with the customers. It read like “Don’t stop selling until the customer stops buying. Tell the customer that whatever they bought was what they wanted. Point them to more items they would like. Always engage with them in conversation.” Underneath that were the monthly sale statistics sorted by names so that I could see that Kevin was rocking while Maggie needed to get their act together. That explained why a team of head-set wearing highly motivated salesmen circled around us, asked us every two minutes how we were doing, if everything was fine, if we knew about the special, if we wanted that special and why we didn’t want the special, since it was basically for free (if we bought two other items at full price). We fled the scene/the mall and walked beneath stunningly beautiful buildings, so expensive that we would never ever even see the inside of them. Right in front of one of the especially luxurious buildings inside a lush garden, a beggar was sleeping on a cardboard. The inside of his legs was brownish red from the many time he peed his pants, making it look like blood. Or maybe it was blood. A very compelling statement about the status of the American Dream.

Even the UC Berkely can look pretty bleak

Even the UC Berkely can look pretty bleak

Now to lighten the mood, a short quiz! What causes California to burn? That’s right: A drought! But what else makes California catch fire? Exactly! Light rain! Although being completely counterintuitive, a slight drizzle after a long drought moistens the dust that has been collected along the overland electricity lines leading to short cuts, sparks, burning poles and ultimately new fires and huge blackouts. I have to face the fact that I am now in a country of hurricanes, earthquakes, weapons and criminally lax safety regulations.

Welcome to the 17th century!

Welcome to the 17th century!

Also I was being told, that I have adopted a Californian accent. And I have learned that on a Friday night it’s perfectly fine to start drinking at 5pm.