26 Jun 2008 Matteo Mattei embedded linux opensuse
In these days at work we are evaluating to buy a cross-compiler IDE of ColdFire developed 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 this line into ~/.bashrc:
and reload the file:
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.
25 Jun 2008 Matteo Mattei linux grub opensuse
Today I tested the new OpenSuse 10.3 with KDE both in CD and DVD version on an old Packard Bell Desk Pro. After a long wait during installation, at automatic reboot it will be prompt a classic black screen with the message “Operative System not present”. After a vanished search on the net looking for some informations, I thought that the installer was failed to install the bootloader and so I have just tried to do it manually. Here there are all the steps I follow:
- Boot OpenSuse installation CD/DVD and enter in Recovery mode
- Run grub ed enter in its own shell
- From here run these commands:
grub> root (hd0,1)
grub> setup (hd0)
- hd0,1 => sda2
- hd0 => sda </li>
Restart the system and magically the installation will go on.
15 May 2008 Matteo Mattei linux php centos
Virtual server like Aruba virtual servers are configured with Centos without yum and without php-pear. Today I have done an assistance to a server of my customer that needed pear installation. It is quite simple to make all work but I don’t understand why Aruba’s staff have not decided to include yum in their own default configuration server…
Shall we start installing yum:
mkdir /root/matteo && cd /root/matteo
rpm -Uvh gmp-4.1.4-10.el5.i386.rpm
rpm rpm -Uvh readline-5.1-3.el5.i386.rpm
rpm -Uvh python-2.4.3-27.el5.i386.rpm
rpm -Uvh libxml2-2.6.26-18.104.22.168.i386.rpm
rpm -Uvh libxml2-python-2.6.26-22.214.171.124.i386.rpm
rpm -Uvh expat-1.95.8-8.3.el5_4.2.i386.rpm
rpm -Uvh python-elementtree-1.2.6-5.i386.rpm
rpm -Uvh sqlite-3.3.6-5.i386.rpm
rpm -Uvh python-sqlite-1.1.7-1.2.1.i386.rpm
rpm -Uvh elfutils-0.137-3.el5.i386.rpm
rpm -Uvh rpm-python-126.96.36.199-18.el5.i386.rpm
rpm -Uvh m2crypto-0.16-6.el5.6.i386.rpm
rpm -Uvh python-urlgrabber-3.1.0-5.el5.noarch.rpm
rpm -Uvh yum-3.2.22-26.el5.centos.noarch.rpm
yum -y update
Now it’s time to install php-pear:
Ok, in every virtual-host of Plesk (/var/www/vhosts/example.com/conf/httpd.include), there is the directive open_basedir that must be configured in the right way adding the pear path:
php_admin_value open_basedir "/var/www/vhosts/example.com/httpdocs:/tmp:/usr/share/pear:/local/PEAR"
We must also configure pear in /etc/php.ini
At the end you shall restart Apache:
14 May 2008 Matteo Mattei apache linux tricks
If you want to disable file and directory browsing on your Apache web server in order to prohibit that every users can view the content of a directory (if noindex.php/index.html is present) you need to modify the Apache configuration a little or add a new statement in .htaccess file.
I will show you how to do in both cases:
- Apache configuration: httpd.conf/virtual-hosts
Edit your virtualhost adding these rows:
Add in the .htaccess file this row:
In the first case you need to restart apache server.
05 May 2008 Matteo Mattei bash linux tricks
Using kate as similar text editors, temporary files that have been saved present an annoying trailing tilde that I personally consider useless. I am used to be careful when I edit a file, so I don’t need the backups. For this reason I developed this mini script in bash to remove temporary files from a folder.
rm `find $1 | grep "~$"`
I called the above file rmm and I put it in /usr/bin/ folder. To use it, just place in the folder you have files with trailing slashes and execute it:
Or directly passing the folder as the first argument:
This script is trivial and can be obviously improved. If you want to contribute I will be happy to add your improvements.
07 Apr 2008 Matteo Mattei linux multimedia mplayer streaming
I often see beautiful streaming videos in a variety kind of formats and some people that are trying to grab those videos without any concrete result. I want to share with you how to capture those streams and convert them in a more usable AVI format.
Well… the only thing to do is open a shell on Linux and check if you have installed mplayer, then run this simple command
$ mplayer "mms://url" -dumpstream -dumpfile video_out.avi
- mms://url is the URL of the video stream.
- video_out.avi is the output of the recorded video.
This trick is only available for streams play-ables with mplayer. For sites like Youtube or similar that encode video in flash format, you can’t do it.
Disclaimer: Some sites licenses cannot allow to grab any video. So, please read carefully sites licenses before record any streams.