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
Tuesday, October 01, 2013
Flask and pyinstaller notice
I have started to test flask and pyinstaller setup in wine/linux
first i needed to install flask with pip
then after i have created the hello world flask needs to be added in the --hidden-import at command line like this
and you can start it with
Then load in your browser :) The size of the single file binary
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
You can download from here
http://mariuz.android-dev.ro/android_fbclient/libfbclient.so.3.0.0
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 $NDKget 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-0after that the libfbclient.so is created for armcp /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
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
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
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
}
and restart choose the new android version
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+foundso 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
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
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.
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.”
Download Photoshop version 1.0.1 Source Code
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
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
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 :
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 &
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
The install and developing process is the same like on any Debian machine
I have started the ide over the ssh
I have the Firebird components i can start doing Database apps like on any desktop
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

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;

sudo apt-get install lazarus-ideStart 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;

Labels:
debian,
firebird,
free pascal,
lazarus,
ubuntu
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
Next i have tested the firebird python driver fdb
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 : 000000008c86c7c9First 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 php5What 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/fbserverStill 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:
- Read the official post
- Register to the event
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:
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
Update:Rails works with this driver and here is the Rails guide
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 installedThat 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 railsSo now we are ready to play with Rails on Fire
Update:Rails works with this driver and here is the Rails guide
Subscribe to:
Posts (Atom)



