Wednesday, September 30, 2009

Weird vncviewer in vncviewer with shared desktop option in #ubuntu

I wanted to share my desktop over the ssh connection , I will do ssh -X from another machine
and start the vncviewer , and here is how it looks when you start vncviewer on the localhost

Friday, September 25, 2009

Building #Firebird 2.5.x extension for #Php 5.x.x on #Windows

Follow the advice on howto compile php on windows with visual studio express (yucks)
http://wiki.php.net/internals/windows/stepbystepbuild
I  will not copy paste all  the steps here , a short document makes them easy to follow


1.Install Cisual Studio  C++ 20xx
http://www.microsoft.com/express/Downloads/#2008-Visual-CPP
2. get and install windows sdk 6.1
3. get a php 5.x snapshot or any stable version 5.x (do not extract yet!)


Next is is to download a zip file with firebird 2.5.x final from sourceforge 


in my case http://sourceforge.net/projects/firebird/files/firebird-win32/2.5.2-Release/Firebird-2.5.2.26540-0_Win32_pdb.zip/download


Next is to unzip the files from bin,include,lib
into C:\php-sdk\php53dev\vc9\x86\deps


enable firebird extension from the build console (By default thread safe version is build )


configure --disable-all --enable-cli --with-interbase 
nmake 
cd Release_TS
php -m 


should show you that interbase/firebird extension is there 








If you want to create the shared dll for the firebird extension you need to provide 
--with-interbase=shared to the configure script
otherwise it will be included in the big php executable 
Another note is if you do use IIS with fastcgi then you must disable threading support (Non Thread Safe ) in the configure part you must add --disable-zts



Update:
The work to compile full firebird 2.5.x server with visual c++ 20xx and $sudo make the php core developers happy is DONE (the firebird extension it will be included by default in official php 5.x zip file for windows)

Wednesday, September 16, 2009

Compiling #mysql #workbench 5.1.x on #ubuntu #debian #Linux

At this time 5.1.19 is available on download link 

wget http://dev.mysql.com/get/Downloads/MySQLGUITools/mysql-workbench-gpl-5.1.19-src.tar.gz/from/http://mysql.mirrors.pair.com/ -O mysql-workbench-gpl-5.1.19-src.tar.gz

tar -zxvf mysql-workbench-oss-5.1.19.tar.gz
cd mysql-workbench-oss-5.1.19/
sudo apt-get install libzip-dev libsigc++-2.0-dev libglade2-dev libgtkmm-2.4-dev
libgnome2-dev uuid-dev lua5.1 liblua5.1-0-dev libpcre3-dev




 ./autogen.sh
make -j2
sudo make install

Compiling #mysql #workbench alpha 5.2.x on #ubuntu #karmic

At this time alpha 5.2.3 is available on download link  wget http://dev.mysql.com/get/Downloads/MySQLGUITools/mysql-workbench-oss-5.2.3.tar.gz/from/http://ftp.astral.ro/mirrors/mysql.com/  


tar -zxvf mysql-workbench-oss-5.2.3.tar.gz 
cd mysql-workbench-oss-5.2.3 


sudo apt-get install libzip-dev libsigc++-2.0-dev libglade2-dev libgtkmm-2.4-dev libgnome2-dev uuid-dev lua5.1 liblua5.1-0-dev libpcre3-dev  libmysqld-dev libboost-dev python-paramiko


this time you need to install libsqlite doh ! 


sudo apt-get install libsqlite3-dev  
./autogen.sh 
make -j2 
sudo make install

Tuesday, September 15, 2009

You don't need #OpenDNS , you have your own dns server on #Ubuntu !ubuntu

Install isc bind server

sudo apt-get install bind9

test if the dns query works

$ dig reea.net @127.0.0.1

make it default resolver for your system

sudo pico /etc/resolv.conf

or open it with any editor

sudo kate /etc/resolv.conf
add this entry
nameserver 127.0.0.1

delete all other nameservers or comment them if you want

and that is all (tested on ubuntu karmic and intrepid)

Friday, September 11, 2009

debtree-next - better #Firebird package dependecies graphs in #debian #ubuntu

Inspired by the new dbtree from git now you can do a clean graph for the packages in debian and ubuntu

$ git clone git://git.debian.org/~fjp/debtree.git
Here is the graph for installed files for firebird2.1-classic

$ ./debtree --no-recommends --no-conflicts -I -S firebird2.1-classic >out.dot
$ dot -T png -o out.png out.dot



Here is the graph for installed files for firebird2.1-supper
$ ./debtree --no-recommends --no-conflicts -I -S firebird2.1-super >super_out.dot
$ dot -T png -o super_out.png super_out.dot



Now you can do reverese dependency graph , here is the example for libselinux1 if you dare to remove it

