Thursday, August 25, 2011

Imagine a gray 1984 like world without Linux

It would be a world wihout internet
without google
without twitter
without facebook
without spaceships
without Pixar and Dreamworks
without animated movies
without LOTR
without Harry Potter movies

without Wikipedia
without Android

without Debian

without Ubuntu


It all started with a small message 20 years ago and ended with World Domination




In an alternate universe borg won the war and all users are connected to exchange using only InternetExplorer 6.0 and all the fun is sending viruses and naked animated gifs with outlook and not Thunderbird



upgrading from ubuntu 9.04 to 9.10 (Jaunty to Karmic)

The upgrade
Please make sure you have the following sources.list (/etc/apt/sources.list remove all other entries you have there).

# Required
deb http://old-releases.ubuntu.com/ubuntu/ jaunty main restricted universe multiverse
deb http://old-releases.ubuntu.com/ubuntu/ jaunty-updates main restricted universe multiverse
deb http://old-releases.ubuntu.com/ubuntu/ jaunty-security main restricted universe multiverse
Update the package list and upgrade all the installed packages
sudo apt-get update && sudo apt-get dist-upgrade
Perform the release upgrade.
sudo do-release-upgrade

you will get an error
do-release-upgrade 
Checking for a new ubuntu release
Failed Upgrade tool signature
Failed Upgrade tool
Done downloading            
extracting 'jaunty.tar.gz'
Failed to extract
Extracting the upgrade failed. There may be a problem with the network or with the server. 
you can inspect the metadata for releases and you need to replace with release old-releases prefix (fixed by me)

to look like this for karmik (supported with old repository url)
Dist: karmic
Name: Karmic Koala
Version: 9.10
Date: Thu, 29 Oct 2009 12:00:00 UTC
Supported: 1
Description: This is the 9.10 release
Release-File: http://archive.ubuntu.com/ubuntu/dists/karmic/Release
ReleaseNotes: http://changelogs.ubuntu.com/EOLReleaseAnnouncement
UpgradeTool: http://archive.ubuntu.com/ubuntu/dists/karmic-proposed/main/dist-upgrader-all/0.126.9/karmic.tar.gz
UpgradeToolSignature: http://archive.ubuntu.com/ubuntu/dists/karmic-proposed/main/dist-upgrader-all/0.126.9/karmic.tar.gz.gpg

wget https://raw.github.com/gist/1170565/22117e03db295388b507c59ea3f84a11bc4e9ff0/metarelease.rvg -O /etc/meta-release.rvg

Modified /etc/update-manager/meta-release so that it pointed to my local file rather than the incorrect URI on the ubuntu site - here is what it looked like after my change:

[METARELEASE]
URI = file:///etc/meta-release.rvg
URI_LTS = http://changelogs.ubuntu.com/meta-release-lts
URI_UNSTABLE_POSTFIX = -development
URI_PROPOSED_POSTFIX = -proposed

I then ran do-release-upgrade and everything worked like a charm

Next is to upgrade to 10.04 LTS , you can follow the generic instructions , no tricks needed

upgrading from ubuntu 8.10 to 9.04 (Intrepid to Jaunty)

The upgrade
Please make sure you have the following sources.list (/etc/apt/sources.list remove all other entries you have there).

## EOL upgrade sources.list
# Required
deb http://old-releases.ubuntu.com/ubuntu/ intrepid main restricted universe multiverse
deb http://old-releases.ubuntu.com/ubuntu/ intrepid-updates main restricted universe multiverse
deb http://old-releases.ubuntu.com/ubuntu/ intrepid-security main restricted universe multiverse
Update the package list and upgrade all the installed packages
sudo apt-get update && sudo apt-get dist-upgrade
Perform the release upgrade.
sudo do-release-upgrade

you will get an error
do-release-upgrade 
Checking for a new ubuntu release
Failed Upgrade tool signature
Failed Upgrade tool
Done downloading            
extracting 'jaunty.tar.gz'
Failed to extract
Extracting the upgrade failed. There may be a problem with the network or with the server. 
you can inspect the metadata for releases and you need to replace with release old-releases prefix (fixed by me)

