Wednesday, December 28, 2011
My FSocial Network
Here is how my FNetwork looks like bellow
The only observation I'm mostly strongly connected with coworkers , that means that i use the network for coworker notifications or maybe i'm workaholic :)
I wish the visualisation was made with webgl
Tuesday, December 27, 2011
One way to run firebird pdo tests
Just to not forget how to run them i write here
TEST_PHP_EXECUTABLE=auto php -n ./run-tests.php ext/pdo_firebirdof course you can add username/password , db path
PDO_FIREBIRD_TEST_DSN='firebird:dbname=/var/lib/firebird/2.5/data/employee.fdb' PDO_FIREBIRD_TEST_USER='SYSDBA' PDO_FIREBIRD_TEST_PASS='masterkey' TEST_PHP_EXECUTABLE=auto php -n ./run-tests.php ext/pdo_firebirdSaw it via comment section from pdo firebird driver documentation
Saturday, December 10, 2011
php doc team docbook editor is pretty cool
We want something like this for firebird doc team :)
Here is one shot with the documentation writing online, no need for other xml editors
Thursday, December 08, 2011
wodim saved my day and wrote the xubuntu 64 bit iso at last
I had problems with burning dvds both with xfburn and with brasero too
One of the errors was
SCSI error on write(0,16): [3 73 03] Power calibration area error
Another problem was that burn completed the writing in xfburn but when reading and checking the md5 for the dvd
dd bs=1M if=/dev/sr0 of=/tmp/iso
[ 349.397899] sr 0:0:1:0: [sr0] Add. Sense: No seek complete
[ 349.397906] sr 0:0:1:0: [sr0] CDB: Read(10): 28 00 00 05 49 df 00 00 01 00
[ 349.397925] end_request: I/O error, dev sr0, sector 1386364
[ 349.397933] Buffer I/O error on device sr0, logical block 346591
[ 373.127873] sr 0:0:1:0: [sr0] Unhandled sense code
[ 373.127880] sr 0:0:1:0: [sr0] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 373.127887] sr 0:0:1:0: [sr0] Sense Key : Medium Error [current]
[ 373.127896] Info fld=0x5299c
[ 373.127899] sr 0:0:1:0: [sr0] Add. Sense: No seek complete
[ 373.127907] sr 0:0:1:0: [sr0] CDB: Read(10): 28 00 00 05 29 9c 00 00 20 00
[ 373.127926] end_request: I/O error, dev sr0, sector 1353328
[ 373.127933] Buffer I/O error on device sr0, logical block 338332
[ 373.127939] Buffer I/O error on device sr0, logical block 338333
[ 373.127954] Buffer I/O error on device sr0, logical block 338334
[ 373.127957] Buffer I/O error on device sr0, logical block 338335
[ 373.127961] Buffer I/O error on device sr0, logical block 338336
[ 373.127964] Buffer I/O error on device sr0, logical block 338337
[ 373.127967] Buffer I/O error on device sr0, logical block 338338
[ 373.127970] Buffer I/O error on device sr0, logical block 338339
[ 373.127974] Buffer I/O error on device sr0, logical block 338340
[ 373.127977] Buffer I/O error on device sr0, logical block 338341
[ 379.137046] sr 0:0:1:0: [sr0] Unhandled sense code
[ 379.137053] sr 0:0:1:0: [sr0] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 379.137060] sr 0:0:1:0: [sr0] Sense Key : Medium Error [current]
[ 379.137069] Info fld=0x5299c
and it damaged every dvd i have throwed to it
Solution was to use the command line tools (saw it on a forum or in a bug tracker )
wodim -v dev=/dev/sr0 speed=4 xubuntu-11.10-desktop-amd64.iso
wodim: No write mode specified.
wodim: Assuming -tao mode.
wodim: Future versions of wodim may have different drive dependent defaults.
TOC Type: 1 = CD-ROM
scsidev: '/dev/sr0'
devname: '/dev/sr0'
scsibus: -2 target: -2 lun: -2
Linux sg driver version: 3.5.27
Wodim version: 1.1.11
SCSI buffer size: 64512
Device type : Removable CD-ROM
Version : 5
Response Format: 2
Capabilities :
Vendor_info : 'Optiarc '
Identification : 'DVD RW AD-7200A '
Revision : '1.06'
Device seems to be: Generic mmc2 DVD-R/DVD-RW.
Current: 0x001B (DVD+R)
Profile: 0x002B (DVD+R/DL)
Profile: 0x001B (DVD+R) (current)
Profile: 0x001A (DVD+RW)
Profile: 0x0016 (DVD-R/DL layer jump recording)
Profile: 0x0015 (DVD-R/DL sequential recording)
Profile: 0x0014 (DVD-RW sequential recording)
Profile: 0x0013 (DVD-RW restricted overwrite)
Profile: 0x0012 (DVD-RAM)
Profile: 0x0011 (DVD-R sequential recording)
Profile: 0x0010 (DVD-ROM)
Profile: 0x000A (CD-RW)
Profile: 0x0009 (CD-R)
Profile: 0x0008 (CD-ROM)
Profile: 0x0002 (Removable disk)
Using generic SCSI-3/mmc DVD-R(W) driver (mmc_mdvd).
Driver flags : SWABAUDIO BURNFREE
Supported modes: PACKET SAO
Drive buf size : 1310720 = 1280 KB
Beginning DMA speed test. Set CDR_NODMATEST environment variable if device
communication breaks or freezes immediately after that.
FIFO size : 12582912 = 12288 KB
Track 01: data 693 MB
Total size: 796 MB (78:52.88) = 354966 sectors
Lout start: 796 MB (78:54/66) = 354966 sectors
Current Secsize: 2048
HINT: use dvd+rw-mediainfo from dvd+rw-tools for information extraction.
Blocks total: 2295104 Blocks current: 2295104 Blocks remaining: 1940138
Speed set to 5540 KB/s
Starting to write CD/DVD at speed 4.0 in real unknown mode for single session.
Last chance to quit, starting real write in 0 seconds. Operation starts.
Waiting for reader process to fill input buffer ... input buffer ready.
Performing OPC...
Starting new track at sector: 0
Track 01: 1 of 693 MB written (fifo 97%) [buf 62%] 0.5x.
One of the errors was
SCSI error on write(0,16): [3 73 03] Power calibration area error
Another problem was that burn completed the writing in xfburn but when reading and checking the md5 for the dvd
dd bs=1M if=/dev/sr0 of=/tmp/iso
[ 349.397899] sr 0:0:1:0: [sr0] Add. Sense: No seek complete
[ 349.397906] sr 0:0:1:0: [sr0] CDB: Read(10): 28 00 00 05 49 df 00 00 01 00
[ 349.397925] end_request: I/O error, dev sr0, sector 1386364
[ 349.397933] Buffer I/O error on device sr0, logical block 346591
[ 373.127873] sr 0:0:1:0: [sr0] Unhandled sense code
[ 373.127880] sr 0:0:1:0: [sr0] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 373.127887] sr 0:0:1:0: [sr0] Sense Key : Medium Error [current]
[ 373.127896] Info fld=0x5299c
[ 373.127899] sr 0:0:1:0: [sr0] Add. Sense: No seek complete
[ 373.127907] sr 0:0:1:0: [sr0] CDB: Read(10): 28 00 00 05 29 9c 00 00 20 00
[ 373.127926] end_request: I/O error, dev sr0, sector 1353328
[ 373.127933] Buffer I/O error on device sr0, logical block 338332
[ 373.127939] Buffer I/O error on device sr0, logical block 338333
[ 373.127954] Buffer I/O error on device sr0, logical block 338334
[ 373.127957] Buffer I/O error on device sr0, logical block 338335
[ 373.127961] Buffer I/O error on device sr0, logical block 338336
[ 373.127964] Buffer I/O error on device sr0, logical block 338337
[ 373.127967] Buffer I/O error on device sr0, logical block 338338
[ 373.127970] Buffer I/O error on device sr0, logical block 338339
[ 373.127974] Buffer I/O error on device sr0, logical block 338340
[ 373.127977] Buffer I/O error on device sr0, logical block 338341
[ 379.137046] sr 0:0:1:0: [sr0] Unhandled sense code
[ 379.137053] sr 0:0:1:0: [sr0] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 379.137060] sr 0:0:1:0: [sr0] Sense Key : Medium Error [current]
[ 379.137069] Info fld=0x5299c
and it damaged every dvd i have throwed to it
Solution was to use the command line tools (saw it on a forum or in a bug tracker )
wodim -v dev=/dev/sr0 speed=4 xubuntu-11.10-desktop-amd64.iso
wodim: No write mode specified.
wodim: Assuming -tao mode.
wodim: Future versions of wodim may have different drive dependent defaults.
TOC Type: 1 = CD-ROM
scsidev: '/dev/sr0'
devname: '/dev/sr0'
scsibus: -2 target: -2 lun: -2
Linux sg driver version: 3.5.27
Wodim version: 1.1.11
SCSI buffer size: 64512
Device type : Removable CD-ROM
Version : 5
Response Format: 2
Capabilities :
Vendor_info : 'Optiarc '
Identification : 'DVD RW AD-7200A '
Revision : '1.06'
Device seems to be: Generic mmc2 DVD-R/DVD-RW.
Current: 0x001B (DVD+R)
Profile: 0x002B (DVD+R/DL)
Profile: 0x001B (DVD+R) (current)
Profile: 0x001A (DVD+RW)
Profile: 0x0016 (DVD-R/DL layer jump recording)
Profile: 0x0015 (DVD-R/DL sequential recording)
Profile: 0x0014 (DVD-RW sequential recording)
Profile: 0x0013 (DVD-RW restricted overwrite)
Profile: 0x0012 (DVD-RAM)
Profile: 0x0011 (DVD-R sequential recording)
Profile: 0x0010 (DVD-ROM)
Profile: 0x000A (CD-RW)
Profile: 0x0009 (CD-R)
Profile: 0x0008 (CD-ROM)
Profile: 0x0002 (Removable disk)
Using generic SCSI-3/mmc DVD-R(W) driver (mmc_mdvd).
Driver flags : SWABAUDIO BURNFREE
Supported modes: PACKET SAO
Drive buf size : 1310720 = 1280 KB
Beginning DMA speed test. Set CDR_NODMATEST environment variable if device
communication breaks or freezes immediately after that.
FIFO size : 12582912 = 12288 KB
Track 01: data 693 MB
Total size: 796 MB (78:52.88) = 354966 sectors
Lout start: 796 MB (78:54/66) = 354966 sectors
Current Secsize: 2048
HINT: use dvd+rw-mediainfo from dvd+rw-tools for information extraction.
Blocks total: 2295104 Blocks current: 2295104 Blocks remaining: 1940138
Speed set to 5540 KB/s
Starting to write CD/DVD at speed 4.0 in real unknown mode for single session.
Last chance to quit, starting real write in 0 seconds. Operation starts.
Waiting for reader process to fill input buffer ... input buffer ready.
Performing OPC...
Starting new track at sector: 0
Track 01: 1 of 693 MB written (fifo 97%) [buf 62%] 0.5x.
after that everything went fine
dd bs=1M if=/dev/sr0 of=/tmp/iso
693+1 records in
693+1 records out
726990848 bytes (727 MB) copied, 139.896 s, 5.2 MB/s
dd bs=1M if=/dev/sr0 of=/tmp/iso
693+1 records in
693+1 records out
726990848 bytes (727 MB) copied, 139.896 s, 5.2 MB/s
Tuesday, November 29, 2011
Friday, November 25, 2011
Replacing gnome3 with xfce/lxde on #fedora core 16
To replace and remove the ugly gnome 3 interface from fedora core 16 (it doesn't work if you don't have hw 3d acceleration if you are on a remote vnc session ) and to enable something more light and classy
you need to do the following easy steps
(it's better to do it in a console)
yum groupremove 'GNOME Desktop Environment'
yum groupinstall XFCE
yum groupinstall LXDE
create the file with a editor
/etc/sysconfig/desktop
DISPLAYMANAGER=/usr/sbin/lxdm
PREFERRED=/usr/bin/startlxde
and reboot
to enable vnc session for remote users
/bin/su username -c "/usr/bin/vncserver :1 -geometry 1440x900"
also it can be added in the rc.local so they will be enabled at server startup
/bin/su username2 -c "/usr/bin/vncserver :2 -geometry 1440x900"
/bin/su username3 -c "/usr/bin/vncserver :3 -geometry 1440x900"
....
you need to do the following easy steps
(it's better to do it in a console)
yum groupremove 'GNOME Desktop Environment'
yum groupinstall XFCE
yum groupinstall LXDE
create the file with a editor
/etc/sysconfig/desktop
DISPLAYMANAGER=/usr/sbin/lxdm
PREFERRED=/usr/bin/startlxde
and reboot
to enable vnc session for remote users
/bin/su username -c "/usr/bin/vncserver :1 -geometry 1440x900"
also it can be added in the rc.local so they will be enabled at server startup
/bin/su username2 -c "/usr/bin/vncserver :2 -geometry 1440x900"
/bin/su username3 -c "/usr/bin/vncserver :3 -geometry 1440x900"
....
Wednesday, November 23, 2011
Volumeicon +xfce-mixer part two : better volume applet in #lxde for !debian or #Lubuntu
Dedicated to Jancsi who just switched from unity to Lubuntu
As you might now from part one i use volumeicon for controlling my speakers when i listen to music
There is no easy graphical mixer in lubuntu but
There is the help of xfce4-mixer to the rescue
open console and type to in
it places an icon in status bar and when you right click you can choose mixer and it will show you the xfce4-mixer in all it's glory
I have two soundcars so i have added in the config
As you might now from part one i use volumeicon for controlling my speakers when i listen to music
There is no easy graphical mixer in lubuntu but
There is the help of xfce4-mixer to the rescue
open console and type to in
sudo apt-get install xfce4-mixernext install and compile volumeicon with the patch to use xfce4-mixer by default
it places an icon in status bar and when you right click you can choose mixer and it will show you the xfce4-mixer in all it's glory
git clone https://github.com/mariuz/volumeicon.git cd volumeicon
sudo apt-get install libasound2-dev ./configure --prefix=/usr 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:1Start 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 @volumeiconIf you are on Lubuntu
editor ~/.config/lxsession/Lubuntu/autostart #add to the file @volumeiconby default when you click on volume icon it mutes the sound card so in preferences i put Left Mouse Button Action to open the Slider And the Channel will be PCM
LightDM on Xubuntu 11.10 horror story
I have installed xubuntu 11.10 on one machine that was already with kubuntu installed on it
after reboot there was nologin only some flashes
I have disabled graphical boot , deleted quiet and all the pretty options in the grub menu (nomodeset added too)
no luck
removed kdm still no luck
I have launched lightdm manually with debug flag
lightdm -d and saw that it needs unity-greeter and there was no such thing as unity-greeter installed
so i have installed it and changed to the classic gtk greeter
In /etc/lightdm/lightdm.conf i have changed
greeter-session=lightdm-gtk-greeter
Reboot and still in the logs i saw "lightdm main process TERM signal"
and No greeter .
What is weird that lxdm started if launched from command line also
the start-xfce4 worked ok
what to do ?
i have added in rc.local
start lightdm and after reboot
the login was ok again
after reboot there was nologin only some flashes
I have disabled graphical boot , deleted quiet and all the pretty options in the grub menu (nomodeset added too)
no luck
removed kdm still no luck
I have launched lightdm manually with debug flag
lightdm -d and saw that it needs unity-greeter and there was no such thing as unity-greeter installed
so i have installed it and changed to the classic gtk greeter
In /etc/lightdm/lightdm.conf i have changed
greeter-session=lightdm-gtk-greeter
Reboot and still in the logs i saw "lightdm main process TERM signal"
and No greeter .
What is weird that lxdm started if launched from command line also
the start-xfce4 worked ok
what to do ?
i have added in rc.local
start lightdm and after reboot
the login was ok again
Tuesday, November 22, 2011
Installing qxl drivers on Windows7 guest (and others virtio drivers for ballooning memory, virtioserial, network and viostor)
Download qxl driver Windows qxl driver qxl-0.10-20112808.zip
extract it then install it
cd x86
pnputil -i -a qxl.inf
from the downoad page also you need to install spice vd-agent Windows guest agent - vdagent-win32_20111124.zip
Last thing you need to do is install the virtual desktop agent for your windows 7 guest. To do this, copy the two executable files from the vdagent zip file
Now go to the directory where these executables are located and type “vdservice install”. This will install and start the guest agent service as shown below.
You might need virtio drivers
The drivers include virtio drivers for ballooning memory, virtioserial, network and viostor ( block drivers ). These drivers are signed but not WHQL and there are no gui installers for them.
This is the installation method with virtio drivers :
Download the the host the iso.
Mount the iso in the windows guest machine from the the virt-manager details interface
and for each inf install it and then configure the machine to use the virtio
d:\
cd Windows7
cd x86
pnputil -i -a *.inf
extract it then install it
cd x86
pnputil -i -a qxl.inf
from the downoad page also you need to install spice vd-agent Windows guest agent - vdagent-win32_20111124.zip
Last thing you need to do is install the virtual desktop agent for your windows 7 guest. To do this, copy the two executable files from the vdagent zip file
Now go to the directory where these executables are located and type “vdservice install”. This will install and start the guest agent service as shown below.
You might need virtio drivers
The drivers include virtio drivers for ballooning memory, virtioserial, network and viostor ( block drivers ). These drivers are signed but not WHQL and there are no gui installers for them.
This is the installation method with virtio drivers :
Download the the host the iso.
Mount the iso in the windows guest machine from the the virt-manager details interface
and for each inf install it and then configure the machine to use the virtio
d:\
cd Windows7
cd x86
pnputil -i -a *.inf
Monday, November 21, 2011
Ie9 on kvm-linux
The steps/scripts for using ie9 test machine are quite easy to follow if you are using
virtualbox
but what about kvm-linux ?
I followed the guide to make vhd to kvm raw This guides works but it creates a raw partition of 127G in size so is not so good :
qemu-img convert -f vpc -O raw Windows\ 7.vhd Windows7ie9.img
so i used this command line instead:
qemu-img convert -f vpc -O qcow2 Windows\ 7.vhd Windows7ie9.qcow
and image is now ~ 13G
Create new virtual machine importing the converted qcow2 image
Notice I had an issue with the tablet device so i have disabled it for vnc
You can add montly script in scheduler to rearm it on the windows guest
rearm.bat
slmgr –rearm
shutdown -r -t 0
Next i had some issues with vnc (mouse positioned weird and at the distance with the vnc cursor when connecting from remote)
and I have enabled the spice server instead of the vnc one in the virt-manager configuration for this host and then installed spice client on my machine
sudo apt-get install spice-client
run it with
spice-client
type host port and password if you have one set
To Exit the spice client Shift - F12
but what about kvm-linux ?
I followed the guide to make vhd to kvm raw This guides works but it creates a raw partition of 127G in size so is not so good :
so i used this command line instead:
qemu-img convert -f vpc -O qcow2 Windows\ 7.vhd Windows7ie9.qcow
and image is now ~ 13G
Create new virtual machine importing the converted qcow2 image
Notice I had an issue with the tablet device so i have disabled it for vnc
You can add montly script in scheduler to rearm it on the windows guest
rearm.bat
slmgr –rearm
shutdown -r -t 0
Next i had some issues with vnc (mouse positioned weird and at the distance with the vnc cursor when connecting from remote)
and I have enabled the spice server instead of the vnc one in the virt-manager configuration for this host and then installed spice client on my machine
sudo apt-get install spice-client
run it with
spice-client
type host port and password if you have one set
To Exit the spice client Shift - F12
Monday, November 14, 2011
theÖutlet new free album by absurdcus
Absurducus launched his album on 11.11.11 and at 11.11 AM/PM you can add remove a few nanoseconds just for fun
Album is under Attribution-NonCommercial-NoDerivs 3.0 Unported (CC BY-NC-ND 3.0) and can be ripped and then after you listen you can donate to make him millionaire
Album is under Attribution-NonCommercial-NoDerivs 3.0 Unported (CC BY-NC-ND 3.0) and can be ripped and then after you listen you can donate to make him millionaire
Sunday, November 13, 2011
Correcting #ubuntu Unity mistake - move it at the bottom
I use Lubuntu or Xubuntu and i have read that the problem with the unity on the left side can be easily fixed
I think no one would complain if the bar would be at the bottom with a proper classic start menu (win7 style) isn't it ? and yes with the close buttons on the right please
ps : I have enough pixels or two monitors to put unity wherever i like and want , that is the cost of freedom
I think no one would complain if the bar would be at the bottom with a proper classic start menu (win7 style) isn't it ? and yes with the close buttons on the right please
ps : I have enough pixels or two monitors to put unity wherever i like and want , that is the cost of freedom
Saturday, November 12, 2011
My next phone will be with Debian / Ubuntu
This ubuntu phone art concept made me think that i really want a Linux phone based on Debian/Ubuntu
I don't want a Nokia zombie all i want a true open source phone (true in the heart and true in the ubuntu spirit)
I don't want a Nokia zombie all i want a true open source phone (true in the heart and true in the ubuntu spirit)
Friday, November 11, 2011
#Ubuntu After the uTorrent page was virused i recommend QBittorrent to anyone
I'm pissed utorrent doesn't make a client for Linux until the endof the year (only next) but in a sense
we Linux users don't really care , there are many torrent clients to choose from
One that i love is qbittorrent.
It works great on all platforms , it is written in QT framework
and it looks and feels just like uTorrent minus the crappy bars and viruses
Did i mentioned that is small and better in the sense that is simpler to use than kTorrent (starts in < 1s instead of minutes)
And it does have a cool logo too
In ubuntu you can install this way
sudo apt-get install qbittorrent
or on windows/macosx from this page
In ubuntu you can install this way
sudo apt-get install qbittorrent
or on windows/macosx from this page
Building kinterbasdb docs
sudo apt-get install python-sphinx svn co https://firebird.svn.sourceforge.net/svnroot/firebird/kinterbasdb kinterbasdb kinterbasdb/trunk/sphinx make html mkdir -p .build/html .build/doctrees sphinx-build -b html -d .build/doctrees . ../docs Running Sphinx v1.0.7 loading pickled environment... not yet created building [html]: targets for 11 source files that are out of date updating environment: 11 added, 0 changed, 0 removed reading sources... [100%] tutorial /home/mariuz/work/kinterbasdb/trunk/sphinx/beyond-python-db-api.txt:75: (WARNING/2) Inline interpreted text or phrase reference start-string without end-string. /home/mariuz/work/kinterbasdb/trunk/sphinx/beyond-python-db-api.txt:: WARNING: using old C markup; please migrate to new-style markup (e.g. c:function instead of cfunction), see http://sphinx.pocoo.org/domains.html /home/mariuz/work/kinterbasdb/trunk/sphinx/changelog.txt:950: (WARNING/2) Block quote ends without a blank line; unexpected unindent. /home/mariuz/work/kinterbasdb/trunk/sphinx/changelog.txt:1158: (WARNING/2) Definition list ends without a blank line; unexpected unindent. /home/mariuz/work/kinterbasdb/trunk/sphinx/concurrency.txt:167: (WARNING/2) Block quote ends without a blank line; unexpected unindent. /home/mariuz/work/kinterbasdb/trunk/sphinx/python-db-api-compliance.txt:32: WARNING: duplicate object description of kinterbasdb.Cursor, other instance in /home/mariuz/work/kinterbasdb/trunk/sphinx/beyond-python-db-api.txt, use :noindex: for one of them /home/mariuz/work/kinterbasdb/trunk/sphinx/python-db-api-compliance.txt:107: WARNING: duplicate object description of kinterbasdb.Connection, other instance in /home/mariuz/work/kinterbasdb/trunk/sphinx/beyond-python-db-api.txt, use :noindex: for one of them looking for now-outdated files... none found pickling environment... done checking consistency... done preparing documents... done writing output... [100%] tutorial writing additional files... genindex py-modindex search copying static files... done dumping search index... done dumping object inventory... done build succeeded, 7 warnings. Build finished. The HTML pages are in .build/html.
Saturday, November 05, 2011
fixing !Debian sid dpkg: warning: 'ldconfig' not found in PATH or not executable.
If you have this bug with sid
when you do sudo apt-get dist-upgrade
dpkg: warning: 'ldconfig' not found in PATH or not executable.The simple solution is to modify in /etc/sudoers
Defaults env_reset Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
constantly usable #debian testing installer
If you search for usable testing iso you can find a debian Official CD/DVD images of the testing distribution (regenerated weekly)
you only need the first cd from the list , burn CD1 iso it and start (boot from it)
Sunday, October 16, 2011
making sound in tux guitar #ubuntu and #debian
I had no sound
on my tuxguitar when playing gp3 files
so i had to install timidity and java sound plugin
(they are not installed by default )
sudo apt-get install timidity tuxguitar-jsa
and then select in Tools ->Settings -> Sound
Midi Port -> Timidity
Now i can go back to [Eric Clapton] Cocaine
Monday, October 03, 2011
Php Image Slow SMP Magick on #Ubuntu / #Debian
There is a known bug with Image Magick : it can be very slow when used with openmp enabled (by default in debian/ubuntu) on multicore systems (almost on all servers these days)
It is eating a lot of cpu (50-100% for each core) instead of idling at 1-2% (for simple image manipulations)
It was strange for me that one single core server was faster than a quad core in the same specs with the rest of the config (os ubuntu 10.04 lts, kernel latest, ioscheduler : deadline)
Eliminating the problems on what could slow down the server (php version , image magick version , kernel version ) the only thing left was cpu
Solution is very simple configure imagemagick without openmp
it should look like
apt-get buil-dep imagemagick apt-get source imagemagick cd imagemagick-6.5.7.8/ sudo vi debian/rulesadd ~ line 39 --disable-openmp (dont' forget to add \ to the privious line)
it should look like
--x-libraries=/usr/lib/X11 \ --disable-openmpRebuild the package and reinstall
dpkg-buildpackage -b sudo apt-get remove --purge libmagickcore2 cd .. dpkg -i libmagickcore2* libmagickwand2* apt-get install php5-imagick /etc/init.d/apache2 restart
Sunday, October 02, 2011
Where the rock stars go when they go down ? they go to country hell
My biggest wtf moments were when i saw that Robert Plant is singing and dancing country music
I wondered for months and years how that could that happen ? how he can go so low
After so many great performances in rock concerts .
While listening to many Blues Bands i observed that many songs were ripped by Led Zepelin and others
so in the end Led Zeppelin is one of the best Cover Bands of them all
This why the main lead singer can go so low , he can play anything even country music (no sacrifice or spells were involved in the process)
Friday, September 30, 2011
MSI MS7528 (G31M3 motherboard) bios update Linux horror story
I had this error on dmes log output BIOS bug: CPU MTRRs don't cover all of memory, losing 768MB of RAM Solution is to upgrade the bios fro v1.1 to v 1.3
1.After i have searched the motherboard on msi site i didn't knew where is the generic motherboard (without F/L) and it seems that according to the forum
All I can see are the -F and -L(S) models. It's almost as if the plain G31M3 does not exist.
and if you like to know why doesn't my board have the -F printed on it:"-F" is ommited. G31M3-F or G31M3 means the same board
2. Flashrom from linux doesn't work yet with this board
3. Next instal windows (yes you read that is right) and use the useless Windows tool Live update 5 that doesn't work at all (it doesn't find the drivers, it doesn't find the bios update)
4. I need to put another tool that it will install DOS ! and then put the zip with the bios on an usb stick
5. I had to run fix it to redo the drive geometry also i had to format the usb stick
6. Required Boot from ubuntu live cd and remove windows (optionally format usb stick as ubuntu live cd)
check the bios and dmesg log
2. Flashrom from linux doesn't work yet with this board
3. Next instal windows (yes you read that is right) and use the useless Windows tool Live update 5 that doesn't work at all (it doesn't find the drivers, it doesn't find the bios update)
4. I need to put another tool that it will install DOS ! and then put the zip with the bios on an usb stick
5. I had to run fix it to redo the drive geometry also i had to format the usb stick
6. Required Boot from ubuntu live cd and remove windows (optionally format usb stick as ubuntu live cd)
check the bios and dmesg log
dmesg [ 0.000000] DMI: MICRO-STAR INTERNATIONAL CO.,LTD MS-7528/G31M3-F(MS-7528), BIOS V1.3 06/19/2009 ... [ 0.000000] total RAM covered: 4096M
Tuesday, September 27, 2011
#Oracle Thank you for killing #mysql with opencore=propietary licence and pushing for alternatives
The LAMP king is dead and is Open core = Closed source http://ur1.ca/0dahc , so is time for Mysql alternatives : Firebird
Monty's words
Oracle has now officially announced that MySQL is not a full free software project anymore and that they will go for an Open Core model.
This is inconsistent to the original MySQL business model. The main strength of MySQL has always been that all MySQL source code was freely available. It was thanks to this that MySQL got widely adopted and got to be used by tens of millions of users.
This was a fact that the MySQL board and Sun understood. Closing the MySQL server code base in any manner would be bad for long term business.
So what's so wrong with Open Core?
As a business model, especially to bootstrap a business, Open Core is not a bad idea. It gives you some leverage with your users to get part of your development paid for. This is however done at the cost of fewer users and a less adopted project. Many projects however abandon Open Core models when they grow as open source gives them more users and thus more value.
What is most important to understand about an Open Core project is that it has nothing to do with an open source project. If you are depending on a single closed source component then you have to regard the whole project as a closed source project as you lose all the benefits of open source:
The new pluggable authentication, which makes the new PAM authentication possible, was developed and contributed to Oracle by Sergei Golubchik at Monty Program Ab.
Alternatives and the good News
These words are prophetic and the decline started to happen
The decline will not be immediate, it will take some time, notably Apache distributions like XAMPP and WAMP will have to offer users alternatives to MySQL, as most developers use these packages, instead of installing products independently. All is not lost, the Open Source community has plenty of options. There are two well established alternatives to MySQL: PostgreSQL and Firebird. Both have large established communities, and support of major corporations. One of these will become the next MySQL
I put my vote on Firebird SQL : it is lighter and it is easier to maintain (drop in replacement for mysql in lamp installements)
Monty's words
Oracle has now officially announced that MySQL is not a full free software project anymore and that they will go for an Open Core model.
This is inconsistent to the original MySQL business model. The main strength of MySQL has always been that all MySQL source code was freely available. It was thanks to this that MySQL got widely adopted and got to be used by tens of millions of users.
This was a fact that the MySQL board and Sun understood. Closing the MySQL server code base in any manner would be bad for long term business.
So what's so wrong with Open Core?
As a business model, especially to bootstrap a business, Open Core is not a bad idea. It gives you some leverage with your users to get part of your development paid for. This is however done at the cost of fewer users and a less adopted project. Many projects however abandon Open Core models when they grow as open source gives them more users and thus more value.
What is most important to understand about an Open Core project is that it has nothing to do with an open source project. If you are depending on a single closed source component then you have to regard the whole project as a closed source project as you lose all the benefits of open source:
- You are depending on one vendor.
- You can't do any bug fixes yourself and you can't contract anyone except the original vendor to get things fixed.
- You can't examine and improve the product (not any part of if).
- You can't use any open source or commercial extensions from anyone else. This is true also for any plugins that access any internal parts of the product (which is true for most MySQL plugins).
- You are limited to the platforms that the original vendors makes available. (In MySQL's case you can't for example use the new commercial features on RedHat 6 as it's not a supported platform).
- The builds you are using are not tested anymore by millions of users (more bugs).
- The product is not checked by the open source community for security problems or back doors.
- The new features will not be adopted by (and may even cause conflicts with) other open source projects.
- You are subject to one vendor's price politics which they can change at their convenience.
The new pluggable authentication, which makes the new PAM authentication possible, was developed and contributed to Oracle by Sergei Golubchik at Monty Program Ab.
Alternatives and the good News
These words are prophetic and the decline started to happen
The decline will not be immediate, it will take some time, notably Apache distributions like XAMPP and WAMP will have to offer users alternatives to MySQL, as most developers use these packages, instead of installing products independently. All is not lost, the Open Source community has plenty of options. There are two well established alternatives to MySQL: PostgreSQL and Firebird. Both have large established communities, and support of major corporations. One of these will become the next MySQL
I put my vote on Firebird SQL : it is lighter and it is easier to maintain (drop in replacement for mysql in lamp installements)
From Marco Cantu’s blog:
Now, this could be a very good opportunity for all of the other open source database servers (and also some of paid ones!), particularly the most popular ones like Firebird and PostgreSQL. I’m particularly fond of Firebird (the InterBase offspring) and use it in many projects and did a lot of consulting to Delphi developers using it. Can this be ? MySQL with its huge popularity has certainly obscured it, so it could be a good time to act.
Thursday, September 22, 2011
fixing nginx 1.0.x and html5 video
Fixing nginx 1.0.x to make it serve video ogg correctly
Open up the Nginx mime type configuration file, eg: /etc/nginx/mime.types
Add these lines after the last video mime type
video/ogg ogm; video/ogg ogv; video/ogg ogg;restart nginx
sudo /etc/init.d/nginx restart
Wednesday, September 21, 2011
The best definition for clould computing
Definition was given on slashdot
Unfortunately, the sort of seamless network-agnostic computing Plan 9 and its descendants enabled is now a commercial threat to all the other players in the mobile space. Half the point of the "cloud computing" trend is to lock people in to one provider's weakly interacting web service, and, by extension, into the controlled ecosystem of third-party services that do interoperate well with it. Plan 9 is too good at what it does to be successful.
All cloud providers want to hook you up to the system and then rip you off with computing time , bw or with overpriced NO uptime like amazon does with their constant service disruptions
No wonder they all want to move you to the cloud and milk you as much they can .
I have tested RDS on Amazon is is absolutley horridly slow compared with a fine tuned machine
Unfortunately, the sort of seamless network-agnostic computing Plan 9 and its descendants enabled is now a commercial threat to all the other players in the mobile space. Half the point of the "cloud computing" trend is to lock people in to one provider's weakly interacting web service, and, by extension, into the controlled ecosystem of third-party services that do interoperate well with it. Plan 9 is too good at what it does to be successful.
All cloud providers want to hook you up to the system and then rip you off with computing time , bw or with overpriced NO uptime like amazon does with their constant service disruptions
No wonder they all want to move you to the cloud and milk you as much they can .
I have tested RDS on Amazon is is absolutley horridly slow compared with a fine tuned machine
Sunday, September 04, 2011
Rip Google pack time for librepack
Rip google pack i didn't quite loved you because you contained mostly propietary crap : adobe reader, antiviruses , antispyware , the pesky google desktop and firefox with google toolbar included
(by the way i think toolbars should be forbidden in all browsers just to make the world a better place)
but I always recommended google pack to people still stuck in the past and windows land (minus the real player that is contained in the pack !)
Why :it updates automatically the programms and contains antivirus / antispyware , maybe is time for a librepack that it will contain : vlc ,libreoffice , clamav, firefox, chromium using the same update method used by the google pack http://googlesystem.blogspot.com/2009/04/google-update-open-sourced.html
I almost wish to create it myself but the devel setup is quite heavy
Friday, September 02, 2011
dist-upgrade in #ubuntu hardy on Amazon ec2
Today i have upgraded hardy machine with latest patches on an Amazon ec2 machine (related to httpd bug)
and it crashed on with this script update-rc.d if you watched with top
First download the libc6-xen
and install it with
dpkg-i
then remove the libc6 and ubuntu minimal
dpkg -r libc6-i686 and then dpkg --configure -a
and restart your daemons
and it crashed on with this script update-rc.d if you watched with top
First download the libc6-xen
and install it with
dpkg-i
then remove the libc6 and ubuntu minimal
dpkg -r libc6-i686 and then dpkg --configure -a
and restart your daemons
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
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).
you will get an error
to look like this for karmik (supported with old repository url)
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:
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
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 multiverseUpdate the package list and upgrade all the installed packages
sudo apt-get update && sudo apt-get dist-upgradePerform 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).
you will get an error
to look like this for jaunty
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:
I then ran do-release-upgrade and everything worked like a charm
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 multiverseUpdate the package list and upgrade all the installed packages
sudo apt-get update && sudo apt-get dist-upgradePerform 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
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
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)
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
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 :)
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-linuxI 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
record all the packages that you have for posterity
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
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-upgradeNow 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
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
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
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
I have two soundcars so i have added in the config
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
alsamixerbut 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:1Start 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 @volumeiconIf 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
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
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)
Download jaybird from firebird jdbc download page
unzip it somewhere in your home
I usually put in a dir named jdbc_client
cd ~/jdbc_clientcompile it
javac -cp jaybird-full-2.1.6.jar examples/DriverExample.javarun it
java -cp jaybird-full-2.1.6.jar:examples DriverExampleIt 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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Original version of this file was part of InterClient 2.01 examples | |
// | |
// Copyright InterBase Software Corporation, 1998. | |
// Written by com.inprise.interbase.interclient.r&d.PaulOstler :-) | |
// | |
// Code was modified by Roman Rokytskyy to show that Firebird JCA-JDBC driver | |
// does not introduce additional complexity in normal driver usage scenario. | |
// | |
// A small application to demonstrate basic, but not necessarily simple, JDBC features. | |
// | |
// Note: you will need to hardwire the path to your copy of employee.gdb | |
// as well as supply a user/password in the code below at the | |
// beginning of method main(). | |
public class DriverExample | |
{ | |
// Make a connection to an employee.gdb on your local machine, | |
// and demonstrate basic JDBC features. | |
// Notice that main() uses its own local variables rather than | |
// static class variables, so it need not be synchronized. | |
public static void main (String args[]) throws Exception | |
{ | |
// Modify the following hardwired settings for your environment. | |
// Note: localhost is a TCP/IP keyword which resolves to your local machine's IP address. | |
// If localhost is not recognized, try using your local machine's name or | |
// the loopback IP address 127.0.0.1 in place of localhost. | |
// String databaseURL = "jdbc:firebirdsql:localhost/3050:c:/database/employee.gdb"; | |
//String databaseURL = "jdbc:firebirdsql:native:localhost/3050:c:/database/employee.gdb"; | |
//String databaseURL = "jdbc:firebirdsql:local:c:/database/employee.gdb"; | |
//String databaseURL = "jdbc:firebirdsql:embedded:c:/database/employee.fdb?lc_ctype=WIN1251"; | |
String databaseURL = "jdbc:firebirdsql:localhost/3050:/var/lib/firebird/2.5/data/employee.fdb?sql_dialect=3"; | |
String user = "sysdba"; | |
String password = "masterkey"; | |
String driverName = "org.firebirdsql.jdbc.FBDriver"; | |
// As an exercise to the reader, add some code which extracts databaseURL, | |
// user, and password from the program args[] to main(). | |
// As a further exercise, allow the driver name to be passed as well, | |
// and modify the code below to use driverName rather than the hardwired | |
// string "org.firebirdsql.jdbc.FBDriver" so that this code becomes | |
// driver independent. However, the code will still rely on the | |
// predefined table structure of employee.gdb. | |
// Here are the JDBC objects we're going to work with. | |
// We're defining them outside the scope of the try block because | |
// they need to be visible in a finally clause which will be used | |
// to close everything when we are done. | |
// The finally clause will be executed even if an exception occurs. | |
java.sql.Driver d = null; | |
java.sql.Connection c = null; | |
java.sql.Statement s = null; | |
java.sql.ResultSet rs = null; | |
// Any return from this try block will first execute the finally clause | |
// towards the bottom of this file. | |
try { | |
// Let's try to register the Firebird JCA-JDBC driver with the driver manager | |
// using one of various registration alternatives... | |
int registrationAlternative = 1; | |
switch (registrationAlternative) { | |
case 1: | |
// This is the standard alternative and simply loads the driver class. | |
// Class.forName() instructs the java class loader to load | |
// and initialize a class. As part of the class initialization | |
// any static clauses associated with the class are executed. | |
// Every driver class is required by the jdbc specification to automatically | |
// create an instance of itself and register that instance with the driver | |
// manager when the driver class is loaded by the java class loader | |
// (this is done via a static clause associated with the driver class). | |
// | |
// Notice that the driver name could have been supplied dynamically, | |
// so that an application is not hardwired to any particular driver | |
// as would be the case if a driver constructor were used, eg. | |
// new org.firebirdsql.jdbc.FBDriver(). | |
try { | |
Class.forName ("org.firebirdsql.jdbc.FBDriver"); | |
} | |
catch (java.lang.ClassNotFoundException e) { | |
// A call to Class.forName() forces us to consider this exception :-)... | |
System.out.println ("Firebird JCA-JDBC driver not found in class path"); | |
System.out.println (e.getMessage ()); | |
return; | |
} | |
break; | |
case 2: | |
// There is a bug in some JDK 1.1 implementations, eg. with Microsoft | |
// Internet Explorer, such that the implicit driver instance created during | |
// class initialization does not get registered when the driver is loaded | |
// with Class.forName(). | |
// See the FAQ at http://java.sun.com/jdbc for more info on this problem. | |
// Notice that in the following workaround for this bug, that if the bug | |
// is not present, then two instances of the driver will be registered | |
// with the driver manager, the implicit instance created by the driver | |
// class's static clause and the one created explicitly with newInstance(). | |
// This alternative should not be used except to workaround a JDK 1.1 | |
// implementation bug. | |
try { | |
java.sql.DriverManager.registerDriver ( | |
(java.sql.Driver) Class.forName ("org.firebirdsql.jdbc.FBDriver").newInstance () | |
); | |
} | |
catch (java.lang.ClassNotFoundException e) { | |
// A call to Class.forName() forces us to consider this exception :-)... | |
System.out.println ("Driver not found in class path"); | |
System.out.println (e.getMessage ()); | |
return; | |
} | |
catch (java.lang.IllegalAccessException e) { | |
// A call to newInstance() forces us to consider this exception :-)... | |
System.out.println ("Unable to access driver constructor, this shouldn't happen!"); | |
System.out.println (e.getMessage ()); | |
return; | |
} | |
catch (java.lang.InstantiationException e) { | |
// A call to newInstance() forces us to consider this exception :-)... | |
// Attempt to instantiate an interface or abstract class. | |
System.out.println ("Unable to create an instance of driver class, this shouldn't happen!"); | |
System.out.println (e.getMessage ()); | |
return; | |
} | |
catch (java.sql.SQLException e) { | |
// A call to registerDriver() forces us to consider this exception :-)... | |
System.out.println ("Driver manager failed to register driver"); | |
showSQLException (e); | |
return; | |
} | |
break; | |
case 3: | |
// Add the Firebird JCA-JDBC driver name to your system's jdbc.drivers property list. | |
// The driver manager will load drivers from this system property list. | |
// System.getProperties() may not be allowed for applets in some browsers. | |
// For applets, use one of the Class.forName() alternatives above. | |
java.util.Properties sysProps = System.getProperties (); | |
StringBuffer drivers = new StringBuffer ("org.firebirdsql.jdbc.FBDriver"); | |
String oldDrivers = sysProps.getProperty ("jdbc.drivers"); | |
if (oldDrivers != null) | |
drivers.append (":" + oldDrivers); | |
sysProps.put ("jdbc.drivers", drivers.toString ()); | |
System.setProperties (sysProps); | |
break; | |
case 4: | |
// Advanced: This is a non-standard alternative, and is tied to | |
// a particular driver implementation, but is very flexible. | |
// | |
// It may be possible to configure a driver explicitly, either thru | |
// the use of non-standard driver constructors, or non-standard | |
// driver "set" methods which somehow tailor the driver to behave | |
// differently from the default driver instance. | |
// Under this alternative, a driver instance is created explicitly | |
// using a driver specific constructor. The driver may then be | |
// tailored differently from the default driver instance which is | |
// created automatically when the driver class is loaded by the java class loader. | |
// For example, perhaps a driver instance could be created which | |
// is to behave like some older version of the driver. | |
// | |
// d = new org.firebirdsql.jdbc.FBDriver (); | |
// DriverManager.registerDriver (d); | |
// c = DriverManager.getConnection (...); | |
// | |
// Since two drivers, with differing behavior, are now registered with | |
// the driver manager, they presumably must recognize different jdbc | |
// subprotocols. For example, the tailored driver may only recognize | |
// "jdbc:interbase:old_version://...", whereas the default driver instance | |
// would recognize the standard "jdbc:interbase://...". | |
// There are currently no methods, such as the hypothetical setVersion(), | |
// for tailoring an Firebird JCA-JDBC driver so this 4th alternative is academic | |
// and not necessary for Firebird JCA-JDBC driver. | |
// | |
// It is also possible to create a tailored driver instance which | |
// is *not* registered with the driver manager as follows | |
// | |
// d = new org.firebirdsql.jdbc.FBDriver (); | |
// c = d.connect (...); | |
// | |
// this is the most usual case as this does not require differing | |
// jdbc subprotocols since the connection is obtained thru the driver | |
// directly rather than thru the driver manager. | |
d = new org.firebirdsql.jdbc.FBDriver (); | |
} | |
// At this point the driver should be registered with the driver manager. | |
// Try to find the registered driver that recognizes interbase URLs... | |
try { | |
// We pass the entire database URL, but we could just pass "jdbc:interbase:" | |
d = java.sql.DriverManager.getDriver (databaseURL); | |
System.out.println ("Firebird JCA-JDBC driver version " + | |
d.getMajorVersion () + | |
"." + | |
d.getMinorVersion () + | |
" registered with driver manager."); | |
} | |
catch (java.sql.SQLException e) { | |
System.out.println ("Unable to find Firebird JCA-JDBC driver among the registered drivers."); | |
showSQLException (e); | |
return; | |
} | |
// Advanced info: Class.forName() loads the java class for the driver. | |
// All JDBC drivers are required to have a static clause that automatically | |
// creates an instance of themselves and registers that instance | |
// with the driver manager. So there is no need to call | |
// DriverManager.registerDriver() explicitly unless the driver allows | |
// for tailored driver instances to be created (each instance recognizing | |
// a different jdbc sub-protocol). | |
// Now that Firebird JCA-JDBC driver is registered with the driver manager, | |
// try to get a connection to an employee.gdb database on this local machine | |
// using one of two alternatives for obtaining connections... | |
int connectionAlternative = 1; | |
switch (connectionAlternative) { | |
case 1: | |
// This alternative is driver independent; | |
// the driver manager will find the right driver for you based on the jdbc subprotocol. | |
// In the past, this alternative did not work with applets in some browsers because of a | |
// bug in the driver manager. I believe this has been fixed in the jdk 1.1 implementations. | |
try { | |
c = java.sql.DriverManager.getConnection (databaseURL, user, password); | |
System.out.println ("Connection established."); | |
} | |
catch (java.sql.SQLException e) { | |
e.printStackTrace(); | |
System.out.println ("Unable to establish a connection through the driver manager."); | |
showSQLException (e); | |
return; | |
} | |
break; | |
case 2: | |
// If you're working with a particular driver d, which may or may not be registered, | |
// you can get a connection directly from it, bypassing the driver manager... | |
try { | |
java.util.Properties connectionProperties = new java.util.Properties (); | |
connectionProperties.put ("user", user); | |
connectionProperties.put ("password", password); | |
connectionProperties.put ("lc_ctype", "WIN1251"); | |
c = d.connect (databaseURL, connectionProperties); | |
System.out.println ("Connection established."); | |
} | |
catch (java.sql.SQLException e) { | |
e.printStackTrace(); | |
System.out.println ("Unable to establish a connection through the driver."); | |
showSQLException (e); | |
return; | |
} | |
break; | |
} | |
// Let's disable the default autocommit so we can undo our changes later... | |
try { | |
c.setAutoCommit (false); | |
System.out.println ("Auto-commit is disabled."); | |
} | |
catch (java.sql.SQLException e) { | |
System.out.println ("Unable to disable autocommit."); | |
showSQLException (e); | |
return; | |
} | |
// Now that we have a connection, let's try to get some meta data... | |
try { | |
java.sql.DatabaseMetaData dbMetaData = c.getMetaData (); | |
// Ok, let's query a driver/database capability | |
if (dbMetaData.supportsTransactions ()) | |
System.out.println ("Transactions are supported."); | |
else | |
System.out.println ("Transactions are not supported."); | |
// What are the views defined on this database? | |
java.sql.ResultSet tables = dbMetaData.getTables (null, null, "%", new String[] {"VIEW"}); | |
while (tables.next ()) { | |
System.out.println (tables.getString ("TABLE_NAME") + " is a view."); | |
} | |
tables.close (); | |
} | |
catch (java.sql.SQLException e) { | |
System.out.println ("Unable to extract database meta data."); | |
showSQLException (e); | |
// What the heck, who needs meta data anyway ;-(, let's continue on... | |
} | |
// Let's try to submit some static SQL on the connection. | |
// Note: This SQL should throw an exception on employee.gdb because | |
// of an integrity constraint violation. | |
try { | |
s = c.createStatement (); | |
s.executeQuery("select cast('????' as varchar(30) character set win1251) from rdb$database order by 1 collate pxw_cyrl"); | |
s.executeUpdate ("update employee set salary = salary + 10000"); | |
} | |
catch (java.sql.SQLException e) { | |
e.printStackTrace(); | |
System.out.println ("Unable to increase everyone's salary."); | |
showSQLException (e); | |
// We expected this to fail, so don't return, let's keep going... | |
} | |
// Let's submit some static SQL which produces a result set. | |
// Notice that the statement s is reused with a new SQL string. | |
try { | |
rs = s.executeQuery ("select full_name from employee where salary < 50000"); | |
} | |
catch (java.sql.SQLException e) { | |
System.out.println ("Unable to submit a static SQL query."); | |
showSQLException (e); | |
// We can't go much further without a result set, return... | |
return; | |
} | |
// The query above could just as easily have been dynamic SQL, | |
// eg. if the SQL had been entered as user input. | |
// As a dynamic query, we'd need to query the result set meta data | |
// for information about the result set's columns. | |
try { | |
java.sql.ResultSetMetaData rsMetaData = rs.getMetaData (); | |
System.out.println ("The query executed has " + | |
rsMetaData.getColumnCount () + | |
" result columns."); | |
System.out.println ("Here are the columns: "); | |
for (int i = 1; i <= rsMetaData.getColumnCount (); i++) { | |
System.out.println (rsMetaData.getColumnName (i) + | |
" of type " + | |
rsMetaData.getColumnTypeName (i)); | |
} | |
} | |
catch (java.sql.SQLException e) { | |
System.out.println ("Unable to extract result set meta data."); | |
showSQLException (e); | |
// What the heck, who needs meta data anyway ;-(, let's continue on... | |
} | |
// Ok, lets step thru the results of the query... | |
try { | |
System.out.println ("Here are the employee's whose salary < $50,000"); | |
while (rs.next ()) { | |
System.out.println (rs.getString ("full_name")); | |
} | |
} | |
catch (java.sql.SQLException e) { | |
System.out.println ("Unable to step thru results of query"); | |
showSQLException (e); | |
return; | |
} | |
// As an exercise to the reader, rewrite this code so that required | |
// table structures are created dynamically using executeUpdate() on DDL. | |
// In this way the code will be able to run against any database file rather | |
// than just a previously setup employee.gdb. | |
// Just to get you started, you'll want to define a method something like | |
// the following... | |
// | |
// private static void createTableStructures (java.sql.Connection c) throws java.sql.SQLException | |
// { | |
// // Some drivers don't force commit on DDL, Firebird JCA-JDBC driver does, | |
// // see DatabaseMetaData.dataDefinitionCausesTransactionCommit(). | |
// // This is not necessary for Firebird JCA-JDBC driver, but may be for other drivers... | |
// c.setAutoCommit (true); | |
// | |
// java.sql.Statement s = c.createStatement(); | |
// | |
// // Drop table EMPLOYEE if it already exists, if not that's ok too. | |
// try { s.executeUpdate ("drop table EMPLOYEE"); } catch (java.sql.SQLException e) {} | |
// | |
// // Ok, now that we're sure the table isn't already there, create it... | |
// s.executeUpdate ("create table EMPLOYEE (...)"); | |
// | |
// // Ok, now populate the EMPLOYEE table... | |
// s.executeUpdate ("insert into EMPLOYEE values (...)"); | |
// | |
// s.close(); | |
// c.setAutoCommit (false); | |
// } | |
// | |
} | |
// This finally clause will be executed even if "return" was called in case of any exceptions above. | |
finally { | |
System.out.println ("Closing database resources and rolling back any changes we made to the database."); | |
// Now that we're all finished, let's release database resources. | |
try { if (rs!=null) rs.close (); } catch (java.sql.SQLException e) { showSQLException (e); } | |
try { if (s!=null) s.close (); } catch (java.sql.SQLException e) { showSQLException (e); } | |
// Before we close the connection, let's rollback any changes we may have made. | |
try { if (c!=null) c.rollback (); } catch (java.sql.SQLException e) { showSQLException (e); } | |
try { if (c!=null) c.close (); } catch (java.sql.SQLException e) { showSQLException (e); } | |
} | |
} | |
// Display an SQLException which has occured in this application. | |
private static void showSQLException (java.sql.SQLException e) | |
{ | |
// Notice that a SQLException is actually a chain of SQLExceptions, | |
// let's not forget to print all of them... | |
java.sql.SQLException next = e; | |
while (next != null) { | |
System.out.println (next.getMessage ()); | |
System.out.println ("Error Code: " + next.getErrorCode ()); | |
System.out.println ("SQL State: " + next.getSQLState ()); | |
next = next.getNextException (); | |
} | |
} | |
} |
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 DriverExampleFor 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
Also on Debian you can use mono 2.10.x by using experimental repository (after you add it in /etc/apt/sources.list)
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
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)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Data; | |
using FirebirdSql.Data.FirebirdClient; | |
namespace FirebirdTest | |
{ | |
class MainClass | |
{ | |
public static void Main(string[] args) { | |
string connectionString = | |
"Database=/var/lib/firebird/2.5/data/employee.fdb;" + | |
"User=SYSDBA;" + "Password=masterkey;" + | |
"Dialect=3;character set=NONE;" + "Server=localhost"; | |
IDbConnection dbcon = new FbConnection(connectionString); | |
dbcon.Open(); | |
IDbCommand dbcmd = dbcon.CreateCommand(); | |
string sql = "select * from employee"; | |
dbcmd.CommandText = sql; | |
IDataReader reader = dbcmd.ExecuteReader(); | |
while(reader.Read()) { | |
object dataValue = reader.GetValue(0); | |
string sValue = dataValue.ToString(); | |
Console.WriteLine("Value: " + sValue); | |
} | |
// clean up | |
reader.Close(); | |
reader = null; | |
dbcmd.Dispose(); | |
dbcmd = null; | |
dbcon.Close(); | |
dbcon = null; | |
} | |
}} |
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
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
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using Gtk; | |
using WebKit; | |
namespace monobrowser { | |
class coolbrowser { | |
public static void Main () { | |
Application.Init (); | |
Window window = new Window ("a browser in 13 lines..."); | |
window.SetDefaultSize(800,600); | |
window.Destroyed += delegate (object sender, EventArgs e) { | |
Application.Quit (); | |
}; | |
ScrolledWindow scrollWindow = new ScrolledWindow (); | |
WebView webView = new WebView (); | |
webView.Open ("http://mono-project.com"); | |
scrollWindow.Add (webView); | |
window.Add (scrollWindow); | |
window.ShowAll (); | |
Application.Run (); | |
} | |
} | |
} |
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
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 ?
and maybe qt debugging on the device
Subscribe to:
Posts (Atom)