Blog

php, javascript and robots!

I started at Jimdo in December 2012, ready to change everything and bring in all my gained knowledge in Software Design and Service Oriented Architecture (SOA). I already knew that the Jimdo system was approximately eight years old, so what we all call a "grown system". In fact this means that there are a few thing I would do "better", like we have code tightly coupled to the hardware structure and also into itself. No SOA at all, but I want to change that, as I was hired for the Feature team, I quickly realized that I obviously couldn't do it alone. I teamed up with Sönke and joined the Infrastructure team. He has been at Jimdo since 6 years, so he does not only know a lot about the system, but also is a great software architect.

Why I joined the Infrastructure team?

Well, I realized that before we can refactor the software we have to do some operations work. The Infrastructure team at Jimdo is responsible for two different tasks:

  1. Keep the system running, we have a bunch of hardware servers, so we have to deal with many disk failures and network issues.
  2. Improve the system, we are all very annoyed by the things mentioned above. So we can't to get rid of "möhrchenkonzept" (that's how we call it internally), which means putting old parts of the system out and putting new stuff in.

Hired as an Open Source Rockstar (or technically speaking "Software Engineer") - I ended up as an Ops guy just a month after I started. This was and still is a great opportunity to learn, not only for me, and I'd like to say that every developer should do this.

Things I learned so far:

  • Beeing on-call, this actually is one of the hardest things I had to learn. As an Ops guy you are FUCKING RESPONSIBLE for the system, not only when you're in the office or in front of your notebook. You should respond to an alarm within a given time, so no partying, no real chance for any activity where you cannot react within a reasonable time frame. Of course you also have to get up in the middle of the night. Think about the things you're doing over the week, and if you can also do them when you are on-call.
  • Deploying to production can cause a collage to spend the night infront of your notebook. You should develop, as if you have to get up when your deploy cause errors.
  • There's no magic involved, your code is always running on systems which have, somehow, to be maintained. Of course you can reduce the amour of work that has to be done with cloud solutions. But these could solutions can only reduce the work which results from hardware stuff. But when you are coding crap even Amazon can't help you. So sorry friends, I know, the truth can hurt. But there's no shiny candy land out there which can execute code.

This can be a little bit catchy For me people who have never used linux as an operation system are no real developers. It's more than mandatory to know the platform your code is running on, as I mentioned above. And most of our apps are hosted on an some kind of linux distribution. I'm also a Mac user, but before I switched to Apple I used Ubuntu for quite a long time. And this now helps me a lot, so that I know at least the basics in operations business. Maybe I should rephrase this: Every software developer should have at least some shell and unix knowledge.

So grab your ops colleagues and maybe offer them a little position exchange (everything included, also being on-call) for about a week or so. You will see this will change your mind and you will gather some more insights and gain a better understanding of the so called "system administrators" in your company. Oh and I finally learned some puppet, too.

Sidenote: If you like this topic and want to hear more of this, I will give a Talk on this topic at ThatConference in Wisconsin this August. If you're also curious about this topic please step by and let's have a talk.

Jimdo also has a Developers Blog you definitely should follow. We try to blog about more specific things we archived so far.

A few weeks ago I finally managed to deploy Hubot on nodejitsu, as I've read a few times people want to know how this works, heres my tutorial.

Prerequisites

First of all you need a deployable version of Hubot

git clone git://github.com/github/hubot.git
cd hubot && npm install
bin/hubot -c ../deployable_bot
cd ../deployable_bot && npm install

Now you have a deployable version of Hubot in the deployable_bot folder. Next step would be to configure your adapter. When your done with this, you have a runnable version of Hubot. Now let's move on with the nodejitsu part. I assume you have your account and the cli-tools properly set up.

nodejitsu and cli flags

As you might have noticed nodejitsu isn't able to take cli flags. But we need them to make Hubot run properly. Luckily we can configure Hubot also via environment variables. So let's move all the needed parameters into the package.json, every cli flag is also available as environment parameter with the HUBOT_ prefix

{
  "name": "demo-hubot",
  "scripts": {
    "start": "node_modules/.bin/hubot"
  },
  "env": {
    "HUBOT_ADAPTER": "xmpp",
    "HUBOT_NAME": "demobot"
  }
}

note: with nodejitsu you can also store your environment variables in the WebOps interface. Because you'll have a lots of passwords in your environment variables, and I really suggest not storing passwords in any repository.

deploy on nodejitsu

This is properly the easiest part

jitsu deploy

Your application will be created if it's not there yet. Your robot should now join your configured chat.

