Sonntag, 13. Oktober 2013

RailsConf 2006

This is a rather old video from the RailsConf 2006 but still relevant (and very amusing):

Very relevant is also the latest book "Rework" written by David Heinemeier Hansson et al. at 37signals.
Read it!
It will change the way you look at (IT-) projects, entrepreneurship...

Sonntag, 2. Juni 2013

Mac OS X tuning tips

Here are some tips that made my 5 years old Mac Book Pro a lot faster.
Please note, that im using OS X 10.8.3 while reading this.
As the Mac OS X file system doesn‘t require defragmentation as the windows file systems do, I don‘t recommend using third party defragmentation tools.
I suggest you stick to the Mac OS X tools shown here. You will notice the difference, in speed gained.

If your'e, like me, using a Mac Book, make sure it's running with the power supply and not on battery.

1. Defragment the Hard Disk

Start the console.
In the finder, select: Applications -> Utilities -> Console

You can manually start the daily, weekly or monthly defragmentation jobs by typing:
-> sudo periodic daily
-> sudo periodic weekly
-> sudo periodic monthly
or all at once
-> sudo periodic daily weekly monthly

You will be asked to type the super user password each time.
Please wait until the defragmentation is done.
Don‘t be disappointed if it takes only a few seconds, because your Mac starts this jobs periodically on its own.

2. Repair the file Access Rights

Access rights, that are not set correctly can slow down your Mac.
But don‘t worry. Your Mac has the tools to correct the access rights.
Start the Disk Utility.
In the finder, select: Applications -> Utilities -> Disk Utility

In the disk utility window, select the volume and klick the button „Repair access rights“
Please wait until the job is done.

3. Repair volume

In order to repair damages on you (main) volume you open the „Disk Utility“.
To be able to repair and not just analyse the volume however, you have to start the disk utility in another way as described above. Shut down your Mac and start it again while holding the keys cmd+r (all together). A window, where you select the disk utility, will show up.
Select the volume and click „Repair Volume“ and wait until the job is done. This can take a while.
Don‘t bother if you get some minor errors at this time. On my Mac they disappered the second time i repaired the volume.

4. Reset Cache

Shut down your Mac, stating it again keeping alt+cmd+r+p (all together) pressed.
The second time your Mac "bounces up", you release the keys and your Mac will start all the way up.

Shut down your Mac and start it again. If you got some minor errors while repairing the access rights or the volume, you can try repeating those steps. I my case, my Mac generated no errors the second time and the gain in speed was significant!

Have fun!

Donnerstag, 4. April 2013

Spin Heroku Dynos up and down programmatically

Does your customers sleep at night?
If they do, your software can do that as well ;-)

So why not spin the Heroky dynos down to 1 in the night and spin it up next morning again. One dyno is free of charge and your application will still be accessible with a bit larger load time when your app has „gone to sleep“ (swapped out on disc).
The load time, when in „sleep mode“, is aprox 30 seconds, but when it‘s up and running, it‘s ... up and running and will do so for a while until going back to sleep.
Spinning the dynos up and down programmatically is done with two rake tasks and the „Heroku Scheduler Standard“ add on, which is free of charge!

This is what you have to do:
  1. Add an environment variable „APP_NME“ with the name of your app.

    In the console: heroku config:set APP_NAME=myapp
    Check the settings in heroku.
    In the console: heroku config
  2. Add the gem „heroku-api“ to your gemfile.
Please note, that there is an older gem „herou“ to, but you should use the new one as it covers the new heroku api:
    gem "heroku-api", "~> 0.3.9"
  3. As you have to - once in a life time - manually confirm the billing of a second dyno, you have to spin up the dynos to more than 1, manually once.
    In the console: heroku ps:scale web=2
  4. Add the two rake tasks below to lib/tasks/scheduler.rake

    Please note that the heroku scheduler expects a file with the name „scheduler.rake“
    You find your heroku api key in the app settings on heroku!
  5. Add the free heroku add on „Heroku Scheduler Standard“ to your app.

    On the console: 
heroku addons:add scheduler:standard
  6. Test your rake tasks manually.
    In the console: heroku run rake spin_up
    And check the result.
    In the console: heroku ps
  7. Enter the appropriate settings in the heroku scheduler using the heroku web site.
    Please note, that the time entered is a UTC-Time (Coordinated Universal Time), which can differ from your local time. In most european countries the local time is UTC+1 in the winter and UTC+2 in the summer due to the summer time correction.

Content of lib/tasks/scheduler.rake

require 'heroku-api'
desc "Scale UP dynos. This task is called by the Heroku scheduler"
task :spin_up => :environment do
  puts "Spinn one dyno up..."
  heroku = => 'my_app_key')
  heroku.post_ps_scale(ENV['APP_NAME'], 'web', 2)
  puts "Done!"

