Salve, mi chiamo Matteo Mattei e sono Ingegnere Informatico. Mi occupo da anni di sviluppo software e sistemistica Linux e ho realizzato questo portale per promuovere i miei prodotti e i miei servizi, ma anche per scrivere e condividere le varie problematiche che di volta in volta mi trovo ad affrontare con le nuove frontiere della tecnologia e della comunicazione.


Hello, my name is Matteo Mattei and I am a Computer Science Engineer. Since a long time I deal with software developing and Linux system administration and I realized this portal to advertise my products and my services, but also to write and share all the issues I find every day in the new frontiers of technology and communication.

How to transfer an entire website via ftp with recursive lftp

In these days I've to transfer some big websites from a server to another and the only way to do this it was an FTP connection because the destination server did not provide any other type of access. Because of the number of files was big (about 12GB) I've created a little script to use with lftp opened into a screen session so don't make me a terminal busy for days.

So I've created a script called sendfiles.sh in this way:

set ftp:ssl-allow no
open -u username,password example.com
mirror -c -R /source-path /destination-path
quit

Where the following fields are respectively:

username: user name for ftp access
password: password for ftp access
example.com: destination ftp server
source-path: source path on local server
destination-path: remote path on the ftp (where / is the ftp rootdir)

To run the script is sufficient to open a screen session (if you want to leave the process in background on the source server) and issue this command:

lftp -f sendfiles.sh

Install imagemagick with PHP imagick extension on CentOS

To install imagemagick with PHP imagick extension on Linux CentOS you must follow these steps:

yum install ImageMagick.i386
yum install ImageMagick-devel.i386
pecl install imagick

At the end of the installation, create an inclusion file for imagick.so module and restart apache:

echo "extension=imagick.so" > /etc/php.d/imagick.ini
/etc/init.d/httpd restart

Test the correct loading of the imagick module with:

php -m | grep imagick

MySQL error 1153 in max_allowed_packet

Today I've got an anomalous error during a database import on mysql:

ERROR 1153 (08S01) at line 3854: Got a packet bigger than 'max_allowed_packet' bytes

To solve this is sufficient to edit the mysql configuration file (/etc/my.cnf on Linux) and fill a suitable big value for max_allowed_packet parameter. In my case I've set 100M. Restart mysqld daemon and now the import will gone fine!

Script to remove .svn directories from a project

When you want to distribute your own sources without any .svn directories is sufficient to create an export of the project with this command:

$ svn export svn://path_to_repository projectname

But often I've not access to the repository, so I remove any .svn directory by hand.

For a couple of directories is not a problem but today I've a big project with hundreds of directory, so I realized a little script to help me:

$ find . -type d -name .svn -exec rm -r '{}' \;

Codesourcery G++ for ColdFire on OpenSuse 10.3 and some problems during IDE installation

In these days at working we are evaluating the buying of cross-compiler IDE of ColdFire by CodeSourcery G++. The development environment is substantially Eclipse optimized for that cross-compiler. During installation of the package we have discovered a lot of problems running the IDE installation and the next license installation.

From the official site must download the *.bin package that contains all the necessary, but after run, we have always obtained this error:

eclipse.bin: xcb_xlib.c:52: xcb_xlib_unlock: Assertion `c->xlib.lock’ failed

To solve this issue is sufficient to insert into ~/.bashrc this line:

export LIBXCB_ALLOW_SLOPPY_LOCK=1

and reload the file:

# source ~/.bashrc

Well, proceed with installation and complete it. At the end a wizard license will be prompt but it was never appear to us, may be because of some problem about the MAC address of our virtual machine (we work under vmware). So, we have prepared a new computer with native linux, put it out of the net (probably the license evaluation file it will be downloaded directly from internet during installation), waiting the wizard appear, download the license from codesourcery site by hand and import it to the wizard itself.

Only after all these fix and tries we were finally able to work with the new development environment. Unfortunately, using it we have discovered that sometimes Eclipse crashes with no sense and we have not yet understand why.

Syndicate content