to look like this for jaunty
Dist: jaunty
Name: Jaunty Jackalope
Version: 9.04
Date: Thu, 23 Apr 2009 12:00:00 UTC
Supported: 1
Description: This is the 9.04 release
Release-File: http://old-releases.ubuntu.com/ubuntu/dists/jaunty/Release
ReleaseNotes: http://changelogs.ubuntu.com/EOLReleaseAnnouncement
UpgradeTool: http://old-releases.ubuntu.com/ubuntu/dists/jaunty-proposed/main/dist-upgrader-all/0.111.8/jaunty.tar.gz
UpgradeToolSignature: http://old-releases.ubuntu.com/ubuntu/dists/jaunty-proposed/main/dist-upgrader-all/0.111.8/jaunty.tar.gz.gpg

wget https://raw.github.com/gist/1170565/c6d5b3deece6f7451ec76419810d898eda0fadde/metarelease.rvg -O /etc/meta-release.rvg

Modified /etc/update-manager/meta-release so that it pointed to my local file rather than the incorrect URI on the ubuntu site - here is what it looked like after my change:

[METARELEASE]
URI = file:///etc/meta-release.rvg
URI_LTS = http://changelogs.ubuntu.com/meta-release-lts
URI_UNSTABLE_POSTFIX = -development
URI_PROPOSED_POSTFIX = -proposed

I then ran do-release-upgrade and everything worked like a charm

Sunday, August 21, 2011

Software Wars are updated now in git


