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

Sunday, July 31, 2011

openmelody cms install tips on #debian #ubuntu

unzip it in /var/www

i have the folder melody

edit the default root folder to accept cgi-bins executables by default
in /etc/apache2/sites-enabled/000-default
add this way the +ExecCGI to the Options

http://paste.ubuntu.com/652977/

uncomment

#AddHandler cgi-script .cgi

in /etc/apache2/mods-available/mime.conf

and then restart the apache server
sudo /etc/init.d/apache2 restart

install optional modules
apt-get install libcrypt-openssl-dsa-perl libcrypt-ssleay-perl
sudo apt-get install libcache-memcached-perl
sudo apt-get install libarchive-zip-perl
sudo apt-get install libxml-atom-perl
sudo apt-get install libproc-processtable-perl
sudo apt-get install libgd-gd2-perl

Wednesday, July 20, 2011

kwaak3 compiling for android 2.x

check out the source code

svn checkout http://kwaak3.googlecode.com/svn/trunk/ kwaak3

install sdl headers
sudo apt-get install libsdl-1.2-dev

cd kwaak3
cd ioquake
I have setup the android-ndk dir

like this in Makefile.local

ANDROID_NDK_DIR=/opt/android-ndk-r5b/
CC=/opt/android-ndk-r5b/toolchains/arm-eabi-4.4.0/prebuilt/linux-x86/bin/arm-eabi-gcc-4.4.0

with ndk-r5 i get
Issue 140: can't compile ioquake: gl.h:719: error: expected '=', ',', ';', 'asm' or 'attribute' before 'glScissor'

with ndk6 i get

make[2]: Entering directory `/home/mariuz/work/kwaak3/ioquake3'
CC code/client/cl_cgame.c
gcc: error trying to exec 'cc1': execvp: No such file or directory
Assembler messages:
Fatal error: invalid -march= option: `armv5te'
make[2]: *** [build/release-linux-arm/client/cl_cgame.o] Error 1
make[2]: Leaving directory `/home/mariuz/work/kwaak3/ioquake3'
make[1]: *** [targets] Error 2
make[1]: Leaving directory `/home/mariuz/work/kwaak3/ioquake3'
make: *** [release] Error 2

Monday, June 27, 2011

Volumeicon : better volume applet in #lxde for !debian or #Lubuntu

I really like lxde and i have installed on all computers that i have (minus the android phone but soon enough i will install on that too :))
but there is one annoying bug or feature the volume applet at least at home
is controlling only the front speakers and no mixer to choose what to be controlled or any preferences , only if you modify the source.

There is the help of alsa mixer to the rescue
open console and type
alsamixer
but there is a better way volumeicon
it places an icon in status bar and when you right click you can choose mixer and it will show you the alsamixer in all it's glory
pretty cool that cli always saves you and is more trusted than the GUI
git clone https://github.com/icebreaker/volumeicon.git
cd volumeicon
./configure --prefix=/usr --enable-notify
sudo make install

I have two soundcars so i have added in the config
cat /proc/asound/cards
0 [HDMI           ]: HDA-Intel - HDA ATI HDMI
                      HDA ATI HDMI at 0xfeaec000 irq 44
 1 [default        ]: USB-Audio - Microsoft LifeChat LX-3000 
                      Microsoft LifeChat LX-3000  at usb-0000:00:1d.2-1, full speed

vi ~/.config/volumeicon/volumeicon
[Alsa]
card=hw:1
Start volumeicon or add it to the startup session
volumeicon &
if you are on pure LXDE/Debian
editor ~/.config/lxsession/LXDE/autostart
#add to the file
@volumeicon
If you are on Lubuntu
editor ~/.config/lxsession/Lubuntu/autostart
#add to the file
@volumeicon

Thursday, June 23, 2011

Using Jaybird Firebird JDBC driver with Ubuntu/Debian - cli way

I have used eclipse to create  simple console projects before and there it's easy to add references to the jaybird-full-*.jar , This time i wanted to compile from the shell.

Download jaybird from firebird jdbc download page
unzip it somewhere in your home
I usually put in a dir named  jdbc_client

cd ~/jdbc_client
compile it
javac -cp jaybird-full-2.1.6.jar examples/DriverExample.java
run it
java -cp jaybird-full-2.1.6.jar:examples DriverExample
It will trow you
Exception in thread "main" java.lang.UnsatisfiedLinkError: no jaybird21 in java.library.path


Simple fix is to use the pure type4 java jdbc driver and this is done by using the magic "localhost/3050:" in the connection string



After that it starts ok
java -cp jaybird-full-2.1.6.jar:examples DriverExample
Firebird JCA-JDBC driver version 2.0 registered with driver manager.
Connection established.
Auto-commit is disabled.
Transactions are supported.
PHONE_LIST is a view.
org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544558. Operation violates CHECK constraint INTEG_30 on view or table EMPLOYEE
At trigger 'CHECK_4'
 at org.firebirdsql.jdbc.AbstractStatement.executeUpdate(AbstractStatement.java:273)
 at DriverExample.main(DriverExample.java:296)