$ ./debtree -I -R --no-recommends --no-conflicts libselinux1 > libselinux.out
$ dot -T png -o libselinux.png libselinux.out
$ gwenview .

Wednesday, September 09, 2009

How much #freedom is inside my #ubuntu borkstation ~99%

$ sudo apt-get install vrms

so i'm something like 1-2% not free , I will do some cleanup today at home


$ vrms
Non-free packages installed on borkstation64

alien-arena-data Game data files for Alien Arena
bugsx program to evolve biomorphs using genetic algorithms
nvidia-180-kernel-source NVIDIA binary kernel module source
nvidia-180-libvdpau Video Decode and Presentation API for Unix
nvidia-180-modaliases Modaliases for the NVIDIA binary X.Org driver
nvidia-glx-180 NVIDIA binary Xorg driver
nvidia-glx-180-dev NVIDIA binary Xorg driver development files
picasa Image management application from Google
skype Skype - Take a deep breath
sun-java6-bin Sun Java(TM) Runtime Environment (JRE) 6 (architecture
sun-java6-jre Sun Java(TM) Runtime Environment (JRE) 6 (architecture
unrar Unarchiver for .rar files (non-free version)
Reason: Modifications problematic
uqm-content The Ur-Quan Masters - Game data files
warsow-data Game data for Warsow

Non-free packages with status other than installed on borkstation64

cdrecord ( dei) command line CD writing tool
libmyth-0.20 ( dei) Common library code for MythTV and add-on modu
linux-restricted-modules- ( dei) Non-free Linux 2.6.24 modules on x86/x86_64
nvidia-glx ( dei) NVIDIA binary XFree86 4.x/X.Org driver
Reason: Proprietary license
nvidia-glx-new ( dei) NVIDIA binary XFree86 4.x/X.Org 'new' driver
tangerine-icon-theme ( dei) Tangerine Icon theme
xorg-driver-fglrx ( dei) Video driver for ATI graphics accelerators

Contrib packages installed on borkstation64

alien-arena Standalone 3D first person online deathmatch shooter
dosemu The Linux DOS Emulator
googleearth-package utility to automatically build a Debian package of Goo
msttcorefonts transitional dummy package
nvidia-common Find obsolete NVIDIA drivers
nvidia-kernel-common NVIDIA binary kernel module common files
nvidia-settings Tool of configuring the NVIDIA graphics driver
openttd reimplementation of Transport Tycoon Deluxe with enhan
ttf-mscorefonts-installer Installer for Microsoft TrueType core fonts
uqm The Ur-Quan Masters - An inter-galatic adventure game
warsow fast paced 3D first person shooter

Contrib packages with status other than installed on borkstation64

flashplugin-installer ( dei) Adobe Flash Player plugin installer
mozilla-mplayer ( dei) MPlayer-Plugin for Mozilla
openoffice.org-hyphenatio ( dei) English (GB) hyphenation pattern for OpenOffic
openoffice.org-hyphenatio ( dei) English (US) hyphenation pattern for OpenOffic

~43 non-free packages, 1.2% of 3574 installed packages.
16 contrib packages, 0.4% of 3574 installed packages.

Howto change #Firebird password in #Ubuntu , #Debian ,#Linux

On Ubuntu with firebird 2.1 you can change password if you forgot it this way
1.First method
$sudo gsec -modify sysdba -pw 123456 (we trust root user muhahaha)

2.Second method
$sudo su
cd /var/lib/firebird/2.1/system
cp default-security2.fdb security.fdb
$ /etc/init.d/firebird2.1-classic restart

3.Third method
$ sudo dpkg-reconfigure firebird2.1-classic

On windows if you are in the Administrator group i guess you can change it with gsec from command line
C:\Program Files\Firebird\Firebird_2_1\bin> gsec -modify sysdba -pw 123456

#Firebird , #Mysql and Not NULLs + Stored Procedures

Last night/morning i have read again some rants against the NULLs in one of the CJ Date book SQL and the Relational theory and in practice it's is true that I found one table with something like 20% of it filled with nulls (not normalized) and let's say that count(*) is in the range of millions , Now you have a lot of scans for data that is not there So is better to split that table and normalize it also the columns should be NOT NULL by default for example EMPLOYEE_ID

Now comes the good part you don't need to pollute the queries with NOT NULLS anymore and you get more speed , it depends how many nulls you had before (of course there are opimizer tricks to do some shortcuts)
and save the plannet for overheating

On mysql i eliminated not null check from one query it didn't improved too much the speed (~0.2s ) but at least it's easier to read
on firebird side it improved performance but again not so much (~0.2 s)

I started to create a selectable stored procedure and at least in firebird part it was faster 0.2s vs the query without selectable sp

In the end i got 0.4 seconds only by eliminating NULL from the query and creating a selectable procedure

Monday, September 07, 2009

wicd vs network manager on karmik

I have installed wicd by a simple 
$ sudo apt-get install wicd 

it removed network-manager and network-manager-gnome 

what do you get ? a better wireless manager , seems that it connects to the network before the gui 
gets started so from the console i can upgrade or dist-upgrade 
and it works from any DE: gnome/lxde/kde ... 

For the moment i will stick to it 


Caking for FUN+Profit

Here is my  presentation prepared for php meetup in boston but also was showed at
geekmeet #2 from Targu Mures

Firebird, mysql and CXXFLAGS

I have tried to optimize the speed for mysql and Firebird but for the moment
it seems for that particular query there is no difference (io starved) , maybe i need some queries with math calculations to see the benefit for thouse flags

On the firebird side seems that CXX flags are not considered at all and i will inspect why 

Here are my flags anyway

http://paste.ubuntu.com/266785/

The good news is that at least make -j2 should work for firebird HEAD
Update: seems that it works if I export only the CXXFLAGS

export CXXFLAGS="-O3 -march=core2 -mtune=core2 -mfpmath=sse"

Firebird 2.1 dependency graph in ubuntu

I was reading about debian and ubuntu bloat growing , more useless packages are installed by default
Read the full article here

"For comparison, the size of a default Gnome desktop install for Etch was 1360MB; for Lenny it is 1830MB; for Squeeze it looks like it will be well over 3000MB! Remember that for Sarge we installed both Gnome and KDE from CD1 with both together taking 1390MB?"

So i wanted to create a dependecy graph for firebird using Debtree
http://alioth.debian.org/~fjp/debtree/

All you need is to install the debtree package , seems that is not included by default in ubuntu So click here
http://alioth.debian.org/~fjp/debtree/debtree_0.7.3_all.deb

$ debtree firebird2.1-super >out.dot
$ dot -T png -o out.png out.dot


Thursday, September 03, 2009

#xming install for #xforwarding for #windows

we needed to access xserver from windows pc and we installed xming with ssh forwarding
ran the setup
Installed the fonts
started xming then created a new ssh connection from putty
you need to add xforwarding and localhost:0 in the Xforwarding area
then from the putty prompt run xfce4-session or any X program

Wednesday, September 02, 2009

#Mysql 5.4.x from source on #Ubuntu #Karmic #Server #x64

I needed to run mysql5.4.x compiled from source , the version from ubuntu is old 5.1.x
and for this i had to do following steps
Follow the download link for mysql

http://dev.mysql.com/downloads/mysql/5.1.html#source

$ sudo apt-get build-dep mysql-server

Download the last source code archives for the mysql :
$ wget http://dev.mysql.com/get/Downloads/MySQL-5.4/mysql-5.4.1-beta.tar.gz/from/http://ftp.astral.ro/mirrors/mysql.com/


$ tar -zxvf mysql-5.4.1-beta.tar.gz

$ cd mysql-5.4.1-beta/
$ ./configure --prefix=/opt/mysql5.4.x --localstatedir=/opt/mysql5.4.x --with-plugins=all --without-debug --with-mysqld-user=mysql --with-unix-socket-path=/tmp/mysql5.4.x.sock

Create a non-privileged group and user for the database server, as below:

$ sudo groupadd mysql
$ sudo useradd -g mysql mysql

count the number of cpus you have

$ cat /proc/cpuinfo | grep -c processor

4 is in my case (quad core) so i will use it for make argument

$ make -j4

Create data directory and set the right permission on it:

$ sudo mkdir -p /var/lib/mysql5.4.x
$ sudo chown mysql.mysql /var/lib/mysql5.4.x

$ sudo make install
cd /opt/mysql5.4.x/bin/


$ sudo ./mysql_install_db --datadir=/var/lib/mysql5.4.x --user=mysql

Copy the init script from to the source directory mysql-5.4.1

$ sudo cp support-files/mysql.server /etc/init.d/mysql-5.4.x

modify this variable
datadir=/var/lib/mysql5.4.x
in the start-up script

$sudo pico /etc/init.d/mysql-5.4.x

add the script at startup

$ cd /etc/init.d
$ sudo chmod +x mysql-5.4.x
$ sudo update-rc.d mysql-5.4.x defaults

Start mysql server
$ sudo /etc/init.d/mysql-5.4.x start

Connect to mysql server
$ /opt/mysql5.4.x/bin/mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.4.1 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>


Set password for root user

$ /opt/mysql5.4.x/bin/mysql -u root
mysql> UPDATE mysql.user SET Password = PASSWORD('newpwd')
-> WHERE User = 'root';
mysql> FLUSH PRIVILEGES;


Remove the anonymous accounts

mysql> use mysql
mysql> delete from user where user='';