Wednesday, March 23, 2016

Firebird 3.0 and MSVC14 build (good news)



I have tested the Firebird 3.0 and MSVC14 compiler and builds ok

https://github.com/FirebirdSQL/firebird/tree/B3_0_Release/builds/win32/msvc14


Tomorrow I will test also with firebird 2.5.x branch and i will check what patches are needed

Instructions for building it are located here

https://github.com/FirebirdSQL/firebird/blob/master/doc/README.build.msvc.html

and on the website

Thursday, August 06, 2015

Let's go back to the c , Firebird embedded backup service works

I have used an c based example for services api and seems that it works without a need for auth user



gcc backup_service.c -lfbembed

./a.out employee.fdb employee.fbk

Attach succeed

Start succeed

gbak:readied database employee.fdb for backup gbak:creating file employee.fbk

...

gbak:writing SQL roles gbak:writing names mapping gbak:closing file, committing, and finishing. 74752 bytes written

I will split the backup service function in two one for backup and one for restore then i will compare with my service example , maybe is a buffer truncation issue


Wednesday, July 15, 2015

Update firebird to version 2.5.4 is applied into LibreOffice master

There was a small issue with tinderbox and was reverted and then re-applied to master.

Rebuilding of indexes function is now removed from master (Using firebird backup format for .odb there is no need for rebuild indexes).

Thursday, July 02, 2015

JDK issues on OSX , ran the tests without Java

To run all the dbaccess tests On OSX I had to install jre 6 then jdk/jre 8 but still
dbaccess tests wouldn't run java popup still appeared even if the java -version showed
the proper 8 version , so for the moment i have disabled the java tests

./autogen.sh --without-java

Update:

Tests are finished and Firebird 2.5.4 update patch on gerrit is up for review
https://gerrit.libreoffice.org/16703

Tested on OSX 10.10.4 , Win 10 , Ubuntu 14.04

Wednesday, July 01, 2015

Debugging with ddd : crashes in rtl_ImplGetFastUTF8UnicodeLen

Found it where it crashes at line 645 in Connection.cxx
OUString aData(pResults + 3,
                           isc_vax_integer(pResults, 2),
                           RTL_TEXTENCODING_UTF8);
            
and here is the backtrace at line 634 in ustring.cxx
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7b7aebd in rtl_ImplGetFastUTF8UnicodeLen (pStr=0x7ffffffff000 , nLen=11582, ascii=0x7fffffffc4b8) at /home/mariuz/work/libo/sal/rtl/ustring.cxx:634
(gdb) frame 4
#4  0x00007fff96c9bce2 in connectivity::firebird::Connection::runBackupService (this=0x7fffac0a1400, nAction=1) at /home/mariuz/work/libo/connectivity/source/drivers/firebird/Connection.cxx:645
(gdb) frame 24
#24 0x00007ffff195e906 in SalFrame::CallCallback (this=0x10a7680, nEvent=22, pEvent=0x15fd5d0) at /home/mariuz/work/libo/vcl/inc/salframe.hxx:246
(gdb) frame 23
#23 0x00007ffff1586e00 in ImplWindowFrameProc (_pWindow=0x10a6ce0, nEvent=22, pEvent=0x15fd5d0) at /home/mariuz/work/libo/vcl/source/window/winproc.cxx:2578
(gdb) frame 5
#5  0x00007fff96c9c99c in connectivity::firebird::Connection::documentEventOccured (this=0x7fffac0a1400, _Event=...) at /home/mariuz/work/libo/connectivity/source/drivers/firebird/Connection.cxx:814
(gdb) frame 4
#4  0x00007fff96c9bce2 in connectivity::firebird::Connection::runBackupService (this=0x7fffac0a1400, nAction=1) at /home/mariuz/work/libo/connectivity/source/drivers/firebird/Connection.cxx:645

Tuesday, June 30, 2015

Backup file firebird.fbk file inside odb is 0 length

That could be the reason gerrit wasn't merged Connection::runBackupService didn't quite worked:
(Currently doesn't actually work, the backup service fails with gbak:Exiting before completion due to errors and no further error messages).
I need to debug the isc_action_svc_backup error

On odb save event now saves fbk instead of fdb

XDocumentEventListener documentEventOccured was registered for when save button is pressed

It was done on this line in Connection.cxx :
xBroadcaster->addDocumentEventListener(this);

The issue was on this part of the code 
xInputStream = OStorageHelper::GetInputStreamFromURL(m_sFirebirdURL, xContext);
Now replaced with
xInputStream = OStorageHelper::GetInputStreamFromURL(m_sFBKPath, xContext);

m_sFirebirdURL is the original fdb path 

m_sFirebirdURL = m_pDatabaseFileDir->GetFileName() + "/firebird.fdb";
m_sFBKPath = m_pDatabaseFileDir->GetFileName() + "/firebird.fbk";



Friday, June 26, 2015

Semi good news : New Database.odb contains firebird.fbk

The semi good news is that New Database.odb contains fbk file saved when a table is created and saved from Base
Here is the unziped New Database.odb



The bad news is the firebird.fbk is in fact firebird.fdb file , so the saved file is the database file instead of backup file (i renamed the fbk to fdb and can be open in flamerobin)

When i loaded the New Database.odb i got this backtrace

rogram received signal SIGSEGV, Segmentation fault.
0x00007ffff7b7b99d in rtl_ImplGetFastUTF8UnicodeLen (pStr=0x7ffffffff000 , nLen=18238, ascii=0x7fffffffb658) at /home/mariuz/work/libo/sal/rtl/ustring.cxx:610
610             unsigned char c = (unsigned char)*pStr;
(gdb) 

So i need to work on the save fbk to odb part

Thursday, June 25, 2015

The good news

The good news is firebird_empty.odb simple test is is ok (fdb file is created in tmp area and queries work) as seen in the trace https://gist.github.com/mariuz/ecfbab056136b8736bda
info:connectivity.firebird:3385:1:connectivity/source/drivers/firebird/Driver.cxx:54: FirebirdDriver_CreateInstance()
info:connectivity.firebird:3385:1:connectivity/source/drivers/firebird/Driver.cxx:166: connect(), URL: sdbc:embedded:firebird
info:connectivity.firebird:3385:1:connectivity/source/drivers/firebird/Connection.cxx:173: Temporary .fdb location:  /tmp/lu3385bwxulf.tmp/firebird.fdb
info:connectivity.firebird:3385:1:connectivity/source/drivers/firebird/DatabaseMetaData.cxx:851: getTypeInfo()
info:connectivity.firebird:3385:1:connectivity/source/drivers/firebird/Connection.cxx:883: buildTypeInfo(). Type info built.
info:connectivity.firebird:3385:1:connectivity/source/drivers/firebird/Connection.cxx:891: buildTypeInfo(). Closed.
info:connectivity.firebird:3385:1:connectivity/source/drivers/firebird/Statement.cxx:111: executeQuery(SELECT DISTINCT indices.RDB$INDEX_NAME FROM RDB$INDICES indices JOIN RDB$INDEX_SEGMENTS index_segments ON (indices.RDB$INDEX_NAME = index_segments.RDB$INDEX_NAME) JOIN RDB$RELATION_FIELDS relation_fields ON (index_segments.RDB$FIELD_NAME = relation_fields.RDB$FIELD_NAME) JOIN RDB$FIELDS fields ON (relation_fields.RDB$FIELD_SOURCE = fields.RDB$FIELD_NAME) WHERE (indices.RDB$SYSTEM_FLAG = 0) AND ((fields.RDB$FIELD_TYPE = 14)      OR (fields.RDB$FIELD_TYPE = 37)) AND (indices.RDB$INDEX_INACTIVE IS NULL OR indices.RDB$INDEX_INACTIVE = 0) )
info:connectivity.firebird:3385:1:connectivity/source/drivers/firebird/ResultSet.cxx:79: OResultSet().
info:connectivity.firebird:3385:1:connectivity/source/drivers/firebird/StatementCommonBase.cxx:111: close
info:connectivity.firebird:3385:1:connectivity/source/drivers/firebird/StatementCommonBase.cxx:111: close
We need to modify the file firebird_integer_x64le.odb used in the qa tests (dbaccess/qa/unit/firebird.cxx) to include a fbk instead of fdb http://lists.freedesktop.org/archives/libreoffice-commits/2013-September/057217.html

Tuesday, June 23, 2015

Debugging #72987 libreoffice patch

I started debugging the gerrit at the end of #72987
export DEBUGCPPUNIT=TRUE
export CPPUNITTRACE="gdb --args"
export VALGRIND=memcheck
make CppunitTest_dbaccess_firebird_test
make -j 4 -rs -f /home/mariuz/work/libo/Makefile.gbuild CppunitTest_dbaccess_firebird_test
Seems that gdb debugging is locked
Update: I needed to export only one of the bash env variables not all of them
export CPPUNITTRACE="gdb --args"
Here is a more readable backtrace

Monday, June 15, 2015

New small patch from libo for El Capitan

We need to apply the same patch upstream in 2.5 tree so I have asked Paul why the flag was needed and if it can be removed. So it can be safely removed also upstream.

Update : patch applied both in trunk and firebird 2.5.x release branch. gds_relay target was removed from darwin makefile comments (target was removed many years ago by Alex)

It should be removed from all makefiles in 2.5.x branch (seems to be removed in trunk)

Tuesday, June 09, 2015

osx fixed , redoing the gerrit patch

Yesterday i had an exam so i slowed down my pace for the moment

Saturday i have the last exam on this year (Advanced Methods in Data Analysis)

the osx issue is that bash firebird configure script detects host/target as i386-darwin on x86-64 osx

https://discussions.apple.com/thread/2245432
so we have to use the 2.5.2 trick and force the build for darwin_x86_64

i*86-*-darwin*)
    MAKEFILE_PREFIX=darwin_x86_64

