Friday, March 27, 2015

Learning to have a break and relax during a day

This time a bit different view for a hacker's life in Finland.

I have never been at my best in the social situations or presenting things oral way. That is probably the thing that made me to use computer a lot since I was kid. I was happy to see videos from stuttering people who also feel singing is the way to express yourself and relax. Here's another way to take a break during a day when your thinking feels jammed. My blogging style is flow-based and so is the quality of the recording. Tips for easy improvements for lighting and colors with mobile phone are welcome. Or then my phone just has a great monkeyfilter(tm).

Sunday, January 25, 2015

Hello World!

It's been a long time since I last time wrote to this blog. Had kind of lost interest to study new things and decided to just stick with Python/Django world in web development. However, I got interested how to do realtime or responsive web applications. There are ways to do it with Django but things get overly complicated because the Python standard WSGI doesn't support realtime communication. New HTML5 standard way to do realtime communication is to use Websockets [1]. I tried first to find a way how that could be done using Django but because the nature of WSGI, the best solution found was this solution, Django with websocket implementation using Redis as a message queue by Jacob Rief. In my opinion, quite innovative solution. But still after trying it, I had a feeling it was hacky and I want to find better way to do web application that can handle realtime features if there would be needs for that kind of features nowadays.

My workmates got interested in the new Meteor framework when it reached finally 1.0 version. I instantly tried it myself because I heard it before and it's fundamental new full stack Javascript approach and data-on-wire idea. Real time by nature, cool! What disappointed me was that it only supports MongoDB currently and it is quite "closed package", there is package management system for Meteor but the community and variety of packages for Meteor just beginning to form.

Meteor is nice all-in-one package if that is what it you want. Certainly the next evolution step and the best full stack framework for Javascript/Node.js that tries to achieve end-to-end Javascript codebase bringing backend and frontend development closer to each other.

However, not everyone needs templating and frontend tools in the same package. I kind of want to keep them separate nicely. When doing the whole project by yourself you don't run to problems how to integrate the backend work with designers frontend work but when working in team with designer you face this problem quite quickly.

When living in the world where people have nowadays many different gadgets they use, designers need to define responsive interfaces or totally different interfaces for applications. Also it is quite common that one application uses several web services through API, functions that provide access to web services data. By understanding this, and creating architecture where the underlying service only provides data through API, backend and frontend developers co-operation just became a lot easier, frontend developer (or designer) doesn't need to know about the underlying server backend architecture. Frontend developer can use his favourite Javascript framework or libraries to develop application and concentrate on the User experience and interfaces while backend server hacker can use his time to make most to provide great and easy-to-use APIs to his complicated server systems.

This is where I am aiming next. I have used lots of time to find the best possible frameworks to learn that would be flexible for reaching this kind of architecture. Django REST Framework is great tool for creating APIs but as I would like that architecture to support realtime communication more easily, I decided to look for Node.js framework for REST APIs. I found Loopback by Strongloop as most promising tool for creating REST API with Node.js. As for client side framework for application frontend, I have decided to learn AngularJS. Also the designing and modern frontend developing is very new to me, so the learning will be a bit more on the frontend side. The easiness to integrate the frontend with the backend service will be interesting. I will probably try with some easy example, for example frontend application for Poem service. I could use my old Poem book application idea, but build backend service with Loopback and the application frontend with AngularJS.

Lets see how this goes. I try to remember to write how I am proceeding.

[1] Websocket,
[2] WSGI,
[3] Meteor,
[4] API,
[5] REST,

Thursday, January 10, 2013

New Year 2013: New goals & technologies

Brave new year 2013 and new goals for technology learnings:

Last year's focus for my self-learning was web development and my choice was Python & Django.
Django will definitely stay in my toolbox as a good framework.

This year I continue the web development learning but try to focus more on Javascript. This includes Node.js related technologies and learning the full-stack Javascript development & debugging.

Monday, December 10, 2012

Karaoke Fun: PyKaraoke & Raspberry Pi

What to do when you have Raspberry Pi, only one memory card & too much ideas?

Get another memory card! So I bought another memory card to not mess with RaspBMC set up.
Last Sunday karaoke machine workaround went like this:

1. If you don't Raspbian image on the memory card already, do so.
2. Install PyKaraoke from Raspbian repos
    sudo apt-get install pykaraoke
3. Configure PyKaraoke to search songs from your karaoke song folder. PyKaraoke supports wide variety of different formats [1].
4. Configure PyKaraoke to start automatically on the startup:
    sudo nano /etc/xdg/lxsession/LXDE/autostart
    Add @pykaraoke_mini to the end of autostart program list.
5. Boot the Pi to test the setup and have Karaoke fun :)

PyKaraoke Mini is a simple frontend that has only a list of all karaoke songs, so it is simple and easy to use after the configuration is done. The full frontend has all features where it is easier to configure playlists etc. but it doesn't suit as well to easy karaoke fun usage.