I am a big fan of the Software Wars graphic map. 
Since it hasn’t been updated for years, MrTomLinux decided to recreate it from scratch in SVG 
and to share the files. [I have forked it in github https://github.com/mariuz/software_wars_map]
http://blog.mrtomlinux.org/index.php?pages/Software-Wars
You can open and edit the svg in Inkscape
http://www.inkscape.org



You can follow the changelog :
Google brought Motorola
Nokia failed in the smartphone market
Mono and all it's team is departing Novell under Miguel leadership


Thursday, August 18, 2011

optimizing kvm linux io/net performance

Start reading optimization tips from ibm and from main linux-kvm site
http://wiki.libvirt.org/page/Virtio

User kernel > 3.0.0 (for me dist upgrade from debian stable -> testing)

Start the vm with virtio for disk and cache=writeback
http://www.linux-kvm.org/page/Tuning_KVM
http://learnitwithme.com/?p=198
Mount ext3 with noatime and datawriteback

sudo tune2fs -l /dev/disk/by-label/ROOT | grep "mount options"
Default mount options:    journal_data_writeback
sudo tune2fs -o journal_data_writeback /dev/vda
and add it to the boot time

http://blog.smartlogicsolutions.com/2009/06/04/mount-options-to-improve-ext4-file-system-performance/


improve throughoutput using the deadline scheduler (you will have more bandwidth but latency will be worse for users and other apps)

echo deadline > /sys/block/vda/queue/scheduler

Monday, August 15, 2011

necessitas setup and test raycasting #QT demo on #android

I wanted to test the qt raycasting demo on my android and here are some steps and missteps that i have done in my research

I follow the sdk instructions from here

http://sourceforge.net/p/necessitas/wiki/How%20to%20install%20Necessitas%20SDK/

Download necessitas sdk for me is something like necessitas-0.2.1-online-sdk-installer-linux
chmod +x necessitas-0.2.1-online-sdk-installer-linux
./necessitas-0.2.1-online-sdk-installer-linux
I have enabled all options to be downloaded even the android ndk/sdk
my path is something like /home/mariuz/work/necessitas

Setup finished and downloaded all the files
next is to configure the qt creator
http://sourceforge.net/p/necessitas/wiki/Setup%20QtCreator/

The only changes that i needed to do is to add ant path in (is custom downloaded from apache.org and unziped in /opt)

Tools -+- Options -+- Android -+- Ant location : /opt/apache-ant-1.8.1/bin/ant



The other are left untouched
I have loaded the raycasting example
but i get an error and even if i downloaded the Ministro app from the google market (and QtCore is installed)
Starting remote process ...
Can't find eu.licentia.necessitas.industrius.example.raycasting process


Seems that :
The libraries downloaded by Ministro are different from the libraries in the Necessitas SDK (the dynamic linker in the emulator had problems that were fixed when I overwrote the Ministro libraries with the (stripped) libraries from the Necessitas SDK) – is this a known problem and will it be fixed?


So i have checked to deploy and copy the necessitas libs to the target when i run the app
but again it failed

Starting remote process ...
D/dalvikvm( 6883): Trying to load lib /data/data/eu.licentia.necessitas.industrius.example.raycasting/lib/libraycasting.so 0x45768998
I/dalvikvm( 6883): Unable to dlopen(/data/data/eu.licentia.necessitas.industrius.example.raycasting/lib/libraycasting.so): Cannot load library: link_image[1722]:  1125 could not load needed library 'libQtGui.so' for 'libraycasting.so' (load_library[1052]: Library 'libQtGui.so' not found)
I/Qt JAVA ( 6883): Can't load 'raycasting'
I/Qt JAVA ( 6883): java.lang.UnsatisfiedLinkError: Library raycasting not found
I/Qt JAVA ( 6883): 	at java.lang.Runtime.loadLibrary(Runtime.java:489)
I/Qt JAVA ( 6883): 	at java.lang.System.loadLibrary(System.java:557)
I/Qt JAVA ( 6883): 	at eu.licentia.necessitas.industrius.QtApplication.loadBundledLibraries(QtApplication.java:97)
I/Qt JAVA ( 6883): 	at eu.licentia.necessitas.industrius.QtActivity.startApplication(QtActivity.java:92)
I/Qt JAVA ( 6883): 	at eu.licentia.necessitas.industrius.QtActivity.access$000(QtActivity.java:62)
I/Qt JAVA ( 6883): 	at eu.licentia.necessitas.industrius.QtActivity$1$1.run(QtActivity.java:149)
I/Qt JAVA ( 6883): 	at android.app.Activity.runOnUiThread(Activity.java:3652)
I/Qt JAVA ( 6883): 	at eu.licentia.necessitas.industrius.QtActivity$1.libs(QtActivity.java:146)
I/Qt JAVA ( 6883): 	at eu.licentia.necessitas.industrius.QtActivity.startApp(QtActivity.java:221)
I/Qt JAVA ( 6883): 	at eu.licentia.necessitas.industrius.QtActivity.onCreate(QtActivity.java:297)
I/Qt JAVA ( 6883): 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
I/Qt JAVA ( 6883): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2466)
I/Qt JAVA ( 6883): 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2519)
I/Qt JAVA ( 6883): 	at android.app.ActivityThread.access$2200(ActivityThread.java:123)
I/Qt JAVA ( 6883): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1870)
I/Qt JAVA ( 6883): 	at android.os.Handler.dispatchMessage(Handler.java:99)
I/Qt JAVA ( 6883): 	at android.os.Looper.loop(Looper.java:123)
I/Qt JAVA ( 6883): 	at android.app.ActivityThread.main(ActivityThread.java:4370)
I/Qt JAVA ( 6883): 	at java.lang.reflect.Method.invokeNative(Native Method)
I/Qt JAVA ( 6883): 	at java.lang.reflect.Method.invoke(Method.java:521)
I/Qt JAVA ( 6883): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
I/Qt JAVA ( 6883): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
I/Qt JAVA ( 6883): 	at dalvik.system.NativeStart.main(Native Method)
D/dalvikvm( 6883): +++ not scanning '/system/lib/libwebcore.so' for 'startQtAndroidPlugin' (wrong CL)
D/dalvikvm( 6883): +++ not scanning '/system/lib/libmedia_jni.so' for 'startQtAndroidPlugin' (wrong CL)
D/dalvikvm( 6883): +++ not scanning '/system/lib/libexif.so' for 'startQtAndroidPlugin' (wrong CL)
D/dalvikvm( 6883): +++ not scanning '/system/lib/libtextrendering.so' for 'startQtAndroidPlugin' (wrong CL)
D/dalvikvm( 6883): +++ not scanning '/system/lib/libsrec_jni.so' for 'startQtAndroidPlugin' (wrong CL)
W/dalvikvm( 6883): No implementation found for native Leu/licentia/necessitas/industrius/QtApplication;.startQtAndroidPlugin ()V
D/AndroidRuntime( 6883): Shutting down VM
W/dalvikvm( 6883): threadid=3: thread exiting with uncaught exception (group=0x40026160)
E/AndroidRuntime( 6883): Uncaught handler: thread main exiting due to uncaught exception
E/AndroidRuntime( 6883): java.lang.UnsatisfiedLinkError: startQtAndroidPlugin
E/AndroidRuntime( 6883): 	at eu.licentia.necessitas.industrius.QtApplication.startQtAndroidPlugin(Native Method)
E/AndroidRuntime( 6883): 	at eu.licentia.necessitas.industrius.QtApplication.startApplication(QtApplication.java:158)
E/AndroidRuntime( 6883): 	at eu.licentia.necessitas.industrius.QtActivity.startApplication(QtActivity.java:132)
E/AndroidRuntime( 6883): 	at eu.licentia.necessitas.industrius.QtActivity.access$000(QtActivity.java:62)
E/AndroidRuntime( 6883): 	at eu.licentia.necessitas.industrius.QtActivity$1$1.run(QtActivity.java:149)
E/AndroidRuntime( 6883): 	at android.app.Activity.runOnUiThread(Activity.java:3652)
E/AndroidRuntime( 6883): 	at eu.licentia.necessitas.industrius.QtActivity$1.libs(QtActivity.java:146)
E/AndroidRuntime( 6883): 	at eu.licentia.necessitas.industrius.QtActivity.startApp(QtActivity.java:221)
E/AndroidRuntime( 6883): 	at eu.licentia.necessitas.industrius.QtActivity.onCreate(QtActivity.java:297)
E/AndroidRuntime( 6883): 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
E/AndroidRuntime( 6883): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2466)
E/AndroidRuntime( 6883): 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2519)
E/AndroidRuntime( 6883): 	at android.app.ActivityThread.access$2200(ActivityThread.java:123)
E/AndroidRuntime( 6883): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1870)
E/AndroidRuntime( 6883): 	at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 6883): 	at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime( 6883): 	at android.app.ActivityThread.main(ActivityThread.java:4370)
E/AndroidRuntime( 6883): 	at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 6883): 	at java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime( 6883): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
E/AndroidRuntime( 6883): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
E/AndroidRuntime( 6883): 	at dalvik.system.NativeStart.main(Native Method)
E/SemcCheckin( 6883): Get crash dump level : java.io.FileNotFoundException: /data/semc-checkin/crashdump
I/dalvikvm( 6883): threadid=7: reacting to signal 3
E/dalvikvm( 6883): Unable to open stack trace file '/data/anr/traces.txt': Permission denied
I/Process ( 6883): Sending signal. PID: 6883 SIG: 9
'eu.licentia.necessitas.industrius.example.raycasting' died


