Vôsgitude

Un vosgien te dira qu’on est comme on est…

I added some code to track down where FBClone spends most of it’s time.

You can download FBClone v1.5 and try with the verbose option, it will log tons of funny things on the console so you will not have to go for a beer 🙂

If you see something interresting, please send my your output log by email (pierre at levosgien dotnet)

Thank you for your help !

Tags: , , ,

Repairing broken Firebird database can be sometimes a bit difficult. The official tools (gfix and gbak) not always can help you so you will have to find ways to transfer data from broken database into another fresh and clean one.

There are some tools that can help you :


  • IB Datapump that is a bit old an not very fine tuned to access broken databases

  • FB Copy that lacks options to access broken databases too.

If your database is heavily broken, you will have to fire out the heavy artillery and buy some commercial products like IBFirstAid.

This incredible piece of software will walk throught your database, finding errors and inconsistencies, fix them so you will, probably be able to access your databasa again with gfix and gbak.

I’ve written my own database cloning tool for Firebird. It’s named FBClone, it’s written with Delphi and uses the wonderful UIB Components from Progdigy.

Features :


  • Clone a whole database like a backup (gbak -b) and a restore (gbak -c) in a single pass

  • Pump data from a source database into another one with the same structure. A database with the same structure can be created with gbak using the option ”-m” to restore metadata only.

  • Change database and data charset, converting an old Firebird 1.5 ISO8859_1 database into a fresh new Firebird 2.1 UTF8 one.

You can download FBClone 1.4 Source and Windows Executable.

[Edit] Updated FBClone to v1.4
ChangeLog :


  • Support Firebird 2.1+

  • Improved output

  • Allow to change target database page size (example : -ps 8192)

  • English is the default language for the application now.

[Edit] The code is shared under the IDPL – Initial Developer Public License – Thank you for sharing your modifications.

Tags: , ,

I wrote a little batch script to switch between versions of Firebird SQL Server nearly automatically. Read the rest of this entry »

Tags: ,

SSH is a wonderful piece of software. I found (hum, Philippe, the CentOS package maintainer, president of the Firebird Foundation and member of the QA team of Firebird helped me to find) how to create a SSH tunnel through I can run a distant Firebird backup.

This is the standard gbak command :

$ gbak -b [-v] XXX.XXX.XXX.XXX:database backup.fbk -user SYSDBA -password masterkey

With that command you can create a LOCAL backup of a REMOTE database.

With this command :

$ gbak -b [-v] -service XXX.XXX.XXX.XXX:service_mgr database /path/to/backup.fbk -user SYSDBA -password masterkey

You will create a REMOTE backup (in /path/to/backup.fbk) of a REMOTE database.

Now, how can I create a LOCAL backup for a REMOTE database with stream compression and encryption ? By using SSH Tunnelling.

$ ssh -C -f user@XXX.XXX.XXX.XXX -L 3052:localhost:3050 -N

This will run a background (-f) SSH Tunnel (-L) mapping local port 3052 to remote port 3050 (3052:localhost:3050) with compression (-C, or -o Compression=yes) and without running a remote command (-N)

Now we can use this tunnel to start a secured/compressed remote backup :

$ gbak -b [-v] localhost/3052:database backup.fbk -user SYSDBA password masterkey

Note : “database” can be an alias name, if defined in /etc/firebird/aliases.conf (location depends on your distribution package maintainer, at least this is where I can find this file on CentOS 5.3 using EPEL Testing repository) or the full path of the database on the host system. “backup.fbk” is the local path of the backup file.

You will restore this backup locally by using this command :

$ gbak -c [-v] backup.fbk database -user SYSDBA -password masterkey

Of course, you will have to adjust the user/password depending on your own configuration.

Tags: , , , , ,

Because I’m fed of searching for this kind of useful command :

$ for F in *; do E=${F:(-4)}; B=${F/$E/}; mv $F 'Wonderful.Serial.FileName.S03E'$B.'VOSTFR.HDTV.XViD.GKS'$E; done

Explanations :
E = ${F:(-4)} extracts the file extension.

B = ${F/$E/} returns the original filename without extension.

