Creating Techup.lu (well…copying Techup.ch)

I commute every day 2 hours to work and after more than one year of doing so I was tired of reading stupid books, listening to music,… In other words I was bored on public transportations in Luxembourg. The best thing as a Software Developer, your office is always where you are. If you are lucky and have a notepad on your knees to can even code instead of just scribbling notes to your notepad. Techup.lu was born.

So I decided to create a small Grails project and deploy it to Heroku. The first idea to do as a project was a clone of the brilliant techup.ch. (Techup.ch is a community effort to create a centralized, but open repository for meetups in Switzerland) My plan create a techup for Luxembourg. Just to be sure I asked them if I could create a copy of their project.

Just at that time I found Heroku a PaaS, which had everything I needed and allowed me to deploy the app for (almost) free to the www. Deploying a Grails application to HEROKU is as simple as a Git push command. Deploying a sample App to Heroku took me less than 20 minutes. I really like the approach Heroku choose as a PaaS. You get a command line tool (I think written in Ruby), and I love working with such tools. I always believe command line tools don’t need to put effort in the GUI, giving more budget to create a robust tool. Besides the Heroku tool, there are quite a few Heroku Addons and most of them have a free plan for small apps. For example, a MemCache Addon gives you a free of 25mb MemCache bucket. Further Heroku have excellent support for Postgres DBs, that I use at work too. The DB for development is free, and you get 5mb for free, but a shared plan is available at 20$. Further a small decicated DB is already available for 50$ per month.

Getting started is usually very simple and on the train I got my 1 hour dev time per day. Usually I deployed the app at night from home, just to be motivated to see the app online. And to be able to test it on other devices, as soon as an iPad, iPhone or other tablet was around, I tested the running app.

I used Twitter Bootstrap (2.0.2) from the start, which was looking back a bad idea, since I produced a lot of html tags, css classes only for styling. So I guess this is not the way it should be I thought at some point. I spend a lot of time getting rid of most of this overhead HTML code.


<div class="article row">
<div class="content span3"></div>
<div class="sidebar1 span5"></div>
<div class="sidebar2 span2"></div>
</div>

Do you see what we have done with our code? We have created a table, and tables we know should not be used for layout. So where is the difference from the above code to a table? Instead use the Bootstrap mixins in your LESS files.


.article{
makeRow();
}
.content{
.makeColumn(3);
}

Unfortunately as the design was binded to my HTML, I could not get rid of some bootstrap style classes in my HTML. This is going to be something that next time I would do completely differently. Instead of binding my dev code to some framework, or produce overhead code for styling, I would develop with a blank app, completely without styling. Maybe this will not give me the same additional super power (by motivation), but in the end will not be frustrated to spend so many time cleaning and refactoring the code.

Another problem I had was that g.formatDate gave me different values for Phones(iPhone and Android) and Desktop, which lead to quite some confusion that I am still investigating and will make an additional post on this issue. It seems that formatDate, if no TimeZone specified takes it somehow from the request?

Today I am launching techup.lu, after more than 2 months of “in train” development. (The google maps and twitter part of course had to be done at home with an internet connection, to test and read the docs, this means I cannot give it the certification of “Developed on Public Transporation 100%”) I don’t know how the community in Luxembourg is going to react and if the hackers from Luxembourg are going to use it. Of course if the community would use it, I would be very pleased and I would be happy that I could have given something to that community. If nobody wants to use I will have lost nothing and just spend some time doing what I love.


The app is still BETA, so be nice and please report bugs and feedback to me viw twitter @techup_lu. The performance on Heroku for Grails is unknown to me, so I will have to keep an eye on that :)

 

Problem: Automatic Reboot after Shutdown (Ubuntu 11.10)

On my Thinkpad x220  when I am running on battery under Ubuntu 11.10 and I do a normal shutdown, the system shuts down correctly, but it reboots after 1 sec. This only happens when i am on battery.

I found that it is related to the module e1000e, for example when i do

sudo rmmod e1000e

before the shutdown no automatic reboot is done.

Battery Life on Thinkpad x220 (i7) running Ubuntu 11.10

To get the same battery life running Linux and Windows is still a challenge. Especially for ThinkPads, as Lenovo Engineers seems to magically tweak the drivers to use less power in Windows and get a fantastic battery life(Windows only). For Linux users, power usage has never been excellent out of the box and extra tuning is necessary to double the out-of-the-box battery life. I get more than 12 hours for Ubuntu 11.10 with the 9-cell battery, the power usage in Idle State is around 7.5W.