why nodejitsu? when there is already heroku support

Here are a couple of reasons:

  • I like new stuff
  • nodejitsu is for node
  • there are no dynos (so no idle timeout stuff)
  • Zero Downtime Deploys

is there more?

Oh yes! You can have auto-deploy or check out Hubot docs or nodejitsu docs. Hope you this works for you as good as it does for me. If not, just drop me a tweet :)

The feeling when your getting the mail, the ones saying

ScotlandJS Proposal Accepted

it's amazing! It's so freaking amazing! I'm going to speak at ScotlandJS. Wooooooo! I'm really happy the earlybirds selected my talk. So I can't wait to see all of you and of cause I'm also very excited to see Scotland for the first time. And if you've not bought your ticket yet - do it! It's worth it. The keynote speakers are already announced and they are really great speakers. So there are so many reasons to come, you shouldn't miss it.

Jimdo @ FOSDEM

26 Feb 2013, comments

This post is x-posted from the Jimdo developer blog - check it out!

February 2nd and 3rd - 5000 nerds overrun Brussels, Belgium, to attend Europe’s biggest Free and Open Source Developers Europe Meetup - FOSDEM 2013. So, a colleague and I decided that we had to be there too. I had the pleasure of giving a talk in the PHP developer room. In case you missed it, here is our FOSDEM 2013 recap.

FOSDEM audience

We started with the opening keynote including the FOSDEM dance. Next, we planned to see How Google builds web services but unfortunately missed it, as well as some others, because of overcrowded rooms. We also missed Using Ruby Testing Frameworks to bring sanity to your infrastructure covering topics like how to mock services in a Service Oriented Architecture environment.

But enough about the things that we missed! We attended a bunch of really awesome and inspiring talks!

Learning to Automate was about the problems you discover when you begin to automate, or learn configuration management languages. One crucial required skill we detected, is software engineering like Inversion of Control or Dependency Injection and Single Responsibility Principle aka Software layering.

Welcome to the Symfony2 World was a very good introduction to the shiny new world of modern PHP. RDFa (http://en.wikipedia.org/wiki/RDFa) was mentioned in combination with Symfony CMF which also looks like a cool thing for Jimdo. Funny to see what and how much the PHP ecosystem has adopted from the other language ecosystems.

Engineering Resilient Systems through Cross-Disciplinary Insight gave us some super interesting insights into how to build resilient IT systems by using organizational development and culture. Essentially Agile, DevOps and Kanban promotion. We also learned about Theory X and Theory Y.

Orchestrating complex deployments on OpenStack using Heat was largely a cool screencast of a live coding session of Heat, which is pretty much an AWS Cloud Formation clone in OpenStack.

whats wrong with php

And finally I also had the pleasure to give my What’s wrong with PHP talk for the very first time. Luckily Jimdo helped a lot to make this possible! Thank you! :) I got great feedback on my talk and I was really happy when it was done - so I could really enjoy the conference (and the beer).

Ohhhh and then we saw one of the most impressive talks we’ve ever seen. It was presented by Raghavendra Prabhu. The proposed topic was Feed me more: Memory appetite of MySQL analysed and it contained enough material for a full 4-day training. The speaker obviously had to be very quick, but he somehow managed to finish more or less on time. It contained so many very heavy MySQL and InnoDB internals that I couldn’t follow after 4 minutes, but we all agreed that he must be that guy who writes my.cnf on a napkin without hands while having a drink by the pool! Thanks buddy!

Of course there were also lots of really cool after-party options, like the DevOps dinner sponsored by OpsCode, Puppet Labs and CF Engine. Or attending the overcrowded beer event on Friday or just hanging out in Brussels with the smartest guys in technology. We hope to see you all again in 2014!

Jimdo and jekyll

20 Feb 2013, comments

Ohh boy! Such a long time passed since the last post. I just wonna give all of you a few updates.

TL;DR
I'm now working for Jimdo.
This blog now runs with jekyll and github pages.
Please change your reader to http://feeds.feedburner.com/Codestars.

I'm a Jimdo'er

Jimdo-Team

If you follow me on twitter you might noticed that I recently changed my employer! I now work for Jimdo, again in Hamburg. If you wonder what Jimdo is or does?! - I always describe Jimdo like this:

We make your mama' creating websites, unless she isn't already a webdeveloper

I'm at the infrastructure team at the moment, so doing lots of devops stuff there. You wonna know why I switched? Just meet me in person the next meetup or conference!

A complete new blog