I will redo the gerrit and send it again after i make shure that it builds on all machines

and remove the old one

Sunday, June 07, 2015

testing make qtcreator-ide-integration more patches are now upstream . osx architecture linked issue

in libo git folder you can now create qtcreator files

make qtcreator-ide-integration
cd sw
qtcreator sw.pro


parsing/indexing the project took a few seconds . I'm more used to qtcreator than to kdevelop



On the firebird side , one more fix is now upstream .




I saw that we have an issue with osx patch



ld: warning: ignoring file ../temp/boot/jrd/dsc.o, file was built for unsupported file format ( 0xCF 0xFA 0xED 0xFE 0x07 0x00 0x00 0x01 0x03 0x00 0x00 0x00 0x01 0x00 0x00 0x00 ) which is not the architecture being linked (i386): ../temp/boot/jrd/dsc.o
http://ci.libreoffice.org/job/lo_gerrit_master/2971/Gerrit=Gerrit,Platform=MacOSX/consoleText

I will review what changed in the configure/makefile that triggered the issue

Saturday, June 06, 2015

Timo-T game modifications : environment effects, real time illumination, we've changed the lasers



A few modifications made these past few weeks, hope You like'em So we've played a little with the environment effects, real time illumination, we've changed the lasers, as You can see they look a lot different than they did before and we've optimized the shader to get some better reflections. Still need to implement a few minor things and solve a few bugs, but we are very excited with what we have so far. Hope You like it Leave us a comment with what Your thoughts are on this matter. Any feedback would be appreciated.


http://www.indiedb.com/games/timo-t/news/timo-t


Better view in the HD images area


http://www.indiedb.com/games/timo-t/images

Friday, June 05, 2015

#gsoc2015 for libreoffice update no #3 : patch has it's own brain (osx vs linux)

I worked on the finishing firebird 2.5.4 cygwin.msvc patch and i did also the up streaming (as much as i could from it)
I had an issue with patch created on linux didn't apply very well on osx (hunk issue)

I have prepared the gerrit for firebird 2.5.4 upgrade here https://gerrit.libreoffice.org/#/c/16103/

I solved the following rejects yesterday , i did my builds on all windows/osx/linux machines


2 out of 10 hunks FAILED -- saving rejects to file configure.in.rej
1 out of 2 hunks FAILED -- saving rejects to file src/jrd/gds.cpp.rej
1 out of 1 hunk FAILED -- saving rejects to file src/jrd/os/win32/mod_loader.cpp.rej



It was easier if patches where done for each file separated or as pull requests on github for easy cherry picking :)
Firebirdsql accepts now pull requests on github

Also i up-streamed some of the patches 
ps: i started importing the libo in kdevelop for easy debugging and it will take a while to import 

also started reviewing firebird endian issue and previous gerrit

Wednesday, May 27, 2015

#gsoc2015 for libreoffice update #2 - update firebird to 2.5.4 , osx builds ok



I have updated firebird 2.5.4 patch also with osx patches refactored (now is building ok on osx)






https://drive.google.com/file/d/0BwmDDYc8dMVzRllXM0pMYWRhWlpiOGRZSDNmMkxfekV2QlI0/view?usp=sharing



I still need to clean the cygwin msvc patch (work in progress)


it fais on cygwin on these lines






2 out of 10 hunks FAILED -- saving rejects to file configure.in.rej


[build CHK] cppu


1 out of 2 hunks FAILED -- saving rejects to file src/jrd/gds.cpp.rej


1 out of 1 hunk FAILED -- saving rejects to file src/jrd/os/win32/mod_loader.cpp.rej


[build CHK] cppuhelper


Patch FAILED: C:/sources/libo-core/external/firebird/firebird-cygwin-msvc.patch.1


C:/sources/libo-core/solenv/gbuild/UnpackedTarball.mk:166: recipe for target 'C:/sources/libo-core/workdir/UnpackedTarball/firebird.done' failed

Tuesday, May 26, 2015

#gsoc2015 for libreoffice update #1 - update firebird to 2.5.4

Jenkins tells us libo master fails to build on MacOS and MS Windows, in the firebird compilation.
These two will be merged into one request:
https://gerrit.libreoffice.org/#/c/15026/
Patch is applied upstream http://tracker.firebirdsql.org/browse/CORE-4475
https://gerrit.libreoffice.org/#/c/15029/

