Skip to main content

Posts

PHP Tips : converting legacy content into UTF-8

Today, we have encoding problems with legacy apps written in PHP. After some discussions and some googlings, I found this interesting post :
http://www.sitepoint.com/blogs/2008/09/10/issues-with-cultural-integration/
You can read in it : Latin1 on the inside, utf-8 on the outsideEmbed utf-8 within latin1I copied-pasted just a few lines of code :
// declare that the output will be in utf-8 header("Content-Type: text/html; charset=utf-8"); // open an output buffer, capturing all output ob_start('output_handler'); // when the script ends, the buffer is piped through this functions, encoding it from latin1 to utf-8 function output_handler($buffer) { return utf8_encode($buffer); }
Excellent!

A script I found to install Flash on Ubuntu 9.10 64bits

#!/bin/bash # Script created by # Romeo-Adrian Cioaba romeo.cioaba@spotonearth.com # Super minor updates by jason.melton[at]gmail[dot]com # Updates by Alejandro Cuervo 3[at]cuervo[dot]net # more very minor updates by damien[at]groovey[dot]com # Released under GPL
echo "Closing Firefox" sudo killall -9 firefox
echo "Downloading and instaling Getlibs for required libraries" wget http://www.boundlesssupremacy.com/Cappy/getlibs/getlibs-all.deb sudo dpkg -i getlibs-all.deb
echo "Removing previous installs of flash:" sudo apt-get remove -y --purge flashplugin-nonfree gnash gnash-common mozilla-plugin-gnash swfdec-mozilla libflashsupport nspluginwrapper sudo rm -f /usr/lib/mozilla/plugins/*flash* sudo rm -f ~/.mozilla/plugins/*flash* sudo rm -f /usr/lib/firefox/plugins/*flash* sudo rm -f /usr/lib/firefox-addons/plugins/*flash* sudo rm -rfd /usr/lib/nspluginwrapper
echo "Installing ia32-libs and nspluginwrapper" sudo apt-get install ia32-libs nspluginwrapper
echo "Get…

I realized I was a "ScrumButt" Master

I've just finished the two days long training session to be a Scrum Master. These two days were lead by Jeff Sutherland (in collaboration with Xebia France) . Of course, don't imagine that you will be great a Scrum Master at the end of the session. As Jeff said, were you a good driver just after obtaining youri driving license?

In this post, I will try to summarize notes I took during the course. It's not exhaustive but it wil give you a global idea of what is Scrum and what should do a Scrum Master.

But, before starting, let's return to the title of this post : "I realized I was a ScrumButt Master". Humm... what's that? Jeff said something very interesting . He asked people about who had already tried Scrum. Many ones in the assistance raised their hand. So, why were they here? ... Ok, let's do another test : can you give me the average velocity of your team? Only two answers iin allt the room. And that's why I was here. As many people, I tried Scr…

Use exotic Maven repositories with your local mirror

This is a little tip you must know if you have an "in-house" maven repository mirros (such as Artifactory) and if you want to access to an exotic one.

What's an exotic repository? My definition of that is a repository hosted by a developer isolated somewhere on the web. Of course, it's not a mirror of the official one. By the way, you should not declare it on you "in-house" mirror but simply write the following lines in your pom.xml :

<repositories>
<repository>
<id>violet.repo</id>
<name>Violet's Maven repository (public access)</name>
<url>http://violet.sourceforge.net/maven2/repo/</url>
</repository>
</repositories>



Now, imagine you try to retrieve an artefact. Muupp... error! You miss to declare an exclusion in your settings.xml to inform Maven that it should not use your local mirror to get it. Thus, this is an example of what to do :

<mirrors>
<mirror>

Speed Up your FireFox on Linux

You can't imagine how Firefox loves to write temporary files. I realized it on my Acer Aspire One with its ugly 8GB SSD. An excellent tip I read on the web consists in mounting a directory in memory and configuring FF to use it.

Let's go :

sudo gedit /etc/fstab

Add the following line :

tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0

In Firefox, open this internal URL :

about:config

Right click to add a new string entry :

browser.cache.disk.parent_directory

Set its value to

/tmp

Reboot your machine and appreciate...

Of course, this tip is certainly portable on Microsoft Windows with softwares like RamDrive even if I presented it on Linux.

Installing an Apache Tomcat cluster

I'm currently reviewing some scripts to install a Tomcat cluster. A nice way to do that is to have a common Tomcat installation and the minimum needed for each node. There's a an excellent introduction on the subject by Filip Kanik :

http://www.springsource.com/webinar/large-scale-tomcat-deployments

Then, you will find here an example of the run.sh file introduced by Filip :

http://sirinsevinc.wordpress.com/2009/07/20/deploying-multiple-tomcat-instances/

Where is my Tomcat Adapter for WTP in Eclipse 3.5 (Galileo) ?

I downloaded Galileo a few days ago. But, when I tried to test my webapp on my favourite Tomcat, I discovered that it missed the corresponding adapter. Wooo... After some searches (thanks to Google), I found the easiest way to install it and (by the way) all the other adapters. From the WTP update site (http://download.eclipse.org/webtools/updates/), select and install JST Server Adapters.

That's all!

Move a project from an SVN repository to another one

Today, I need to move a project from a first subversion repository to a second one. To do that, you need to have an access to your SVN server.

So, we will use the following commands :
svnadmin dump to backup the repositories (I insist on 'repositories'. I think it's important to have backups of all repos before doing such operations)svndumpfilter to reduce the backup scope to a single project because the dump can only be done on the entire SVN repositorysvnadmin load (I think you can guess what this wonderful command does)To understand this commands, it's important to know that svnadmin uses standard inputs and outputs. Thus, we can combine commands with pipes.


Let's save our project (with all its history, tags, branches...)

svnadmin dump /home/subversion/svn/repo/ | svndumpfilter include myproject > svn.myproject.dump

Now, let's backup our target repository :

svnadmin dump /home/subversion/svn/new_repo/ > svn.new_repo.dump

And let's import the project on th…

Modify your host networking interface with Virtual Box OSE 2.0.4

In the previous post, I talked about how to start a Windows XP image downloaded from Microsoft to be able to test your web application with Internet Explorer.

On Ubuntu 8.04 and Virtual Box OSE (Open Source Edition) 2.0.4, there are some fixes to do before being able to work with the hosted mode network interface.

I took the following instructions from the french Ubuntu forum (http://forum.ubuntu-fr.org/viewtopic.php?id=217680).

1) install bridge-utils and uml-utilities (sudo apt-get)
2) add the vboxusers usergroup to your user :

$ sudo usermod -a -G vboxusers

3) Create a bridge by modifying you /etc/network/interfaces file

For DHCP conf

$ sudo gedit /etc/network/interfaces
auto eth0
iface eth0 inet manual

auto breth0
iface breth0 inet dhcp
bridge_ports eth0

# The loopback network interface
auto lo
iface lo inet loopback

For static IP conf

$ sudo gedit /etc/network/interfaces
auto eth0
iface eth0 inet manual

auto breth0
iface breth0 inet static
bridge_ports eth0
address 192.168.0.2
netmask 255.25…

Internet Explorer free under Ubuntu Linux with VirtualBox

This is a title I found on a blog (http://www.railsgeek.com/). You all know this kind of crisis when delivering a web application developed on your favourite Linux with FireFox : your piece of software crashes on Internet Explorer. You also know how it's difficult to have a IE quickly running on your Ubuntu. Perhaps you tested IE4Linux but it's an old projet. Thanks to Microsoft (yes, I can say this), you have a solution from now.

1) Go to the Microsoft download website : http://www.microsoft.com/downloads
2) Enter 'vpc images' in the search text field
3) You will have an answer titled :

IE App Compat VHD
VPC Hard Disk Images for testing websites with different Internet Explorer versions on Windows XP and Windows Vista

4) Click on the link and download an image (I took IE7-XPSP3.exe)
5) Rename it with the rar extension (ie IE7-XPSP3.rar) and unrar it
6) Install VirtualBox with Synaptic. This excellent software is able to read Microsoft Virtual PC image disk (VHD)
7) The first …

Zenika Wicket Contest / Concours Wicket Zenika

It's exceptional but I wrote this post in french. It's about a contest which proposed to developed a tiny Apache Wicket project with another framework. I tried to implement it with SmartGWT.

Bon et bien voilà : je livre mon appli ZenContact migrée en GWT. Je vous préviens, je ne vais pas trop mâcher mes mots. L'objectif du concours est assez clair : refaire une petite appli de gestion de contacts réalisée à l'occasion d'une présentation Wicket au Paris JUG; le tout avec un petit défi en plus car cette présentation menée par Zenika n'a duré qu'une heure.

Bref, devant l'enthousiasme général, j'ai entrepris de la refaire en GWT. Et comme il fallait aller vite, j'ai choisi de m'appuyer sur des outils et API pour avoir le moins à coder possible. Je fixe rapidement la stack de travail : Eclipse 3.4, Maven 2, SmartGWT. Bon, c'est parti! New maven project -> template gwt. Je teste l'application générée par le plugin Maven. Jusque là tout es…

Why can I access to port 8080 only from localhost on Ubuntu?

To achieve the previous post, I had some problems today to access to my tomcat server from another machine. Ping OK but telnet 8080 KO... Humm, this smells firewall rules. Bingo! I didn't considered iptables as a firewall but it's one!

So, if you are in a secure network area, you can disable it temporarily with the following command :
sudo iptables -FYou can go further by reading this how-to page : https://help.ubuntu.com/community/IptablesHowTo