As you might notice, this blog completely changed! I started with this blog back in 2009 on my own vServer at a very crappy hoster (1Blu - sorry, but no recommendation here). I don't want to administrate all the stuff which comes along with having your own server. Like doing system updates, manage wordpress and plugins. Plus having such a crappy coded blog-engine like wordpress. I don't wonna touch any wordpress code, so no chance for me to make changes to the blog-engine.

I discovered jekyll, octopress and stuff one or two years ago and together with github:pages this looks very promising to me. So I want to switch since... ever. But didn't have the time guts to really do it! Last weekend I want to write a new blogpost, so I logged into my wordpress and started ... with installing updates, as always. At this point I decided to finally make the switch-over! Therefore I defined what to do:

  • take care of the comments
  • split-up domains from vServer
  • export and transform posts
  • setup jekyll and github pages

Let's check step by step

take care of the comments

This was an easy pick for me, b/c I already switched to disqus a few month ago in preparation for this switch. Just install the disqus wordpress plugin and transfer you comments. This is a no-brainer srsly!

split-up domains from vServer

Ohh man! Not that no-brainer as I hoped it will be. As I mentioned my old hoster was really crappy and one goal of the move was to get rid of the contract. After I met Anthony Eden the man behind DNSimple at the TakeOff Conference in Lille( and he pooped me). I obviously had to switch my domains to them. And man, I really love this service. I love everything-as-a-service in general and they are a really perfect match for this kind of things!

export and transform posts

The ease of this task really depends on your existing post and the fancyness in there. I just followed this guy http://weedygarden.net/2012/12/hello-jekyll/

I had a couple of embedded youtube videos and other iframes - and they all break. But with some sed/awk and search and replace I fixed most of them. But you will definitely find some broken posts in the archive.

setup jekyll and github pages

I suggest any wrapper around jekyll like jekyll bootstrap or octopress unless you really want to build up everything from scratch on your own.

So yeah - here it is! My fresh, new, shiny blog crafted with jekyll bootstrap and github pages. It's now responsive, fast, supercool and nerdy. Plus I think this will encourage me to blog more in 2013!

Oh and if you are following my blog on your reader: Please change your reader to http://feeds.feedburner.com/Codestars.

Do you know “Hubot”? This awesome robot build by the github guys?

Hubot Hubot

No? Srsly? Ok you should meet him – here - now!

Ok now you might have a clue what he’s doing now? Some toy for man, heh? But no honestly he can do much MUCH more. He’s some kind of a friend, he slaps you when you use inappropriate language, replies to your questions or just let you waste some time with 9gag. And there is more, it’s up to you to train him new stuff. Let him do the stuff you hate to do, pick a pizza delivery service, decide for a nice song or even let him deploy you app!

And this is what I wan’t to talk about. We at Digital Pioneers use Scalarium to manage our AWS hosted apps. With scalarium you first define an could, define different roles, like Webserver, Loadbalancer and Databases. You can assign apps to the clouds and then do some common tasks on the app or on the cloud. Like deploy the application, reboot an webserver or add an extra webserver for better scaling. You can do all the stuff on the scalarium website or use the api.

We want some of kind one-click-deployment. On the scalarium website an deploy is more then just one click and the session expires pretty fast, so deploying on the scalarium website is kind of annoying. So I took the chance to learn some thing new, CoffeeScript (hubot scripts are written in CoffeeScript). I wrote a little ApiClient for scalarium and connected it to hubot. So now we’re able to deploy within our developer chat. This looks like this:

Hubot deploy Hubot deploy

This is pretty awesome heh? And because we at Digital Pioneers love Open Source, we will give some love back to the community. So here’s the hubot script: . I’ll contribute the script back to hubot-scripts after we some how tested it b/c as far as i noticed yet it’s a lil bit buggy. And not that feature complete as i would like to have it.

The bot is also able to list app and clouds, but this features are not that amazing like the deployment thingy, just want to mention it here, to be complete :)

What about you? You also love OpenSource? You also love these devops thingy? WE ARE FUCKING HIRING! We’re serious, we are looking for you as an DevOps Engineer or Software Developer! So come on and be my co-worker and join Digital Pioneers N.V.!

UPDATE May 30, 2012

This scripts got finally fully merged into hubot-scripts. So please feel free to contribute, use and love it!

Back in blog business, first I want to start with a very few personal words. I left the gaming industries, now I’m working for Digital Pioneers N.V. there we do rapidly prototyping of new ideas with cool, new shiny techniques!