Starting remote process ...
Can't find eu.licentia.necessitas.industrius.example.raycasting process

Read the section with local libs
So i started clean with the smallest qt demos (simple editor with menu that comes with qt)

The secret to start it is to make sure for emulator that arm5 is choosen
also the run Project options should contain that necessitas libs should be delpoyed with the project at once

After that i did rebuild project and run
voila




After that i have tested the raycasting using the same staps as above arm5+ delploy local qt libs +use local qt libs
and it ran !



It started on sony xperia 8 but of course there is no buttons setup , and this should be the part two of the article :)

Starting remote process ...
D/dalvikvm( 8338): Trying to load lib /data/local/qt/lib/libQtCore.so 0x45910998
D/dalvikvm( 8338): Added shared lib /data/local/qt/lib/libQtCore.so 0x45910998
D/dalvikvm( 8338): No JNI_OnLoad found in /data/local/qt/lib/libQtCore.so 0x45910998
D/dalvikvm( 8338): Trying to load lib /data/local/qt/lib/libQtGui.so 0x45910998
D/dalvikvm( 8338): Added shared lib /data/local/qt/lib/libQtGui.so 0x45910998
D/dalvikvm( 8338): No JNI_OnLoad found in /data/local/qt/lib/libQtGui.so 0x45910998
D/dalvikvm( 8338): Trying to load lib /data/local/qt/plugins/platforms/android/libandroid-5.so 0x45910998
D/dalvikvm( 8338): Added shared lib /data/local/qt/plugins/platforms/android/libandroid-5.so 0x45910998
I/Qt      ( 8338): qt start
D/dalvikvm( 8338): Trying to load lib /data/data/eu.licentia.necessitas.industrius.example.raycasting/lib/libraycasting.so 0x45910998
D/dalvikvm( 8338): Added shared lib /data/data/eu.licentia.necessitas.industrius.example.raycasting/lib/libraycasting.so 0x45910998
I/Qt      ( 8338): qt start
D/Qt      ( 8338): startQtApp 
D/Qt      ( 8338): environmentString "HOME=/data/data/eu.licentia.necessitas.industrius.example.raycasting/files	TMPDIR=/data/data/eu.licentia.necessitas.industrius.example.raycasting/files	QT_IMPORT_PATH=/data/local/qt/imports	QT_PLUGIN_PATH=/data/local/qt/plugins" ("HOME=/data/data/eu.licentia.necessitas.industrius.example.raycasting/files", "TMPDIR=/data/data/eu.licentia.necessitas.industrius.example.raycasting/files", "QT_IMPORT_PATH=/data/local/qt/imports", "QT_PLUGIN_PATH=/data/local/qt/plugins") 
D/Qt      ( 8338): paramsString "QtApp	-platform	android" 
W/Qt      ( 8338): WARNING: QApplication was not created in the main() thread.
I/Qt JAVA ( 8338): surfaceChanged: 480,295
D/Qt      ( 8338): QAndroidPlatformIntegrationPlugin::create "android" 
D/Qt      ( 8338): QFbScreen::setPhysicalSize QSize(119, 79) 
D/Qt      ( 8338): QFbScreen::setGeometry QRect(0,0 480x295) 
D/Qt      ( 8338): QAndroidPlatformScreen::QAndroidPlatformScreen():QFbScreen() 
D/dalvikvm( 8338): GC freed 1092 objects / 78856 bytes in 481ms
D/Qt      ( 8338): createPlatformWindow false 
D/Qt      ( 8338): setFullScreen false 
D/Qt      ( 8338): keyDown 
D/Qt      ( 8338): keyUp 
D/Qt      ( 8338): keyDown 
I/Qt JAVA ( 8338): surfaceDestroyed 
W/IInputConnectionWrapper( 8338): showStatusIcon on inactive InputConnection

