The blog has moved. Go there!

torstai 31. heinäkuuta 2014

"App not installed" error message on Android

If you got the "App not installed" error message when installing an APK manually, you are probably a software developer who accidentally run cordova build --release android instead of cordova build android.

The problem is that you try to install an APK which claims to be release version but is not signed. If you don't want to sign the package, the you should create a debug package. Not a big difference, but in Android's point of view release package that isn't signed looks like fraud.

So, just run cordova build android and you should be fine.

tiistai 25. helmikuuta 2014

SOLVED: "Unsatisfied dependency: Crypto"

Check the updated post here.

I wanted to install yle-dl on my Mac OSX Mavericks. I run the following command according to the installation instructions at yle-dl Github repository's installation instructions.
brew install python && pip install pycrypto && brew install yle-dl
The series of commands failed with the following error message:
"Unsatisfied dependency: Crypto"
The solution was to install rtmpdump before installing yle-dl, osimoilleen näin:
brew install python && pip install pycrypto && brew install rtmpdump && brew install yle-dl 

sunnuntai 9. helmikuuta 2014

How to purge IndexedDB databases in Google Chrome

See the updated post here.

To remove all Chrome IndexedDB databases run the following in OSX terminal emulator.

rm -rf ${HOME}/Library/Application\ Support/Google/Chrome/Default/IndexedDB/*

Now restart your browser and that's it.

Because I need to purge IndexedDB databases very often, I have set up an alias in my ~./bash_profile.

alias purge-idb="rm -rf ${HOME}/Library/Application\ Support/Google/Chrome/Default

torstai 23. tammikuuta 2014

My first Jolla / Sailfish App, Personal Travis, Released!

My personal trainer app called Personal Travis (Personal Raineri in Finnish) has already been released in Google Android Play Store, but now it is also available for Sailfish OS in Jolla Harbour.

tiistai 21. tammikuuta 2014

Personal Raineri now also in English: Personal Travis

Personal Raineri (beta) is now also in English, and it's available in Android Store for free. In the English-speaking world Personal Raineri is and will be known as Personal Travis the Trainer.

keskiviikko 1. tammikuuta 2014

Using rsync as drop-in replacement for scp

Everyone knows that scp is secure. Everyone also knows that rsync isn't that secure but it's handy. It can e.g. resume interrupted file transfers. It would be nice if those two pros could be combined in one package.

Well, it's possible. Just put the following lines at the bottom of your ~/.bashrc or ~/.bash_profile.
alias rscp="rsync -avzP"
alias rscp-resume="rsync --partial --progress --rsh=ssh"
Reload your BASH (you could for example log out and back in), and you are able to use a command rscp just like scp. You are also able to resume interrupted file transfers by rerunning the interrupted command but putting rscp-resume instead of rscp.

Let me give an example. If your file transfer just failed with command rscp foo.txt user@domain.tld:bar/, just run rscp-resume foo.txt user@domain.tld:bar/ to continue the file transfer.

sunnuntai 22. joulukuuta 2013

Installing Sailfish OS on Nokia N9 using Ubuntu 12.04 LTS

In this blog post I'm going to tell, how I installed Sailfish OS (the OS of Jolla Phones) on my Nokia N9. If you have basic knowlege of Linux, I recommend trying. But only if you acknowledge the risks. I won't be responsible in any way, if you break your phone. So don't try this at home, if you don't know that your phone could be permanently damaged.

Please note that for the first try I failed the bootloader installation. I guess that many of those installing Sailfish OS at this stage will fail it, so see my solution at the bottom of this blog post. After solving the bootloader problem I got Sailfish OS up and running on my Nokia N9.

Why I was ready to take the risk?

I love the design of Nokia N9.  It's simplistic, beautiful, and its white-on-black UI is wonderful. I don't like the idea that there is a box (= screen) in which elements are showed. I want the elements to appear on my phone. No boxes, please. And of course, it was Linux. The opennes let me do anything with the phone, such as modify its behaviour and of course fix malfunctions. Surprisingly, in the era of Apple and Microsoft, ability to fix stuff is luxurious.

This all made me fall in love with N9. But I heard, that Nokia will stop supporting N9, so I didn't buy it. This lead me to one of the biggest mistakes in my life. Nokia Lumia 800 had generally the same design and the UI was white-on-black style. I didn't want to be ideologic and abandon a good phone just because of hating Microsoft categorically. That's why I bought a Nokia Lumia 800. It was terrible. I should have been ideological and fanatic. No Microsoft stuff for me anymore. Ever.

For luck one of my friends broke his N9. I opened it and repaired it, changed a few components and was able to make the N9 function again. MeeGo was old and not supported anymore. But for luck, there was already company called Jolla founded on the ashes of Nokia. It's wonderful that Nokia stopped developing MeeGo and fired those engineers, because Nokia would probably have been too big and unflexible to develop a community-driven operating system. Now those engineers have a company of their own, and they are developing Sailfish OS based on MeeGo. I wanted my N9 to run Linux-based operating system with updates. I think that Sailfish OS on N9 is much cooler than on the original Jolla Phone. Well, I will also buy Jolla Phone anyway.

If you want to install Sailfish OS on your N9, I advise you to follow the instructions at Maemo Wiki. I made these notes to help someone who is struggling with the Maemo Wiki tuturial. Of course, it's quite general and supports many platforms, so there aren't e.g. detailed commands. So, these notes are written to give some hints, how to walk through the installation process. This is just how I did it. I hope this is useful for someone. Please ask if you need help, maybe we manage to figure the things out.

Reflashing N9 to factory firmware

I followed the instructions in Maemo Wiki. I didn't backup anything, because there was nothing to lose on my phone. Btw, I always use ~/Temp as my working directory.

First I downloaded the flasher and installed it.
cd ~/Temp && wget && sudo dpkg -i flasher_3.12.1_i386.deb
Then I downloaded the necessary image files to be flashed. For the first time flashing N9 I was confused with Firmware and EMMC. The role of those files wasn't very well explained anywhere, and I didn't know where to get the proper files. I also didn't know did it matter, which file I downloaded. The good news is, that of course it does matter, but not much. It's enough to download any of these *tar.gz packages, and all the necessary files are included. If you are interested in getting further information, you can find such stuff here. I decided to use Swedish Country Variant, since I wasn't able to find anything referring Finland, when using CTRL + F.
wget && tar xf 059L7N7_N9\ RM-696\ Country\ Variant\ Sweden\ SE\ Magenta.tar.gz
The result was a folder with a dozen files.
erkkimon@lappy:~/Temp$ ls 059L7N7_N9\ RM-696\ Country\ Variant\ Sweden\ SE\ Magenta
I renamed (plus moved to ~/Temp) two files which I was going to flash on my N9 to make things clearer and to avoid typing mistakes. 
mv 059L7N7_N9\ RM-696\ Country\ Variant\ Sweden\ SE\ Magenta/D6C9C818_DFL61_HARMATTAN_40.2012.21-3.339.1_EMMC_339.bin ./emmc.bin && mv 059L7N7_N9\ RM-696\ Country\ Variant\ Sweden\ SE\ Magenta/A0E9827F_DFL61_HARMATTAN_40.2012.21-3.339.2_PR_LEGACY_339_ARM_RM-696_PRD_signed.bin ./main.bin
At this stage, I ensured, that my phone was fully shutdown, pressing power switch for at least 10 seconds. I also made sure that my phone was not connected with my laptop. Then I run the following command in ~/Temp.
sudo flasher -F main.bin -F emmc.bin -f
As the terminal said "Suitable USB interface (bootloader/phonet) not found, waiting..." I connected the phone to my Ubuntu laptop with the USB cable. The flashing began immediately. I went to take a cup of coffee, and after half an hour the flashing was done. I didn't disconnect my phone or touch it.

Flashing the OpenMode

I downloaded OpenMode kernel running the following command in ~/Temp.
Then I flashed the new kernel in my N9. I still had the N9 connected, and I hadn't touched the phone at all after the previous flashing session.
sudo flasher -a main.bin -k zImage_2.6.32.54-openmode_l2fix --flash-only=kernel -f -R
Now my N9 booted up. I typed in the PIN code, set the language and time, etc. The phone seemed to be working properly. I also logged in with my Nokia Account to be able to install stuff. This is necessary to enable developer mode, which requires installing a few packages.

Enabling developer mode

I enabled N9:s developer mode just switching it on at Settings -> Security -> Developer Mode. The phone wanted to install packages, and I naturally allowed to install them. The phone rebooted. After it was up again, I shut it down and disconnected the phone.

Repartitioning the N9

I downloaded the kernel used for partitioning the phone.
It needed to be extracted to use the kernel image in the RPM package.
I started the flashing process.
sudo flasher -k moslo- -n moslo- -l -b
When the terminal told me flasher to be waiting for a flashable device to be connected, I connected the phone to my laptop with the USB cable. Flashing was pretty soon done, and the phone booted up with a message which told, that the phone was partitioned, and that it wasn't advised to unplug or shutdown the phone.

As there was text "Re-partitioning succesful! Rootfs of AlternateOS now exported via USB. You can telnet into" on the screen of N9, I unplugged the phone and shut it down completely.

Installing Ubiboot

I downloaded the ready Ubiboot bootloader package preconfigured to boot Sailfish OS and Harmattan.
I was still in ~/Temp. I extracted the package.
tar xf ubiboot-02_0.3.5_131213_SFOS.tar 
I connected my phone with USB cable to my computer. The phone booted, and after entering my PIN code it asked, if I wanted to use N9 as mass storage. I pressed "Use as mass storage" on the screen of my mass storage. Now I opened the file manager and opened Nokia N9. I dragged ~Temp/ubiboot-02_0.3.5_131213_SFOS.tar to the root of Nokia N9. Then I unmounted the Nokia N9 drive and then unplugged it.

I needed to reboot the phone to be able to find the file which I uploaded just a moment ago. Anyway, I after the reboot I was able to find the file in ~/MyDocs/ubiboot-02_0.3.5_131213_SFOS.tar with my N9's terminal emulator.

In my N9's terminal I logged in as root.
I typed rootme as the password, which is the default password in Meego phones. Then I extracted ubiboot-02_0.3.5_131213_SFOS.tar in the proper location.
cd /home/user/MyDocs/ && tar -xvf ubiboot-02_0.3.5_131213_SFOS.tar -C /
Then I started flashing again. I switched my N9 off and at this time, my phone was unplugged. On my laptop, I run the following command.
sudo flasher -a main.bin -k zImage_2.6.32.54-ubiboot-02_301013 --flash-only=kernel -f -R
Then I plugged in my N9. The flashing was done quickly. When it was done, I left the phone plugged, and didn't shut it down.

Installing Sailfish

I started downloading the Sailfish package. On my laptop, I commanded the following.
I renamed vgrade-sailfish_r4.tar.bz2.
mv vgrade-sailfish_r4.tar.bz2 sailfish.tar.bz2
I made sure that a storage called Alt_OS was mounted. Then I extracted Sailfish OS on my N9 in a proper location.
tar --numeric-owner -xvjf sailfish.tar.bz2 -C /media/Alt_OS/
This took about 5–10 minutes to finish.

Gaining SSH root access to Sailfish OS

The first step was to enable root login to N9. That was done editing sshd configuration of N9/Sailfish i.e. uncommenting "PermitRootLogin yes" line.
sudo sed -i 's/#PermitRootLogin Yes/PermitRootLogin Yes/ig' /media/Alt_OS/etc/ssh/sshd_config
Then to reset the root password. I naturally backed up the /etc/shadow before messing around with it.
sudo cp /media/Alt_OS/etc/shadow /media/Alt_OS/etc/shadow.orig
Then I reset the password.
sudo su -c 'sed -e "s/^\(root:\)[^:]*:/\1:/" /media/Alt_OS/etc/shadow.orig > /media/Alt_OS/etc/shadow'
From now on, I didn't have root password. I was ready to boot up my Sailfish OS. I unplugged my N9, shut it down, and powered it on.

Setting root password for Sailfish OS

This time everything didn't go as expected. I got the following error message on the screen of my N9.
Boot menu script not found! Please run a maintenance boot.
I checked if there was something wrong in my setup. I checked if there was useful info info in the tutorial section, which concerned installing unpreconfigured Ubiboot. According to it, there should have been zImage_2.6.32.54-openmode_l2fix in /media/rootfs/boot/. There should also have been ubiboot.conf and ubiboot-02.035_SF_v1.cpio in /media/Nokia\ N9/boot/.

Well, it was time to do something for these drawbacks. For luck, I naturally had all those files on my disk already. I mounted the volumes Nokia N9 and rootfs with my file manager and commanded the following in my working directory ~/Temp.
sudo cp zImage_2.6.32.54-openmode_l2fix /media/rootfs/boot/
Then I extracted the files in ububoot package and moved the needed files to proper place.
tar xvf ubiboot_035_sailfishos.tar && sudo cp home/user/MyDocs/boot/ubiboot* /media/Nokia\ N9/boot/
Now, I unmounted the volumes, unplugged the phone, shut down the phone, and powered it on. And voila, I had a booting Sailfish OS!

EDIT: After testing Sailfish for a while

After having slept over night I have done some testing during the day. Sailfish is usable, and basic functionality is okay. I already dumped my Lumia 800 and use N9 as my primary phone. If you have a working MeeGo, you probably don't want to install Sailfish yet. But the Sailfish N9 port is so promising that I'm quite sure nearly all N9 owners will be able to use Sailfish as their primary OS. Here are some results so far.