At the moment I work on the backend for Stuffle, the client-server communication is done via a restful json api. And here the challende begun. Symfony2 luckily offers very cool techniques to build a restful HTTP api. But as the client is written in a strongly typed language we have to make sure to meet the specified api. And when I say meet I’m fucking serious, a “date” must be and timestamp, nothing easier then that right? But when we as PHP developers take almost everything as a valid timestamp:

Nor in a strongly typed language, there we’ll already come into trouble with the second example. So we have to find a way to make the API very stable even during the development process, because the two parts were developed at the same time. So we decided to develop the API test driven. But have you ever written tests with for stuff like this, I did not before! Luckily we use symfony2 so the first step was to implement a service that transfroms our MongoDB documents (with some other extra dataproviders) into a json string which met the specifications. So almost all of our actions ends like

Now we’ll come to the tricky part. Because if we want to test the whole response including the types and it’s correct we would end in test methods containing around 200 assertions. NO WAY!

So we splinted up the whole thing into it’s parts. First of all we wrote normal UnitTests for the “api.response.json” service, and honestly mocking MongoDB documents sucks hard! And I swear next time I need some thing like that I’ll write an plugin for that. Anyway, that UnitTests make sure that the response is always valid when we’re using this service for the response content.

The other and even bigger part are the integration tests (Symfony WebTestCase). We use fixtures, lots of ‘em. And due to that fact the the UnitTests for this “api.response.json” service make certain that the response is valid regarding the api specs. We just have to check the HTTP response code and maybe some smaller fractional checks for the data in the response.

And yeha, that’s basically it. So the magic is to bundle all the responses to the service. And a little side note when you’re interested in how we’re developing and deploying my college florian wrote a few articles on his blog[GER].

Search Monster

12 Feb 2012, comments

Just the results of an sick idea, implemented quickly and dirty.

There’s also a cli version in PHP Next step should be and npm package :D

This weekend there was a big event at my employer InnoGames: The InnoGames GameJam Volume 2! It was the second Jam InnoGames organized, but the first time for me attending. So there were tons of new experience and fun for me.

The countdown started Friday at 6 P.M. GMT 1 and holds 48 hours of hardcore programming for us. At the beginning Michael, our organizer, hold a little (not well prepared) keynote and announced the topic of the jam: Space

I teamed up with two of my regular WestWars colleagues, Patrick another developer and David an awesome graphic (3D) artist. And we decided to make a 2D Action-RTS-Multiplayer-Shooting Game. Sounds awesome? Indeed it is! You’ll get the link at the end of the post.

We got inspired by this video i found a few month ago in my twitter stream:

So we started working and working and working… We used Node.js, with express, jade and Socket.io in the frontend we choosed Crafty. Finally we came close to the end of the 48 hours countdown, and yeha, i’m proud that i can say that we got a result. AND its very impressiv and cool! Of cause there were a few bugs, and honestly the code quality is like shit. But it’s ok we (and you) have to keep in mind that the whole game including ideas, graphics, programming and testing has to be done in just 48 hours. I only got 6 hours sleep over the whole weekend, that wasn’t much but I’m ok with that. InnoGames sponsored RedBull and Pizza for all so we got awesome support!

So and this is what we got and we call it Space Kitchen:

SpaceKitchen Space Kitchen

And you can test and play it here. Keep in mind that this is a multiplayer game and that it won’t be much fun to play alone, or let me say you can not really play alone. So pick up a colleague and go for a round full of Action and Fun! Oh and please don’t use Chrome, there was a little bug that we can not solve in time. But IE is working (loooool, but really it works) and of cause FF, Opera and Safari too. And don’t forget to turn up your volume ;)

At the end of this article I’d like to say a huuuuge thanks to all attendees, organizers and of cuase my awesum employer InnoGames!

Hope to see ya’ all at the next InnoGames GameJam!

If you have any game related feedback for us, please leave a comment here in my blog.

P.S. Did you found the penis? ;)

Update 11.01.2012 10:30 Uhr: InnoGames shared this post at The InnoGames Blog

Hey there! I’m back!

After a long time of silence here in this Blog, I’ll post some new stuff. This time just a little test or example from my labs. I wrote Conways Game of Life in JavaScript and rendered it on a Canvas element.

And yeha, i just like simple like this:

You can find the pages here. It’s only client-side code and not obfuscated or some thing, so feel free to take a look on the uncommented source.

Next step maybe is replace the canvas rendering with divs and dom, cuz … yeha … canvas is just too slow and maybe i’ll post this here again.