These two variables are then used to build the new filename 🙂

[EDIT]

Another one, using sed and regular expressions :

$ for A in *.avi; do mv "$A" `echo $A | sed -r 's/^Name To Remove <ins>([0-9]</ins>(-[0-9]+)?)\.avi$/\1.avi/'`; done

Were we build a simple “mv” command with the original filename ($A) and a new filename by catching the output of echo $A | sed enclosing it with backquotes (`).

sed -r allows to use extended regular expressions.

s/you/me/ is the sed command to Subsitute you by me.

s/^Name To Remove ([0-9](-[0-9]+)?)\.avi$/\1.avi/

We match filenames like :

  • Name To Remove 123.avi (as many spaces as you want between the textual part of the name and the file number)
  • Name To Remove 123-456.avi

    We catch the subexpression between parenthesis (123 or 123-456 in this poor example) and we use it to build the new filename (thanks to ”\1” in the third part of the sed command.)

Tags: , , ,

Thanks to eix !

Note : You must be root to unmerge packages

Start by installing emerge if you don’t have it : emerge eix

Run update-eix to create or update the eix database.

Now, this… trick should work for you too 😉

eix --nocolor -c -I -C dev-ruby | cut -d " " -f 2 | grep --color=never dev-ruby | xargs emerge --unmerge

Need some explanations ?

eix -c -I -C dev-ruby extracts all installed packages from dev-ruby

cut -d " " -f 2 extracts the full package name

grep --color=never dev-ruby filters the list ignoring eix overlays info and packages count (you could also use eix -c -*... to avoid that)

xargs takes the whole packages list and send it as a list of arguments to emerge --unmerge that will unmerge all listed packages in one shot !

Tags: , ,

This is my first released backup script for Firebird RDBMS. It automagically search for all Firebird databases from a central directory, uses gfix to validate them, then backup + gzip them to a central backup directory keeping only 5 last successful backups.

It may be used as a cron script to automate Firebird databases backup. Read the rest of this entry »

Tags: , , ,

Il n’est pas possible d’installer le gem sqlite3-ruby requis par Rails 2.x pour faire fonctionner une application “par défaut” si on utilise la version MinGW32 de Ruby packagée dans le projet Ruby Installer 3.0 pour Windows.

Alors il faut bidouiller un peu… en fait la modif est tellement simple qu’elle devrait pouvoir être intégrée directement à sqlite3-ruby ou à Ruby Installer puisqu’il sait d’ores et déjà récupérer des sources, les décompresser et les compiler lui-même…

Moi, compiler, ça m’amuse, alors on y va, même pas peur !

Read the rest of this entry »

Tags: , , ,

On y est, voici la seconde partie de mon tutoriel sur Rails 2.1. Commencez par la première partie si vous ne l’avez pas déjà lue.

Read the rest of this entry »

Tags: , ,

Cet article est la traduction de la première partie de l’article Rolling With Rails 2.1 de Fabio Akita, j’ai conservé le style de Fabio à la première personne, c’est donc Fabio qui parle dans la suite de ce texte (là c’était moi, vous avez compris) et mis à jour les exemples avec ce qui est produit par la version finale de Rails 2.1.

Je vais reprendre exactement là où nous nous étions arrêtés dans le précédent tutoriel, si vous ne l’avez pas lu, je vous suggère de le faire maintenant ou de télécharger le code qui est disponible sur GitHub. J’ai ajouté un tag ‘for_2.0’ pour ce qui concerne le précédent tuto et un nouveau tag ‘for_2.1’ pour les mises à jour que je suis sur le point de vous montrer dans ce nouvel article. Vous pouvez soit suivre mon précédent tutoriel pour voir tout fonctionner ou le sauter et vous contenter de télécharger le code d’exemple depuis ma page GitHub.

Pour la suite de cet article, je vais considérer que vous avez le projet ‘blog’ dans un répertoire de votre machine. Peu importe que vous l’ayez décompressé depuis le tarball ou que vous ayez cloné l’arbre complet depuis mon dépôt GitHub.

Ceci est la première partie et voici la deuxième partie.

Read the rest of this entry »

Tags: , ,

« Older entries