'eu.licentia.necessitas.industrius.example.raycasting' died

Starting remote process ...
D/dalvikvm( 8615): Trying to load lib /data/local/qt/lib/libQtCore.so 0x45768998
D/dalvikvm( 8615): Added shared lib /data/local/qt/lib/libQtCore.so 0x45768998
D/dalvikvm( 8615): No JNI_OnLoad found in /data/local/qt/lib/libQtCore.so 0x45768998
D/dalvikvm( 8615): Trying to load lib /data/local/qt/lib/libQtGui.so 0x45768998
D/dalvikvm( 8615): Added shared lib /data/local/qt/lib/libQtGui.so 0x45768998
D/dalvikvm( 8615): No JNI_OnLoad found in /data/local/qt/lib/libQtGui.so 0x45768998
D/dalvikvm( 8615): Trying to load lib /data/local/qt/plugins/platforms/android/libandroid-5.so 0x45768998
D/dalvikvm( 8615): Added shared lib /data/local/qt/plugins/platforms/android/libandroid-5.so 0x45768998
I/Qt      ( 8615): qt start
D/dalvikvm( 8615): Trying to load lib /data/data/eu.licentia.necessitas.industrius.example.raycasting/lib/libraycasting.so 0x45768998
D/dalvikvm( 8615): Added shared lib /data/data/eu.licentia.necessitas.industrius.example.raycasting/lib/libraycasting.so 0x45768998
I/Qt      ( 8615): qt start
D/Qt      ( 8615): startQtApp 
D/Qt      ( 8615): environmentString "HOME=/data/data/eu.licentia.necessitas.industrius.example.raycasting/files	TMPDIR=/data/data/eu.licentia.necessitas.industrius.example.raycasting/files	QT_IMPORT_PATH=/data/local/qt/imports	QT_PLUGIN_PATH=/data/local/qt/plugins" ("HOME=/data/data/eu.licentia.necessitas.industrius.example.raycasting/files", "TMPDIR=/data/data/eu.licentia.necessitas.industrius.example.raycasting/files", "QT_IMPORT_PATH=/data/local/qt/imports", "QT_PLUGIN_PATH=/data/local/qt/plugins") 
D/Qt      ( 8615): paramsString "QtApp	-platform	android" 
W/Qt      ( 8615): WARNING: QApplication was not created in the main() thread.
I/Qt JAVA ( 8615): surfaceChanged: 480,295
D/dalvikvm( 8615): GC freed 939 objects / 72968 bytes in 177ms
D/Qt      ( 8615): QAndroidPlatformIntegrationPlugin::create "android" 
D/Qt      ( 8615): QFbScreen::setPhysicalSize QSize(119, 79) 
D/Qt      ( 8615): QFbScreen::setGeometry QRect(0,0 480x295) 
D/Qt      ( 8615): QAndroidPlatformScreen::QAndroidPlatformScreen():QFbScreen() 
D/Qt      ( 8615): createPlatformWindow false 
D/Qt      ( 8615): setFullScreen false 
D/Qt      ( 8615): keyDown 
D/Qt      ( 8615): keyUp 
D/Qt      ( 8615): keyDown 