at org.firebirdsql.gds.GDSException: Operation violates CHECK constraint INTEG_30 on view or table EMPLOYEE
At trigger 'CHECK_4'
 at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.readStatusVector(AbstractJavaGDSImpl.java:2169)
 at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.receiveResponse(AbstractJavaGDSImpl.java:2119)
 at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.iscDsqlExecute2(AbstractJavaGDSImpl.java:1185)
 at org.firebirdsql.gds.impl.GDSHelper.executeStatement(GDSHelper.java:226)
 at org.firebirdsql.jdbc.AbstractStatement.internalExecute(AbstractStatement.java:1102)
 at org.firebirdsql.jdbc.AbstractStatement.executeUpdate(AbstractStatement.java:269)
 at DriverExample.main(DriverExample.java:296)
Unable to increase everyone's salary.
GDS Exception. 335544558. Operation violates CHECK constraint INTEG_30 on view or table EMPLOYEE
At trigger 'CHECK_4'
Error Code: 335544558
SQL State: HY000
The query executed has 1 result columns.
Here are the columns:
FULL_NAME of type VARCHAR
Here are the employee's whose salary < $50,000
Bennet, Ann
Reeves, Roger
Stansbury, Willie
Nordstrom, Carol
O'Brien, Sue Anne
Brown, Kelly
Page, Mary
Parker, Bill
Yanowski, Michael
Green, T.J.
Montgomery, John
Guckenheimer, Mark
Closing database resources and rolling back any changes we made to the database.