desc "Scale DOWN dynos. This task is called by the Heroku scheduler"
task :spin_down => :environment do
  puts "Spinn one dyno down..."
  heroku = => 'my_app_key')
  heroku.post_ps_scale(ENV['APP_NAME'], 'web', 1)
  puts "Done!"

Sonntag, 2. September 2012

Mac OS X Wake On LAN (WOL)

Manny Mac user have problems getting WOL to work properly.
You often read, that WOL is only possible if a „Magic Packet“ is sent via LAN. Apparently this wont work via WLAN.
However some of us would like to wake up our Mac connected via WLAN with any Network access: A web request or a VNC connection. Not just by using special software like (the very good iPhone App) iNET.

Actually i didn‘t even manage to wake up my Mac Min with iNET, after it had went to sleep (slow flashing LED). When my Mac was sleeping iNET didn‘t even find it with a network scan.

Well, there is a solution to this, with a small drawback. I‘l get back to the drawback later.

If you have a look in the system information, you will find astonishing parameters, that you can change if you know where to find them.

Open the system information e.g. by clicking on the Apple in the upper left corner of your monitor. Then click „About this Mac“. Go on by clicking on „further information“ and then „System profiler.“
In the left pane under „Harwdare“, click on „Power“. On the right pane you find a parameter  „PrioritizeNetworkReachibilityOverSleep“, which is set to 0 (zero). You also find a parameter which tell in how many minutes the hard disk will go to sleep.

You wont find this settings on the GUI (System Preferences). You find them in the file
„/Library/Preferences/SystemConfiguration/“ which you can edit with a text editor. You do have to have root rights to do that however.
A very convenient editor for this type of work it TextWrangler, as it prompts you to „unlock“ the file, as you go.

I use my Mac Mini as a test web server, so i set the „PrioritizeNetworkReachibilityOverSleep“ as well as the „Disk Sleep Timer“ to 1.

After editing this file, you have to enter the system preferences clicking on „energy saver“ in the „Hardware“ section, checking „wake for network access“.

That‘s it!
Now my Mac shuts down the monitor and the hard dis after 1 minute and i can wake it up with any network access. In this type of sleep mode the LED is not slow flashing any more. Its solid. The Mac still appears when i do a network scan (with iNET).

The drawback is, that the cooling fan doesn‘t go to sleep.

When making a web request e.g. the Mac Mini fires up the hard disk at no time and everything is up and running. Note: This works over (W)LAN as well as internet using a port forwarding.

This is my configuration: internet -> router (FritzBox with port forwarding) -> WLAN -> Mac mini.

Have fun!

Montag, 25. Juni 2012

Ruby on Rails development in the Browser

The browser is developing more an more to an os, ide,...
This idea e.g. is great. Rails development completely in the browser:

Donnerstag, 24. Mai 2012

Start free for - a refrigeration management system

At the first of June 2012 we start operating, a management system for refrigeration units, as well as general actions taken on user defined objects.

For the refrigeration business, offers a complete management of master data, refrigeration units and used refrigerants. With the built in analyses  you can quick get an overview of the trend on used refrigerants e.g.
As all the data are optional, you are - if wanted - able to manage your units quite anonymous. is a multi lingual system. For the moment, the languages english, german, french, italian, polish, spanish and swedish are native supported.
We intend to implement approximately 30 languages.

State of the art technology has made it possible to keep the price very low. As we won‘t calculate any fee for the sole management, there is no reason more to use excel tables.

In a forthcoming extension of the system, we will integrate a document management system, where you can store you units documentation.

Startschuss für - ein Verwaltungssystem für Kälteanlagen

An dem 01.06.2012 geben wir den Startschuss für, ein Verwaltungssystem für sowohl Kälteanlagen als auch allgemeine Tätigkeiten an frei zu definierenden Objekten.

Für die Kältebranche bietet eine vollständige Verwaltung von Stammdaten, Anlagen und eingesetztes Kältemittel. Mit Hilfe der Auswertungen kann schnell der Trend z.B. in Sachen Leckagerate ermittelt werden.
Da alle Daten optional sind, kann - falls erwünscht - die Anlagen relativ „Anonym“ verwaltet werden. ist ein mehrsprachiges System. Zunächst werden die Sprachen English, Deutsch, Französisch, Italienisch, Polnisch, Spanisch und Schwedisch unterstützt. Das Ziel liegt bei Ca. 30 Sprachen.

Neuste Technik hat uns erlaubt, den Preis sehr niedrig zu halten. Da für de Verwaltung alleine keine Gebühren erhoben werden, gibt es jetzt kein Grund mehr Excel-Tabellen mehr zu nutzen.

In eine kommende Ausbaustufen, ist ein integriertes Dokument-Management-System geplant. In dem Archiv, kann z.B. Schaltpläne und ähnliches elektronisch hinterlegt werden.