Also external/firebird/firebird-icu.patch is already applied upstream in 2.5.4 (it's an examples makefile  firebird/builds/posix/Makefile.in.examples)

https://github.com/FirebirdSQL/core/commit/ffde92d9517c99651f1d2acfe91b5f148ac3a638

On On MacOS X, the error after update seems to be that the Firebird build system uses a compiler switch that is not recognised by clang compiler. (needs to be removed also contributed upstream in 2.5..x tree)

Tuesday, May 19, 2015

Timo T gameplay video no #2



We have worked some more on our game, still have some work to do, but we do hope that we'll have a demo in a week or 2 (fingers crossed)... Until then enjoy the new video... We will gladly reply to each of you that comes with Feedback, questions and suggestions. Who knows maybe You'll give us some great ideas!


http://www.indiedb.com/games/timo-t/videos/timo-t-gameplay-21


Sunday, May 17, 2015

Firebird PHP Web Admin with Bootstrap 3.x

Here is one screenshot with new Firebird Web Admin interface



Compare with previous version


Saturday, May 16, 2015

Gibbous - A Cthulhu Adventure (Pre-Alpha Demo Footage)

Gibbous is a classic 2d point and click adventure, and yes it’s a Lucas Arts-like game. It also is, as the subtitle so unsubtle-y gives it away, a loving spoof of everything Lovecraftian, and then some.

Pre-Alpha demo footage



Wednesday, May 13, 2015

Timo-T puzzle game [WIP]



The Gameplay is relatively easy: You are a robot that has to press some buttons in a certain sequence in order to get to the next level (the buttons are just a sketch they are not final). Every level is time elapsing from 3-5 min per level. All the levels are basically on the same platform, the only difference is that the platforms are moving up and down and as U advance in the game it will be harder and harder because the higher levels will have certain paths which U must go on the and rest will be lava. There will be lasers as shown in the teaser and plasma bullets shot from the ceiling. The robot will have 2 special abilities with a cooldown meter and there will be power-ups like walk on lava for a few seconds and restore health. And of course the facility is built inside of a volcano.

Boxshot
http://www.indiedb.com/games/timo-t

Timo-T


Thursday, May 07, 2015

Installing Firebird Ruby driver on Windows 10 x64



Install firebird 2.5.4 x64 with fbclient copy to system dir (checked).
Install rubyinstaller 2.x x64
Download Devkit for ruby 2.x (x64 – 64bits only)
unzip it in C:\rubydevkit
open cmd.exe in start->run
cd rubydevkit
run ruby dk.rb init and ruby dk.rb install to bind it to ruby installations in your path.

Then gem install fb will go without issues after compilation.
After that you can install rails 4.2.x and ActiveRecord Firebird Adapter.

Tuesday, May 05, 2015

Firebird 2.5.4 Final for Ubuntu LTS releases is uploaded into Firebird stable ppa



Here you can find the latest stable release Firebird 2.5.4 for LTS supported Ubuntu releases.
Follow the Firebird 2.5.x guide for usage and installation.

ps:Also package for latest supported Ubuntu:15.04 is uploaded

Tuesday, April 28, 2015

Saturday, April 25, 2015

Ubuntu 15.04 allows systemd removal

One way to boot your ubuntu 15.04 faster is to switch to upstart and remove systemd

sudo apt-get install upstart-sysv

https://wiki.ubuntu.com/VividVervet/ReleaseNotes#Boot_and_service_management

Wednesday, February 18, 2015

CodeIgniter 3 (php framework) includes support for Firebird

The Userguide of Codeigniter 3 (still Release Candidate) mentions that now has support for Firebird:
Added Interbase / Firebird database support via the ibase driver.
This means that the installation package CI 3 includes it, although you could previously use Firebird in CodeiIgniter 2 by the driver developed by Carlos García ( https://github.com/cgarciagl/Firebird-for-Codeigniter ) .

 We are very happy that CodeIgniter 3 integrates support for Firebird,  In fact CodeIgniter is a stable platform where I (albringas)'ve done developments and with very good results.


To see the rest of the new features of CodeIgniter 3 these are the addresses: http://www.codeigniter.com/userguide3/
http://www.codeigniter.com/userguide3/changelog.html

I also put the direction of an article I wrote about using Firebird with CodeIgniter 2, in my blog: http://albringas.com/noticias/detalle/3103/ 

Monday, February 16, 2015

Building Firebird 3.0 Client / Embedded for Android Arm-32 bits

Download and install ndk  unzip in your home
install firebird build dependencies
sudo apt-get build-dep firebird3.0
sudo apt-get install libtommath-dev



export NDK=$HOME/android-ndk-r10e
echo $NDK

get the Firebird 3.0 source code from https://github.com/FirebirdSQL/firebird/tree/B3_0_Release

git clone https://github.com/FirebirdSQL/firebird.git
cd core 
git checkout B3_0_Release
./autogen.sh  --with-cross-build=android.arm --without-editline --enable-binreloc
make
There was a libedit.a linking error so i had to copy it manually
cp extern/editline/src/libedit.a gen/Release/firebird/lib/libedit.a
after that the libfbclient.so is created for arm

file  gen/buildroot/opt/firebird/lib/libfbclient.so.3.0.0 
gen/buildroot/opt/firebird/lib/libfbclient.so.3.0.0: ELF 64-bit LSB  shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=b6cb7db07fcad2475aa79352fb515cbe3ac44eea, stripped

Soon i will add a download link

ps: fbclient.so in 3.0 can be used as embedded

Monday, December 08, 2014

Firebird 3.0 Beta 1 release is available for testing



Firebird Project announces the first Beta release of Firebird 3.0, the next major version of the Firebird relational database, which is now available for testing.

This Beta release demonstrates the features and improvements currently under development by the Firebird development team. Our users are appreciated giving it a try and providing feedback to the development mailing list. Apparent bugs can be reported directly to the bugtracker.

Beta releases are not encouraged for production usage or any other goals that require a stable system. They are, however, recommended for those users who want to help in identifying issues and bottlenecks thus allowing to progress faster through the Beta/RC stages towards the final release.

Please read the Release Notes carefully before installing and testing this Beta release.

Friday, November 21, 2014

Node.JS and Firebird driver (node-firebird-libfbclient) installing on Amazon EC2 instance

Here are the notes on Installing node.js module for firebird
I assume Firebird was installed from source or from tar.gz and in a linux instance


wget https://nodejs.org/dist/v4.6.0/node-v4.6.0.tar.gz
tar -zxvf node-v4.6.0.tar.gz
cd  node-v4.6.*
./configure 
sudo make install

Next is time to install the firebird module (Firebird was installed from source in /opt/firebird2.5.x)

git clone git://github.com/xdenser/node-firebird-libfbclient.git
cd node-firebird-lib
export PATH=$PATH:/opt/firebird2.5.x/binfbclient/

npm -g install

create firebird db and test table in /tmp/nodedb.fdb with isql or isql-fb

SQL>CREATE DATABASE "localhost:/tmp/nodedb.fdb" user 'SYSDBA' password '*********';
SQL> CREATE TABLE TEST (ID INT NOT NULL PRIMARY KEY, NAME VARCHAR(20));
SQL> create generator gen_test_id;
SQL> SET GENERATOR gen_test_id TO 10;
SQL> set term !! ;
SQL> CREATE TRIGGER TEST_BI FOR TEST
CON> ACTIVE BEFORE INSERT POSITION 0
CON> AS
CON> BEGIN
CON> if (NEW.ID is NULL) then NEW.ID = GEN_ID(GEN_TEST_ID, 1);
CON> END!!
SQL> set term ; !!

Then write the test.js script to connect to it



you can observe that the id is auto incremented if you run it multiple time

node test.js 
[ { ID: 5, NAME: 'new one' },
  { ID: 11, NAME: 'new one' },
  { ID: 12, NAME: 'new one' },
  { ID: 13, NAME: 'new one' },
  { ID: 14, NAME: 'new one' } ]

also in the name you can put later the
browser or the ip in one of the columns


We build now the version for the web modifying the hello world version adding the firebird database glue



you can run it with
 node firebird_example.js

Rails On Firebird - status and follow the guide

Rails On Firebird - you need to check that Firebird active record adapter and ruby driver are installed
Install Rails 4.x :
 gem install rails
Generate a new Firebird Rails application
rails new firebird_app 
delete the generated database.yml sqlite config and use the one from bellow
Be aware about indentation
cat config/database.yml

Edit the project Gemfile and add the activerecord-fb-adapter gem:
gem 'activerecord-fb-adapter'
Then run:
bundle update
 rails generate scaffold Client name:string address:string email:string remark:text
  rake db:migrate
I have re-read the ruby guide
so i did these commands while following the official guide
rake db:create
but database was already created in flamerobin
script/generate controller home index
vi app/views/home/index.html.erb
and write something there, start the server with
rails s
and now you can see something in browser
http://localhost:3000/


I have created the table and one sequence in firebird db
CREATE TABLE posts (
id BIGINT NOT NULL PRIMARY KEY,
name VARCHAR(255),
title VARCHAR(255),
content VARCHAR(255),
timestamps timestamp
);
CREATE sequence POSTS_SEQ;

I have ran the scaffold again to generate the posts model/view/controller
script/generate scaffold Post name:string title:string content:text
and then
started the server
rails s

Of course I have modified the route and added an link as in tutorial and now i can add and modify blog posts
note: in new rails route is defined this way in config/routes.rb
map.root :controller => "home"

http://localhost:3000/posts






Follow the normal ActiveRecord conventions for table names, primary key columns, etc. The one “extra” you’ll need for Firebird is that you’ll have to create a generator for any tables that require a sequence-based primary key. The default naming convention is TABLENAME_SEQ. So if you have a users table, you would need to create a corresponding USERS_SEQ generator

You don't need to create before insert triggers ! rails reads the value from sequence and then increments it in ruby code, Yay!

Wednesday, July 09, 2014

Installing Android x86 4.4 on my eeepc with qemu

In fact is an re-install , i had 4.3 in dual boot with debian sid on my eeepc and i wanted to do an upgrade , the issue is that i don't have a usb stick to boot from it so i took another route

I have installed qemu and then downloaded the 4.4 iso from android x86 site and started this way to detect partitions on the main drive

qemu -boot d -cdrom android-x86-4.4-RC2.iso -hda /dev/sda

 format the partition already prepared in my case 15G /dev/sda4 also do not install grub if you want to modify it manually from debian partition


 After the install is finished you need to test it first that it works i mount /dev/sda4 to see the dir structure
mount /dev/sda4 /mnt
ls /mnt/
android-4.4-RC2  lost+found

so i have modified /etc/grub.d/40_custom this way
 menuentry "Android-x86 4.4" {
set root=(hd0,4) linux /android-4.4-RC2/kernel quiet root=/dev/ram0 androidboot_hardware=eeepc acpi_sleep=s3_bios,s3_mode SRC=/android-4.4-RC2 DATA= initrd /android-4.4-RC2/initrd.img
}

sudo update-grub2


 and restart choose the new android version

Monday, May 19, 2014

Fire Ruby - howto start with Firebird and Ruby on Ubuntu / Debian

This howto is about installing firebird ruby driver on Ubuntu or any Debian based distro
you might need some firebird dependencies and if you need the stable Firebird server  Firebird 2.5 guide to install it

The very basic firebird package to build only the driver is firebird2.5-dev

sudo apt-get install firebird2.5-dev git-core
and choose yes when asked
Then you need to install ruby and the recommended rails way is to use rbenv 

rbenv install 2.1.2
rbenv global 2.1.2
ruby -v
Best way is to install it from gem

gem install fb

Alternate way  is to build install our gem (latest build-able is located here )

git clone https://github.com/rowland/fb.git
cd fb/
gem build fb.gemspec


You will get something like this in terminal :
 Successfully built RubyGem
  Name: fb
  Version: 0.*.*
  File: fb-0.*.*.gem


Now is time to install it using the gem command

gem install fb-0.*.*.gem



Please read the README.
here is how i tested on my machine

Here is part of the example i ran on my pc

pico test.rb 


And here are the results for my ruby test
ruby test.rb 
ID: 0, Name: John 0
ID: 9, Name: John 9

What is next class ? RoR on Firebird

Monday, March 31, 2014

Compiling Linux Kernel Vanilla - Ubuntu/Debian way

Here is my guide on Compiling x.xx.x Vanilla Final - Ubuntu/Debian using the Debian way

This article is about compiling a kernel on Ubuntu systems. It describes how to build a custom kernel using the latest unmodified kernel sources from www.kernel.org (vanilla kernel) so that you are independent from the kernels supplied by your distribution.
Install the Required packages for building it
 
apt-get install git-core kernel-package fakeroot build-essential ncurses-dev
Then download latest kernel version
cd /usr/src
sudo su 
wget --continue http://www.kernel.org/pub/linux/kernel/v4.x/linux-4.xx.x.tar.bz2
tar jxvf linux-*.*.*.tar.bz2
cd linux-*.*.*

$ cp /boot/config-`uname -r` ./.config
$ make menuconfig

make-kpkg clean
fakeroot make-kpkg --initrd --append-to-version=-vanillaice kernel_image kernel_headers
cd ..
dpkg -i linux-image-*.*.*
dpkg -i linux-headers-*.*.*
sudo shutdown -r now

you can install the headers too from /usr/src/linux-headers-3.*.*-*
in my case i can show you how the packages are named
ls *.deb
linux-image-*.*.*-vanillaice_4.4.*-vanillaice-10.00.Custom_amd64.deb
linux-headers-*.*.*-vanillaice_4.4.*-vanillaice-10.00.Custom_amd64.deb

I also created a python script http://github.com/mariuz/kernelcompile

that can be used like this
git clone https://mariuz@github.com/mariuz/kernelcompile.git
cd kernelcompile
sudo ./kernel-compile.py

Friday, March 14, 2014

php5 and firebird pdo on ubuntu / debian

The recommendd method is to use the official php5 source from ubuntu or debian and build only the pdo firebird extension and install it
sudo apt-get install php5-dev firebird2.5-dev php-pear devscripts debget

You need to build the pdo extension from php from ubuntu source code here is the source for php package (apt-get source will do the job for any release)
apt-get source php5
cd php5-*
cd ext/pdo_firebird
phpize
sudo ln -s /usr/include/php5 /usr/include/php
./configure
make
sudo make install 

Check to have in php.ini to have the next lines also with phpinfo() function

sudo pico/vi /etc/php5/conf.d/pdo.ini
# configuration for php PDO module
extension=pdo.so
extension=pdo_firebird.so


php -i | grep PDO
PDO
PDO support => enabled
PDO drivers => firebird
PDO_Firebird
PDO Driver for Firebird/InterBase => enabled

you can also check in apache if all is correct
by creating a page in /var/www/pdo_info.php
with this content



then in the browser press F3 and search PDO
to check if all is ok with the driver then create one small example that loads the driver and then is connecting to the database server



after the driver is loaded now you can use the pdo as usual , here is the fetch example

Tuesday, November 26, 2013

Realocated sector count is 1 , should i fear ?

yesterday my hdd started to fail  (bad blocks from reading files) and from the raw read error rates i was worried that is already dead but it seems that seagate  ST9500325AS drives they do high error rates also one sector can be corrected it seems using filesystem vodoo
The self tests are only done for 10% and then they stop
Seems that only in Linux you can force it to write to a corrupted sector and fix the issue

A nice tool to read the smart values in human format is gsmartcontrol.

sudo apt-get install gsmartcontrol



Tuesday, October 01, 2013

Django Firebird and pyinstaller notes

After installing pyinstaller in python 2.7.x

pip  install pyinstaller
c:\\python27\\scripts\\pyinstaller --version

You need Firebird client installed : run firebird installer

pip install django
pip install fdb
pip install django-firebird

my application is using django-postman and is named that way

c:\\python27\\scripts\\pyinstaller -d --name=django_postman manage.py

I had a issue with Cookie and django 1.5.x (ImportError: No module named Cookie )

ls -lah
dist/django_postman/django_postman.exe
-rwxrwxr-x 1 mariuz mariuz 2.9M Oct  1 13:28 dist/django_postman/django_postman.exe

There are some issues with ctypes dependency support in fdb

So i had to modify in drive_c/Python27/Lib/site-packages/fdb/ibase.py

these lines

    #fb_library_name = find_library('fbclient.dll')
    fb_library_name = 'C:\\windows\\system32\\fbclient.dll'
else:
    fb_library_name = find_library('fbclient')
if sys.platform in ['win32', 'cygwin', 'os2', 'os2emx']:
#    fb_library = WinDLL(fb_library_name)
    fb_library = WinDLL('fbclient.dll')


here is my manage.py config

Flask and pyinstaller notice

I have started to test flask and pyinstaller setup in wine/linux

first i needed to install flask with pip

wine cmd.exe
c:\\python27\\scripts\\pip install flask

then after i have created the hello world flask needs to be added in the --hidden-import at command line like this

c:\\python27\\scripts\\pyinstaller --hidden-import=flask --onefile -d -y hello.py


and you can start it with
dist\hello.exe
* Running on http://127.0.0.1:5000/


Then load in your browser :) The size of the single file binary
 
ls -lah hello.exe 
-rwxrwxr-x 1 mariuz mariuz 5.6M Oct  1 18:03 hello.exe

Thursday, September 26, 2013

Building Firebird Client for Android

Download and install ndk  unzip in your home
install firebird build dependencies

sudo apt-get build-dep firebird2.5

unzip ~/Downloads/android-ndk-r13-linux-x86_64.zip
export NDK=$HOME/android-ndk-r13d
echo $NDK

get the Firebird 3.0 source

http://web.firebirdsql.org/download/prerelease/source/Firebird-3.0.1.32609-0.tar.bz2
tar -jxvf Firebird-3.0.1.32609-0.tar.bz2

cd Firebird-3.0.1.32609-0


cp /usr/include/x86_64-linux-gnu/unicode/platform.h extern/icu/source/common/unicode
cp /usr/include/x86_64-linux-gnu/unicode/uvernum.h extern/icu/source/common/unicode

./autogen.sh --with-system-editline --enable-binreloc --with-cross-build=android.arme

after that the libfbclient.so is created for arm

cd gen/Release/firebird/lib
file libfbclient.so.3.0.0
libfbclient.so.3.0.0: ELF 32-bit LSB  shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, not stripped

You can download from here
http://mariuz.android-dev.ro/android_fbclient/libfbclient.so.3.0.0

Sunday, July 28, 2013

Install Android x86 4.3 on my eeepc with qemu

In fact is an re-install , i had 4.2 in dual boot with debian sid on my eeepc and i wanted to do an upgrade , the issue is that i don't have a usb stick to boot from it so i took another route

I have installed qemu and then downloaded the 4.3 iso from android x86 site and started this way to detect partitions on the main drive

qemu -boot d -cdrom android-x86-4.3-20130725.iso -hda /dev/sda

 format the partition already prepared in my case 15G /dev/sda4 also do not install grub if you want to modify it manually from debian partition


 After the install is finished you need to test it first that it works i mount /dev/sda4 to see the dir structure
mount /dev/sda4 /mnt
ls /mnt/
android-4.3-test  lost+found

so i have modified /etc/grub.d/40_custom this way
 menuentry "Android-x86 4.3" {
set root=(hd0,4) linux /android-4.3-test/kernel quiet root=/dev/ram0 androidboot_hardware=eeepc acpi_sleep=s3_bios,s3_mode SRC=/android-4.3-test DATA= initrd /android-4.3-test/initrd.img
}

sudo update-grub2


 and restart choose the new android version

Friday, July 12, 2013

Install android x86 Jelly Bean on my eeepc with qemu

In fact is an reinstall , i had 2.3 ginger in dual boot with debian sid on my eeepc and i wanted to do an upgrade , the issue is that i don't have a usb stick to boot from it so i took another route

I have installed qemu and then downloaded the 4.2 iso from android x86 site and started this way to detect partitions on the main drive

qemu -boot d -cdrom android-x86-4.2-20130228.iso -hda /dev/sda

format the partition already prepared in my case 15G /dev/sda4 also do not install grub if you want to modify it manually from debian partition


After the install is finished you need to test it first that it works
i mount /dev/sda4 to see the dir structure

so i have modified
/etc/grub.d/40_custom
this way

menuentry "Android-x86 4.2" {
set root=(hd0,4)
linux /android-4.2-test/kernel quiet root=/dev/ram0 androidboot_hardware=eeepc acpi_sleep=s3_bios,s3_mode SRC=/android-4.2-test DATA=
initrd /android-4.2-test/initrd.img
}

sudo update-grub2

and restart 

Sunday, February 24, 2013

What to choose from fourth Firebird Architectures :SuperServer , Classic , SuperClassic or Embedded?

There are some papers around that explain what are the differences : SuperClassic Presentation from one of the main core developers http://www.slideshare.net/ibsurgeon/firebird-25-architecture-by-dmitry-yemanov-in-english
and the Classic vs SuperServer question in the Getting Started guide for Firebird 2.5.x

or another one that i like is this blog post with nice pictures of the three architectures: Super , Classic and SuperClassic http://www.sinatica.com/blog/en/index.php/articles/firebird-superserver-classicserver-or-superclassic

The fourth Architecture is Embedded and that is entire server contained into one dll on windows or so file on linux that can be used without a tcp/local connection and it will access your database file directly

http://www.firebirdsql.org/manual/ufb-cs-embedded.html

Thomas created a compact architecture comparison sheet, which is available here
http://www.iblogmanager.com/download/misc/articles/fb25_architecture_comparison.pdf

Wednesday, February 13, 2013

Adobe Photoshop 1.0 Source Code About 75% is in Pascal




You can read the full article on http://www.computerhistory.org/atchm/adobe-photoshop-source-code/

What i loved was the part about the Efficency and Productivity for Pascal Language , compare that with our days when you need large teams for large and ineficcient java EE projects







That first version of Photoshop was written primarily in Pascal for the Apple Macintosh, with some machine language for the underlying Motorola 68000 microprocessor where execution efficiency was important. It wasn’t the effort of a huge team. Thomas said, “For version 1, I was the only engineer, and for version 2, we had two engineers.”

With the permission of Adobe Systems Inc., the Computer History Museum is pleased to make available, for non-commercial use, the source code to the 1990 version 1.0.1 of Photoshop. All the code is here with the exception of the MacApp applications library that was licensed from Apple. There are 179 files in the zipped folder, comprising about 128,000 lines of mostly uncommented but well-structured code. By line count, about 75% of the code is in Pascal, about 15% is in 68000 assembler language, and the rest is data of various sorts. To download the code you must agree to the terms of the license.

Sunday, February 10, 2013

Lazarus Free Pascal IDE 1.0.14 Final release is available for download, Here is howto install it on #Ubuntu or #Debian

The Lazarus Free Pascal IDE team is glad to announce that Lazarus 1.0.14 is available for download on sourceforge net download area

Check your cpu if is x86-64/32

open console and type

uname -m
x86_64


That means you need 64 bit version that means AMD64 (x86-64 instruction set was invented by AMD and this is why is called this way but all you need to know is AMD64=INTEL64=x64=x86_64 and even if is named that way it will work on all x64 cpus : INTEL, AMD, VIA)

Go to the sourceforge download page
Choose Lazarus Linux amd64 DEB then Lazarus 1.0.14

From that dir you need to install in order :fpc , fpc-src and lazarus

if
uname -m
i686

that means 32 bit version i386 again for all CPUS  INTEL, AMD, VIA


Choose Lazarus Linux i386 DEB then Lazarus 1.0.14
From that dir you need to install in order :fpc , fpc-src and lazarus



ps:why is called i386?

because i386 was the first x86-32 cpu  also this is how debian calls the 32bit port

If you are using fpc deb from lazarus download area on debian or ubuntu and want to pin it from upgrades here is how : 

echo fpc hold  | sudo dpkg --set-selections






Tuesday, January 22, 2013

One way to Scale UP Firebird :put you Database on memory virtual disk or ramfs


There is a new ec2 type of instance with huge memory option : 244G
http://aws.typepad.com/aws/2013/01/ec2-for-in-memory-computing-the-high-memory-cluster-eight-extra-large.html

How this can help you with scaling Firebird ?

There are the cache and memory settings For Firebird but is better to put the main full database on the fastest storage and that is RAM for the moment


On linux i can mount a partition in memory (Install ubuntu/debian)

sudo mkdir /mnt/ram
sudo mount -t ramfs -o size=200G ramfs /mnt/ram
mount to show you the partitions mounted

and then move your database into the ram partition

cp -rp /var/lib/firebird/2.5/data/slowdb.fdb /mnt/ram/fast.db


What about D from the ACID ?

In Firebird we have a nifty feature called Shadow that creates a life snapshots of the active database (Think of it as Replication in real time) so you can activate it and keep a safe database on the SSD/HDD

http://ibexpert.net/ibe/index.php?n=Doc.DatabaseShadow




That large instance could help you with the Firebird cache settings also the extra SSD could do wonders
Inspired by the stack overflow big fat server architecture for the SQL

http://highscalability.com/blog/2009/8/5/stack-overflow-architecture.html



Saturday, January 19, 2013

Debian is used by 32.8% of all the websites who use Linux on January and growing

Debian is used by 32.8% of all the websites who use Linux on January w3techs stats report and growing . RedHat Linux is going bellow 10% ,I f you still deploy Redhat and CentOS on servers think twice they are on he death spiral on the server side usage


Saturday, December 08, 2012

This is why recommend Debian instead of Ubuntu




Ubuntu provides specific repositories of nonfree software, and Canonical expressly promotes and recommends nonfree software under the Ubuntu name in some of their distribution channels. Ubuntu offers the option to install only free packages, which means it also offers the option to install nonfree packages too. In addition, the version of Linux, the kernel, included in Ubuntu contains firmware blobs.


Ubuntu's trademark policy prohibits commercial redistribution of exact copies of Ubuntu, denying an important freedom.


As of October 2012, Ubuntu sends personal data about users' searches to a server belonging to Canonical, which sends back ads to buy things from Amazon. This does not, strictly speaking, affect whether Ubuntu is free software, but it is a violation of users' privacy. It also encourages buying from Amazon, a company associated with DRM as well as mistreatment of workers, authors and publishers.


This adware is one of the rare occasions in which a free software developer persists in keeping a malicious feature in its version of a program.

Sunday, November 18, 2012

My first successfull LibreOffice build 4.0

This is my first successfull LibO build from source  on my Debian sid laptop (it took a while to get all set and waiting for the copile to finish)

After all finished i started it

with make dev-install

/home/mariuz/work/libo/solver/unxlngx6.pro/installation/opt/program/soffice &




Thursday, November 15, 2012

Firebird 2.5.2 stable for all Ubuntu releases is uploaded into ppa



I recommend Ubuntu 12.04 LTS or 14.04 LTS
http://www.firebirdnews.org/?p=7981

The other are builded OK but with some modifications to the Debian scripts

I give some examples of modifications for Lucid and Hardy in the

debian scripts area
http://jimicompot.blogspot.ro/2012/11/firebird-252-for-ubuntu-lucid-is.html

http://jimicompot.blogspot.ro/2012/11/firebird-252-on-ubuntu-hardy.html

Hardy it will be EOL soon in April so for the next Firebird release it

will be skipped

(it doesn't support the quilt 3.0 format and and is hardest to build for )

The older the Distro the harder it it is to build the software for it .

Sunday, November 11, 2012

Lazarus FreePascal IDE on Raspberry PI

I have installed the version from debian respository

sudo apt-get install lazarus-ide fpc


The install and developing process is the same like on any Debian machine
I have started the ide over the ssh

ssh -X pi@192.168.1.104
lazarus-ide



I have the Firebird components i can start doing Database apps like on any desktop






Using Lazarus IDE with Firebird in Ubuntu and Debian

Install the ide
sudo apt-get install lazarus-ide
Start the ide from the console/terminal

 lazarus-ide &
If everything went well you'll see a new tab called SQLdb. This tab will contain two components a TSQLConnection and a TSQLQuery.








SQLdb tab also contains a component TIBConnection that you can place it on the form


We will connect to /var/lib/firebird/2.5/data/employee.fdb
On the form put an TIBConnection, TSQLTransaction,TSQLQuery,TDatasource and an TDBGrid









TIBConnection is configured to have DatabaseName=/var/lib/firebird/2.5/data/employee.fdb
Password=masterkey
Username=sysdba
and Transaction=SQLTransaction1
You can put it to be Connected = True




Then configure SQLTransaction1
to use

Database=IBConnection1
Active =True;




Configure TSQLQuery this way

Database:IBConnection1
SQL=select * from employee;
Active = True;








Configure TDatasource
DataSet=SQLQuery1



Configure TDBGrid

DataSource = DataSource1




Next you can put an button and make them active from run time


procedure TForm1.Button1Click(Sender: TObject);
begin
SQLQuery1.Active:=true;
end;









Wednesday, November 07, 2012

Debian and raspberry pi = love , a small ARM Firebird super server

I have installed debian on my raspberry
here is the login and cpu info

ssh pi@192.168.1.104
pi@192.168.1.104's password: 
Linux raspberrypi 3.2.27+ #250 PREEMPT Thu Oct 18 19:03:02 BST 2012 armv6l

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.

NOTICE: the software on this Raspberry Pi has not been fully configured. Please run 'sudo raspi-config'

pi@raspberrypi ~ $ cat /proc/cpuinfo 
Processor : ARMv6-compatible processor rev 7 (v6l)
BogoMIPS : 697.95
Features : swp half thumb fastmult vfp edsp java tls 
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xb76
CPU revision : 7

Hardware : BCM2708
Revision : 000f
Serial  : 000000008c86c7c9

First thing i search in a debian is the firebird packages
 apt-cache search firebird
falconpl-dbi-firebird - Firebird SQL database abstraction layer for Falcon P.L
firebird-dev - Development files for Firebird - an RDBMS based on InterBase 6.0 code
firebird2.5-classic - Firebird Classic Server - an RDBMS based on InterBase 6.0 code
firebird2.5-classic-common - common files for firebird 2.5 "classic" and "superclassic"
firebird2.5-classic-dbg - collected debug symbols for firebird2.5-classic and -superclassic
firebird2.5-common - common files for firebird 2.5 servers and clients
firebird2.5-common-doc - copyright, licnesing and changelogs of firebird2.5
firebird2.5-doc - Documentation files for firebird database version 2.5
firebird2.5-examples - Examples for Firebird - an RDBMS based on InterBase 6.0 code
firebird2.5-server-common - common files for firebird 2.5 servers
firebird2.5-super - Firebird Super Server - an RDBMS based on InterBase 6.0 code
firebird2.5-super-dbg - collected debug symbols for firebird2.5-super
firebird2.5-superclassic - Firebird SuperClassic Server - an RDBMS based on InterBase 6.0 code
flamerobin - graphical database administration tool for Firebird DBMS
libdbd-firebird-perl - Perl DBI driver for Firebird RDBMS server
libdbi-perl - Perl Database Interface (DBI)
libfbclient2 - Firebird client library
libfbembed2.5 - Firebird embedded client/server library
libib-util - Firebird UDF support library
libwtdbofirebird-dev - Firebird backend for Wt::Dbo [development]
libwtdbofirebird32 - Firebird backend for Wt::Dbo [runtime]
php5-interbase - interbase/firebird module for php5

What is next ? installing firebird 2.5 super server of course
sudo apt-get install firebird2.5-super
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  firebird2.5-common firebird2.5-common-doc firebird2.5-server-common libfbclient2 libib-util
Suggested packages:
  firebird2.5-doc
The following NEW packages will be installed:
  firebird2.5-common firebird2.5-common-doc firebird2.5-server-common firebird2.5-super libfbclient2 libib-util
0 upgraded, 6 newly installed, 0 to remove and 0 not upgraded.
Need to get 3,300 kB of archives.
After this operation, 12.8 MB of additional disk space will be used.
Do you want to continue [Y/n]? Y
Get:1 http://mirrordirector.raspbian.org/raspbian/ wheezy/main firebird2.5-common-doc all 2.5.2~svn+54698.ds4-1 [636 kB]
Get:2 http://mirrordirector.raspbian.org/raspbian/ wheezy/main firebird2.5-common all 2.5.2~svn+54698.ds4-1 [95.7 kB]
Get:3 http://mirrordirector.raspbian.org/raspbian/ wheezy/main libfbclient2 armhf 2.5.2~svn+54698.ds4-1 [223 kB]
Get:4 http://mirrordirector.raspbian.org/raspbian/ wheezy/main libib-util armhf 2.5.2~svn+54698.ds4-1 [3,814 B]
Get:5 http://mirrordirector.raspbian.org/raspbian/ wheezy/main firebird2.5-server-common armhf 2.5.2~svn+54698.ds4-1 [488 kB]
Get:6 http://mirrordirector.raspbian.org/raspbian/ wheezy/main firebird2.5-super armhf 2.5.2~svn+54698.ds4-1 [1,853 kB]                             
Fetched 3,300 kB in 13s (238 kB/s)                                                                                                                  
Preconfiguring packages ...
Selecting previously unselected package firebird2.5-common-doc.
(Reading database ... 57783 files and directories currently installed.)
Unpacking firebird2.5-common-doc (from .../firebird2.5-common-doc_2.5.2~svn+54698.ds4-1_all.deb) ...
Selecting previously unselected package firebird2.5-common.
Unpacking firebird2.5-common (from .../firebird2.5-common_2.5.2~svn+54698.ds4-1_all.deb) ...
Selecting previously unselected package libfbclient2:armhf.
Unpacking libfbclient2:armhf (from .../libfbclient2_2.5.2~svn+54698.ds4-1_armhf.deb) ...
Selecting previously unselected package libib-util:armhf.
Unpacking libib-util:armhf (from .../libib-util_2.5.2~svn+54698.ds4-1_armhf.deb) ...
Selecting previously unselected package firebird2.5-server-common.
Unpacking firebird2.5-server-common (from .../firebird2.5-server-common_2.5.2~svn+54698.ds4-1_armhf.deb) ...
Selecting previously unselected package firebird2.5-super.
Unpacking firebird2.5-super (from .../firebird2.5-super_2.5.2~svn+54698.ds4-1_armhf.deb) ...
Processing triggers for man-db ...
Setting up firebird2.5-common-doc (2.5.2~svn+54698.ds4-1) ...
Setting up firebird2.5-common (2.5.2~svn+54698.ds4-1) ...
Setting up libfbclient2:armhf (2.5.2~svn+54698.ds4-1) ...
Setting up libib-util:armhf (2.5.2~svn+54698.ds4-1) ...
Setting up firebird2.5-server-common (2.5.2~svn+54698.ds4-1) ...
adduser: Warning: The home directory `/var/lib/firebird' does not belong to the user you are currently creating.
Setting up firebird2.5-super (2.5.2~svn+54698.ds4-1) ...
Created default security2.fdb
[ ok ] Firebird 2.5 super server not running.
[warn] Not starting Firebird 2.5 super server ... (warning).
[warn] Use `dpkg-reconfigure firebird2.5-super' to enable ... (warning).
So let's enable Firebird super server
pi@raspberrypi ~ $ sudo dpkg-reconfigure firebird2.5-super
[ ok ] Firebird 2.5 super server not running.
[ ok ] Starting Firebird 2.5 super server...done.
[ ok ] Firebird 2.5 super server already running.
Yes it's on
ps axu | grep firebird
firebird  2830  0.0  0.1   4528   796 ?        S    19:18   0:00 /usr/sbin/fbguard -daemon -forever -pidfile /var/run/firebird/2.5/fbserver.pid
firebird  2832  0.2  1.0  62444  4540 ?        Sl   19:18   0:00 /usr/sbin/fbserver

Still got 256m of free memory for nginx , php , or something better a node.js experiment Let's create/use a database and see simple firebird at work
sudo apt-get install firebird2.5-examples firebird-dev
cp /usr/share/doc/firebird2.5-common-doc/examples/empbuild/employee.fdb.gz
gunzip employee.fdb.gz
sudo chown firebird.firebird employee.fdb
mv employee.fdb /var/lib/firebird/2.5/data

isql-fb
Use CONNECT or CREATE DATABASE to specify a database
SQL> connect "/var/lib/firebird/2.5/data/employee.fdb " user 'SYSDBA' password 'masterkey'
CON> ;
Database:  "/var/lib/firebird/2.5/data/employee.fdb ", User: SYSDBA
SQL> 
show tables;
       COUNTRY                                CUSTOMER                       
       DEPARTMENT                             EMPLOYEE                       
       EMPLOYEE_PROJECT                       JOB                            
       PROJECT                                PROJ_DEPT_BUDGET               
       SALARY_HISTORY                         SALES                          


SQL> show version;
ISQL Version: LI-V2.5.2.26508 Firebird 2.5
Server version:
Firebird/linux ARM (access method), version "LI-V2.5.2.26508 Firebird 2.5"
Firebird/linux ARM (remote server), version "LI-V2.5.2.26508 Firebird 2.5/tcp (raspberrypi)/P12"
Firebird/linux ARM (remote interface), version "LI-V2.5.2.26508 Firebird 2.5/tcp (raspberrypi)/P12"
on disk structure version 11.2
SQL> 
SQL> create database "/var/lib/firebird/2.5/data/first_database.fdb" user 'SYSDBA' password 'masterkey'
CON> ;
Commit current transaction (y/n)?y
Committing.
SQL> connect "/var/lib/firebird/2.5/data/first_database.fdb" user 'SYSDBA' password 'masterkey';
Commit current transaction (y/n)?y
Committing.
Database:  "/var/lib/firebird/2.5/data/first_database.fdb", User: SYSDBA
SQL> CREATE TABLE TEST (ID INT NOT NULL PRIMARY KEY, NAME VARCHAR(20));
SQL> show tables
CON> ;
       TEST                            
SQL> INSERT INTO TEST VALUES (1, 'John');
SQL> INSERT INTO TEST VALUES (2, 'Joe');
SQL> select * from test;

          ID NAME                 
============ ==================== 
           1 John                 
           2 Joe                  

SQL> 


Later i will try firebird c api examples
cd /usr/share/doc/firebird2.5-common-doc/examples/api 
cp *.gz ~/
chown pi.pi *.gz
cd ~
gunzip *.gz
gcc -L/usr/lib -lfbclient -I/usr/share/doc/firebird2.5-common-doc/examples/include/ api1.c
ISC_USER=SYSDBA ISC_PASSWORD=masterkey ./a.out /tmp/new.fdb
Created database '/tmp/new.fdb'.

Successfully accessed the newly created database.
So all it works as it should without errors and at the speed of pentium 2 like system or even faster I love the small server and i can leave it on 24x7 without the need to think too much for the energy costs
Next i have tested the firebird python driver fdb
sudo apt-get install python-pip
 

pip install fdb
cat test.py
con = fdb.connect(dsn='/var/lib/firebird/2.5/data/employee.fdb', user='sysdba', password='masterkey')

cur = con.cursor()
SELECT = "select * from employee"



# 2. Equivalently using fetchall():
# This is potentially dangerous if result set is huge, as the whole result set is first materialized
# as list and then used for iteration.
cur.execute(SELECT)
for row in cur.fetchall():
    print 'ID:%d Name %s.' % (row[0], row[1])


python test.py
....
ID:141 Name Pierre.
ID:144 Name John.
ID:145 Name Mark.

Next on my testing list is compiling the node.js (doing it rightnow) and the pure JavaScript Firebird driver with an express demo Update : compiling node is done here are my results

Tuesday, November 06, 2012

TopDAY: Drupal Meetup in Târgu Mureș


Great PHP local event will take place in Târgu MureÈ™, in November 8: TopDAY - Drupal Meetup. The event is focusing on short presentations about Drupal and is supported by Reea
Details:

Saturday, November 03, 2012

Upgrading from ubuntu 12.10 to debian sid

A good idea is to install a light desktop manager like lxdm or xfce so at least you have a DM in case
gnome will not work out

Install debian keyring http://packages.debian.org/sid/all/debian-archive-keyring/download


modify /etc/apt/sources.list
delete all the lines and
add these ones 

deb  http://http.debian.net/debian/ sid main contrib non-free
deb-src  http://http.debian.net/debian/ sid main contrib non-fre


apt-get update
apt-get -f -o Dpkg::Options::="--force-overwrite" upgrade


there will be a lot of issues and it might bring your  machine unbootable
So be prepared with a testing debian stick or cd

Make a list with packages removed by the dist-upgrade
in my case i have noticed that network manager will be removed

apt-get -f -o Dpkg::Options::="--force-overwrite" dist-upgrade

From the removed packaged i picked the critical ones that i know i need and i download them before to start the upgrade so i can install them with dpkg -i


Here is my list that i needed on my system (that i know that are critical to me and to make the system functional)
apt-get  install --download-only network-manager network-manager-gnome lxde modemmanager ssh openssh-server alsa-utils anacron at


Here are some of the issues that could happen while upgrading the machine there are many dpkg-new files in the /etc/init.d/ folder so here are some tips bellow

Init scripts and networking system
Get rid of upstart first. I had problems with sysv-rc and needed to force reconfiguration. Some init scripts were installed with "dpkg-new" in the name, I had to rename them. As with X, I tried few solutions, this is distilled but stil redundant version:
dpkg-reconfigure sysv-rc
cd /etc/init.d
mv acpid.dpkg-new acpid
mv anacron.dpkg-new anacron
mv atd.dpkg-new atd
mv cron.dpkg-new cron
mv dbus.dpkg-new dbus
mv module-init-tools.dpkg-new module-init-tools
mv procps.dpkg-new procps
mv rsyslog.dpkg-new rsyslog
mv udev-mtab udev
apt-get --reinstall install base-files ifupdown initscripts netbase sysv-rc sysvinit sysvinit-utils






Saturday, October 13, 2012

People still use Pascal? yes and is Growing


Free Pascal and  Delphi/ OO Pascal is growing that is what Tiobe says : if you add them both it should be in the top 10 programming languages displacing Ruby and JavaScript 
1.097+0.839=1.936
Another more credible source is the downloads page on sourcefogre for the Lazarus IDE

We assist on Libre Pascal Renascence of Hacker culture that they don't care about corporate languages like C#/Java

Why ? because Pascal is Modern and insanly Fast and it does have it's own advatages compared with other languages. 
Here are advatages in using the modern Pascal http://www.freepascal.org/advantage.var
I have written my own rants here , feel free to comment
The trend is for typed and more readable languges TypeScript , Python , Ruby ...

Wednesday, October 03, 2012

Installing Firebird Active Record driver for Ruby

Here is how to install activerecord-fb-adapter for rails
using the the gem version

gem install activerecord-fb-adapter
Fetching: fb-0.7.*.gem (100%)
Building native extensions.  This could take a while...
Fetching: activerecord-fb-adapter-0.7.*.gem (100%)
Successfully installed fb-0.7.*
Successfully installed activerecord-fb-adapter-0.7.*
2 gems installed
That is all You can build it manually if you wish
git clone https://github.com/rowland/activerecord-fb-adapter.git
cd activerecord-fb-adapter
rake gem

ls -lah pkg/activerecord-fb-*

gem install pkg/activerecord-fb-adapter-*.gem 

Successfully installed activerecord-fb-adapter-0.7.*
1 gem installed
Successfully installed 

gem install rails 
So now we are ready to play with Rails on Fire

Update:Rails works with this driver and here is the Rails guide

Sunday, September 30, 2012

Meet Compton - compozite manager for Lubuntu with shadows, transparencies and smooth transitions Installing it on Ubuntu 12.04

In Lubuntu 12.10 You can have shadows, transparencies and smooth transitions in your windows and programs thanks to Compton, the new composite manager in town. It's a fork from xcompmgr-dana (which is a fork istelf from xcompmgr). Thanks to our pals at Crunchbang Linux, we can use the GIT versions on Lubuntu too.


Download your 32bit or 64bit version and try it while it's hot. Combine it with your favourite dock or whatever. And this program solves the problem that Lubuntu 12.10 users may have with other composite managers, like Cairo or XCompMgr. You can check the screenshot to see it's really beautiful, but I can sure you that it's really fast too!

To install it on Lubuntu 12.04 you need to get the libconfig9 from 12.10
The wallpaper is from here 
http://sostopher.deviantart.com/gallery/?catpath=/&offset=24#/d1wuxjo

Friday, September 28, 2012

#Perl #Firebird driver DBD-Firebird 1.11 is released with utf-8 and other bugfixes

On the behalf of the developers and contributors team, I'm pleased to announce that DBD::Firebird v1.11 , a DBI driver for the Firebird RDBMS server is released.
This release brings many changes and bugfixes .

* Test::Exception is required 
* On freebsd Threaded perl is required you have to re-install perl from ports and you have to select the config option that says 'build a perl with threads'
* Test database to use UTF8 charset and enable UTF8 for the connection
* Fix CHAR lenght when using multi-byte character set Fixes Github Issue #32 (RT#76506)
* additional debug when finishing already finished statement
* avoid double destroying of statement in auto-commit mode with DDL Fixes Github Issue #30 (RT#72946)
The development is done on GitHub And the mailing list is here
Thank you,