Now we try the Jni way (aka using the not so pure driver)
chmod +x libjaybird21.so
Seems to be compiled for 32 bit (i'm on 64 but i have already the lib32 libs)
ldd ./libjaybird21.so 
 linux-gate.so.1 =>  (0xf770d000)
 libdl.so.2 => /lib32/libdl.so.2 (0xf76c7000)
 libc.so.6 => /lib32/libc.so.6 (0xf756d000)
 libstdc++.so.5 => /usr/lib32/libstdc++.so.5 (0xf74b3000)
 /lib/ld-linux.so.2 (0xf770e000)
 libm.so.6 => /lib32/libm.so.6 (0xf748d000)
 libgcc_s.so.1 => /usr/lib32/libgcc_s.so.1 (0xf7470000)
To run using the compiled interface you need to add the -Djava.library.path when you run the program also change the connection string by adding the native keyword ":native:localhost/3050:"
java -Djava.library.path=. -cp jaybird-full-2.1.6.jar:examples DriverExample
For me it didn't worked because i have a 64bit machine so i need a jaybird source recompilation
libjaybird21.so: wrong ELF class: ELFCLASS32 (Possible cause: architecture word width mismatch)

Tuesday, June 21, 2011

Mono Firebird Example updated for Mono 2.6/2.10.x release (#ubuntu / #debian)

Mono Firebird Example updated for Mono 2.6 release

First I hope you have Firebird 2.5 already installed with examples :)

Second Install Monodevelop and Mono
In my case was something like this on ubuntu
sudo apt-get install  mono-gmcs mono-gac mono-utils monodevelop monodoc-browser monodevelop-nunit monodevelop-versioncontrol  monodoc-gtk2.0-manual 

Also on Debian you can use mono 2.10.x by using experimental repository (after you add it in /etc/apt/sources.list)

sudo apt-get -t experimental install  mono-gmcs mono-gac mono-utils monodevelop monodoc-browser monodevelop-nunit monodevelop-versioncontrol  monodoc-gtk2.0-manual 

You must download the .Net Provider 2.6.5 for mono binary version NETProvider-2.6.5-MONO_LINUX.7z
Extract it somewhere in the project dir where you want to build it

Create an new C# Console Project
Then add the Firebird .net assembly to the test project
References-> Edit References -> .Net Assembly
browse to the FirebirdSql.Data.FirebirdClient.dll that you downloaded before (and extracted)
then click Add button



Fill the Main.cs this way and Build Solution (Also add System.Data references)



Then click run after the solution is build and the result should be like this

Sunday, May 29, 2011

Webkit based WebBrowser written in #Mono (C#) + #Firebird Step 2

I have used the funny browser as base for my project

In short i have added in this step main menu (just for example , today browsers don't use a main menu anymore look at google chrome)

For adding the menu items i have found this tutorial
Also the code is hosted in github at this address
https://github.com/mariuz/monobrowser/

ps: it's not a good idea to jump to mono 2.10 yet from debian experimental
I had to remove and reinstall mono 2.6.x and perl just to make it work again

Mono 2.10.x with support for IronPython landed in Debian experimental

I was excited to install a stable IronPython on my Debian sid box , fortunately there is the option to have the Mono 2.10 packages from experimental that contains also support for IronPython

Webkit based WebBrowser written in #Mono (C#) + #Firebird Step 1

I will start with this simple example


Install monodevelop and the mono.webkit (aka webkit-sharp)

sudo apt-get install gtk-sharp2 libwebkit1.1-cil monodevelop

start monodevelop new gtk c# project (copy paste the code from above to match your app main class and namespace my are: coolbrowser,monobrowser)

But i didn't found in the list of installed assemblies
so i use my rusty admin skills and install from git and from webkit-sharp source

git clone https://github.com/mono/webkit-sharp.git

it didn't found the webkit dev libs and the mcs so

sudo apt-get install libwebkit-cil-dev libwebkit-dev
sudo ln -s /usr/bin/gmcs /usr/bin/mcs

./autogen.sh --prefix=/usr
sudo make install

add webkit references to the project


here is the code


I have added the default size to be 800x600

Friday, May 20, 2011

Remote host debugging on android x86

There is a pretty cool way to debug android applications on an android x86 host
when you don't have usb connection between your workstation and the the device (in my case the netbook)

Here is described how can be done
And here is my screenshot with my Eclipse session debugging one remote app (you can even put breakpoints and is quite fast at deploying the app)


Here is the remote breakpoint example



What is next class ? nacl native apps for x86 at last
and maybe qt debugging on the device

Thursday, May 19, 2011

Why should you avoid eucalyptus and mysql too - Open scamware


But Eucalyptus has its own burden to carry. Eucalyptus might be open-source, but it uses something called an open-core model. Translated: There's a free community edition of Eucalyptus for everybody, but more advanced features beyond the basic stuff only go to paying customers.
This is exactly the model Mickos employed at MySQL, and it upset people then too.

http://www.theregister.co.uk/2011/05/19/marten_mickos_a_year_on/page2.html

WebGL around the net

The 3body rendering is looking better and better Thanks for the update now i can run webgl on open source drivers :) both in chromium and google-chrome

Also the google-chrome –ignore-gpu-blacklist really rocks
chromium-browser –ignore-gpu-blacklist
I use nouveau and radeon open source drivers and they are really capable of rendering simple levels from quake3 in webgl

So i keep webgl enabled on all opensource drivers … even on intel ones

What to add in the next update ? Hellknight demo works again

http://blog.tojicode.com/2011/04/hellknight-demo-works-again.html


WebGL Starter Package

http://blog.tojicode.com/2011/04/webgl-starter-package.html


Quake3 , Doom3 demos updated to use requestAnimationFrame

http://blog.tojicode.com/2011/04/requestanimationframe.html



Advanced WebGL – Part 1 & 2 & 3

http://codeflow.org/entries/2011/apr/11/advanced-webgl-part-1/

http://codeflow.org/entries/2011/apr/13/advanced-webgl-part-2-sky-rendering/

http://codeflow.org/entries/2011/apr/18/advanced-webgl-part-3-irradiance-environment-map/


WebGL Capabilities Analyzed

http://codeflow.org/entries/2011/apr/16/webgl-capabilities-analyzed/


ps:For me the above demos didn’t worked on radeon open source driver

lshw -C video

description: VGA compatible controller

product: RV710 [Radeon HD 4350]

The revenge of the RISC - Arm Killing the Wintel Legacy

You know Microsoft learned the hard way a little lesson of history
They had nt ported on diverse cpus : Alpha , Mips , and x86(32 bits) after that
they went full duopoly with Intel (do you remember the Wintel motto) and killed Alpha (the cpu and the port) , Mips support
Mips in a way is too close to arm architecture
in fact i wonder why it didn't displaced Arm ?

Otellini compared Android's current state with Microsoft in the past, which ran on platforms such as DEC's Alpha, IBM's PowerPC, ARM, and MIPS "before settling predominantly on Intel's x86 architecture,"

(I guess Intel really hopes to be the dominant marchitecture for the Androids)



So they went in bed with Intel and thought Duopoly would last forever
but it didn't went that well because there is a new monopoly Arm + Android Linux and Windows doesn't have anything to do on it
yes they will try and fail again with Window8 , why fail ? because all the backward compatible features are lost that means all the windows software (written for 32 bit x86 ) it belongs to ... wine or linux emulators (something like qemu).
On Windows + ARM all your beloved spyware will not work.

"Microsoft's move to put Windows on ARM processors will result in a fragmented set of four environments, none of which will run legacy PC Windows apps, said Intel executive"

That is the best way to shoot yourself in the foot Epic way

http://www.theregister.co.uk/2011/05/18/james_on_arm_and_windows/

The lesson , keep your os and applications ported to multiple cpus don't lock yourself to only one vendor like Microsoft , A good example is how linux did it and like Debian is doing with it's ports