P1: The Pi
P2: PyKaraoke Mini main view, the song list
P3: Playing the karaoke
[1] PyKaraoke,

Tuesday, October 9, 2012

From Raspidy to RaspBMC

Work is work but spare time goes to Raspberry Pi hacking :)

I found out RaspBMC more interesting piece of software, mainly because greater community support and libspotify appeared to be a showstopper without support for hard float point. However nowadays it's ridiculously easy for a customer to change music service subscription, if someone else gives better support, thanks to a good competitor Grooveshark. After a short testing with Grooveshark Anywhere in mobile and RaspBMC, I decided to go with that at least for while until Spotify reacts in Idea Exchange, the place where they pointed us desperate Raspberry Pi hobbyists to go yelling ;) Grooveshark has some serious problems with the user interface and especially the search, it seems that their song data is more loosely categorized than in Spotify which makes the search more inefficient than in Spotify. Anyway the web client approach that they have is very interesting and really worth for testing as a web developer.

RaspBMC worked for my surprise very nicely out of the box and installation with python script installer couldn't been easier. I decided use RaspBMC mainly as a web service/stream box.

  • For photos I have Picasa addon to enjoy photos on a TV screen. Some stability issues in the plugin though, maybe memory usage, because didn't happen in Ubuntu XBMC installation on laptop.
  • For music I use now Grooveshark with own playlists and for internet radio. Both work very well. 
  • For video services I have Youtube, 1Channel and Project Free TV addons. Buffering is a bit annoying issue with some videos in 1Channel and Project Free TV because of video services they use and also connection and speed may be issue here. Mostly works nicely though :) 
I find that those currently cover quite nicely what a home media box should: Photos, Music, Videos.
Talking about the Pi setup, I have the Pi in ModMyPi black box. Cable connections needed are HDMI to TV for UI and audio, power adapter. Then for two USB inputs I have WiFi nano dongle and wireless desktop receiver for keyboard/mouse.

As for the price, I am pretty sure there are not this cheap solutions on the market if one wants a home media center. For future improvements some ideas:

  • Attaching storage for TV recordings and enabling TV recording with PVR addons.
  • Remote controlling, server style usage without need for screen for music playing
  • Learn to write XBMC addons, for example Picasa/Google Photos would need improving.
  • Making the box more portable and wireless for possible party use elsewhere :)
The evolution of home media center's.
The one above is for sale, nice AMD humming for your living room :)

Sunday, September 23, 2012

Raspidy - Music server project

I found a more interesting idea for RPi project which complements with my music hobby. I have now done a small background research for the project.
The project core components are:
  • Mopidy [1][4]
  • webserver(Apache, nginx, monkey)
  • Python, Django, django-mpd-client [2]
Raspidy will be a small portable Spotify music server that needs only speakers from audio output & power supply. For network connection I will first use a small WiFi dongle at first phase. For even more portability a small 3G modem would be a nice try later. Raspidy name comes from mixing Raspberry Pi and Mopidy.

Mopidy is an MPD music server  that includes Spotify support with pyspotify/libspotify. As Mopidy is an MPD server, I need a client to use it. Django-mpd-client is designed to work with mobile browsers. Therefore it's perfect solution to command a music server. I have not yet decided webserver. Apache would be default choice but I would like to research also web servers more suitable for RPi such as nginx or monkey [3].

Raspidy project aims for easy Spotify music remote control with django-mpd-client.

[1] Mopidy,
[2] django-mpd-client,
[3] Monkey vs Nginx
[4] MopidyonRaspberryPi,

Wednesday, July 18, 2012

Rooting Samsung Galaxy S2 i9100 with Android 4.0.3

For every web developer it comes handy to modify hosts-file for testing/demoing purposes. I wanted to test my Django project also on my Android phone to verify the mobile usage. For modifying the system files you however need the root privileges on Android and for that you need rooted kernel.

The rooting itself is just flashing the kernel on the phone, quite easy and quick operation but took time to find the right kernel and a tool for a Linux machine. Most of the info you find by searching is for Odin on Windows. For Linux machines you can't use Odin but there is Heimdall, cmd-line tool for that.
Ready for rooting?


1. Check your kernel version from Settings, Phone info, Kernel version. In my case this is 3.0.15-I9100XWLP7-xxxx.. IMPORTANT: This instructions is only for Android 4.0.3 with kernel 3.0.15-I9100XWLP7-xxxx..
2. Download the root kernel from the download link [2] and extract the zip and then the tar until you have 'zImage'
3. Download and install Heimdall from github [1]. Select the right package for your operating system. On Ubuntu/Debian select the newest deb-package. Note! Heimdall is cross-platform, for Win, Mac & Linux.
4. Connect your phone with USB to the PC and follow the rooting instructions with Heimdall by MrZammler(Winterland) [3]. Remember to verify that the device is detected before flashing.

Congratulations, your phone is rooted! For me searching this info was the biggest task, rooting itself was quite fast & easy operation. I hope this collected info helps someone :)