250 lines of Qt C++ code for Wolfenstein-esque of raycasting (labs.qt.nokia.com)


I saw this tweet about an old qt raycasting example running on nokia  
code is in graphics dojo
git clone git://gitorious.org/qt-labs/graphics-dojo.git
cd graphics-dojo/raycasting
qtcreator raycasting.pro
press run

You can inspect the code directly on gitorious 
I will try to see if it works on my android using necessitas

Sunday, August 07, 2011

Going back to #Debian testing is easy

I had some problems with latest cups in debian 1.4.8
so i have removed the cups from synaptic and wanted to switch back  to a more stable env

replace the unstable string with testing in

cat /etc/apt/sources.list
deb http://ftp.us.debian.org/debian/ testing main
deb-src http://ftp.us.debian.org/debian/ testing main

deb http://ftp.us.debian.org/debian/ testing non-free
deb-src http://ftp.us.debian.org/debian/ testing non-free

deb http://ftp.us.debian.org/debian/ testing contrib
deb-src http://ftp.us.debian.org/debian/ testing contrib

record all the packages that you have for posterity

sudo dpkg --get-selections > dpkglist.txt

remove some packages that offend your desktop eg some gnome3 ones or cups

then is time to restore the package list as it was before removal and update


sudo dpkg --set-selections < dpkglist.txt
sudo apt-get -y update
sudo apt-get dselect-upgrade
Now is time to reinstall cups
sudo apt-get install cups hplip