Installation of Ubuntu on my new Thinkpad x220 i7 was a no brainer, as we know it from Ubuntu and it seems that installing an OS has never been so easy and fast. Every thing seems to be working out of the box, but looking closer there are some things that needs to be tweaked. As notes to myself, I am writing about how I fixed these problems in a series of posts.

The first thing that needs to be tuned is battery life. Under Windows7 I get with pre-installed settings about 10-11 hours of runtime. The conditions were brightness set to 20% with ethernet in use. Under Ubuntu 11.10 out of the box I got around 4-5 hours, and that is quite a difference with some room to optimization.

To get started I installed powertop, a command line tool to show which part drains the battery. To install just call in command line:

user@computer:$ sudo apt-get install powertop

and then run it from command line with

user@computer:$ sudo powertop

You have 5 tabs (change with direction keys).

powertop tunables

On the overview tab you see how many Watts are being used now. My goal here is to go below 9W for light work and 7.5W for idling. Change to the tab Tunables, where you see everything that powertop thinks can be tuned (tagged with BAD). Use the direction keys to select those and with Enter-key toggle them, so they say GOOD. For me powertop was not able to scroll so you should make your terminal size to full-screen to see all available options.

On the overview tab of powertop you can observe which hard- or software parts are draining your energy. As usual the rule is turn off everything that you don’t need.

Then there has been a problem with recent Linux kernels with modern processors. For my Thinkpad x220 I added the following boot parameters to grub

pcie_aspm=force i915.i915_enable_rc6=1 i915.lvds_downclock=1 i915.i915_enable_fbc=1

Test them first by adding them on a normal boot process in grub (press e to edit boot parameters, see here). If this works for you then add them permanently to grub, by editing /etc/default/grub. (after editing you have to call update-grub once).

Finally I get idling around 7W usage and working on ethernet (wireless should be about the same) 9-10W. This gives me a battery life time of 10

Apple vs AppleADay

There is a small restaurant in Luxembourg City called appleaday. I would say there are about 20 chairs in this restaurant. Find more Images here. Started by three young motivated people the restaurant has recently been “attacked” by Apple Inc. Why?, Because of the name “appleaday” vs. “apple” and in a second place beacause of the Logo.(see here) They also use an apple as logo (but from the abstract image it could also be an orange, or peach,….)

Apple Inc do you really think that people are that stupid that they cannot differantiate between Apple (computers, Phones, Software,…) and a small Restaurant having nothing in common except 5 letters in the name? Because of this lawsuite the restaurant is risking to go bankrupt.

Go support either of those parties…buy a new iPhone, or, go and have lunch at appleaday.

UPDATE: The law suite lasts for over 9 months already, and it got feature in local news on 2011/11/03. (in french) here, older

Grails using Tag in Controller or Service (remoteLink,…)

The GRAILS tags like remoteLink can easily be used inside a view (GSP) by using

<g:remoteLink controller="book" action="show" id="1" update="content">MyBook</g:remoteLink>

However, if you need to use any tag like remoteLink outside of a view, for example in a controller or service make sure to inject grailsApplication first

def grailsApplication

and then you can use the following call to get the link (in this case) as String

g.remoteLink(action:'show', controller:'book', id: '1', update:'content' ){MyBook}

Youtube 2.1.6 on Android 2.2.1

After upgrade to Android version 2.2.1 on my Samsung Galaxy S, the YouTube application started to behave in a strange way. When I want to play a video I get the message “There was a problem while playing. Touch to retry”. Of course I touched multiple times to retry, but no success. I tried re-installing the application, and still no success. I googled the problem but found no solution.

Then the simple solution to the problem is to reboot your phone. For me at least it works. When the bug occurs, I reboot and the YouTube apps plays videos. At the same time I noticed that when the bug occurs, several music files (mp3?) don’t play. So if you encounter such a problem: “Try turning it on and off again!”

Browser Memory Usage

In a previous post I compared the latest browsers for Ubuntu and I used htop to find out the memory usage of the browsers.  Today I find that there is a nice build-in function in Chromium that shows you the memory usage for all running browsers.(Chromium, Firefox and Opera)

Just type about:memory into the address bar in Chromium and you will see on top of the page the memory usage for the open browsers. Find out on more about pages here.

About Memory - Chromium