Apache Maven Cargo deploy with Tomcat 7

Following the post about Deploy to Tomcat 6 using #Maven, here is a ready to use example with the main differences explained in the table below

 Tomcat 7Tomcat 6
containerId<containerId>tomcat7x</containerId><containerId>tomcat6x</containerId>
Url of Tomcat manager<cargo.remote.uri><cargo.tomcat.manager.url>
examplehttp://host..com/manager/text/http://host..com/manager/
tomcat-users.xml

<tomcat-users>
<role rolename=”manager-gui”/>
<role rolename=”manager-script”/>
<role rolename=”manager-jmx”/>
<role rolename=”manager-status”/>
<user username=”admin” password=”admin” roles=”manager-gui,manager-script”/>
</tomcat-users>

<tomcat-users>
  <role rolename=”manager”/>
  <user username=”admin” password=”admin” roles=”manager”/>
</tomcat-users>

And finally a snippet of an Apache #Maven pom.xml ready to use in a profile, so you can reuse this profile like a method call

<profile>
    <id>deployTomcat</id>
    <activation>
        <activeByDefault>false</activeByDefault>
    </activation>
    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.cargo</groupId>
                <artifactId>cargo-maven2-plugin</artifactId>
                <version>1.1.0</version>
                <configuration>
                    <wait>true</wait>
                    <container>
                        <containerId>tomcat7x</containerId>
                        <type>remote</type>
                    </container>
                    <configuration>
                        <type>runtime</type>
                        <properties>
                            <cargo.remote.uri>${tomcat.url}</cargo.remote.uri>
                            <cargo.remote.username>${tomcat.user}</cargo.remote.username>
                            <cargo.remote.password>${tomcat.pwd}</cargo.remote.password>
                        </properties>
                    </configuration>
                    <deployer>
                        <type>remote</type>
                        <deployables>
                            <deployable>
                                <groupId>${deploy.groupid}</groupId>
                                <artifactId>${deploy.artifactid}</artifactId>
                                <type>war</type>
                                <properties>
                                    <context>${deploy.context}</context>
                                </properties>
                            </deployable>
                        </deployables>
                    </deployer>
                </configuration>
                <executions>
                    <execution>
                        <id>verify-deploy</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>deployer-undeploy</goal>
                            <goal>deployer-deploy</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</profile>

Place as many profiles as you have machine to deploy in settings.xml and declare some variables as properties, as shown below:

<profile>
    <id>serverA</id>
    <activation>
        <activeByDefault>false</activeByDefault>
    </activation>
    <properties>
        <tomcat.url>http://host.com/manager/text</tomcat.url>
        <tomcat.user>admin</tomcat.user>
        <tomcat.pwd>admin
        </tomcat.pwd> 
        <!-- these properties must be defined as system property or -D --> 
        <!-- - deployable.artifactid: artifactId of web application to be deployed --> 
        <!-- - deployable.context: web context name -->
    </properties>
</profile>

So you can run, and target multiple host by just exchanging the name of the profile serverA to something else.

mvn integration-test –PdeployTomcat,serverA –Ddeployable.artifactid=demo -Ddeploy.groupid=com.mycompany –Ddeployable.context=showcase

KDE Ships First 4.7 Beta

kde_4_7

May 25th, 2011. Today, KDE has released a first beta of the upcoming 4.7 release of the Plasma Desktop and Netbook workspaces, the KDE Applications and the KDE Frameworks, which is planned for July 27, 2011. With API, dependency and feature freezes in place, the KDE team’s focus is now on fixing bugs and further polishing new and old functionality.

The 4.7 release will bring a number of exciting improvements:

  • KWin, Plasma’s window manager now supports OpenGL-ES 2.0, improving performance and deployment on mobile devices
  • Dolphin, KDE’s flexible file manager has seen user interface improvements and now sports a better user experience for searching in files’ metadata.
  • KDM, KDE’s login manager now interfaces with the Grub2 boot loader
  • Marble, the virtual globe now supports offline address search, especially making its mobile version more useful on the road

Visit the KDE 4.7 Information page

Nasty Bug in SecurityImages 5.1.2

software_bugs_dilbert

Thanks to Margus Pala, a security Flaw has been reported and corrected in SecurityImages version 5.1.2 and previous

The flaw is of moderate level, in register forms, spammers are able to register without solving the Captcha!

  • It affect only SecurityImages 5.x for #Joomla! 1.5
  • SecurityImages 6.x for #Joomla! 1.6 is not affected

In order to resolve this issue, you don’t have to install any new version of SecurityImages, you must either

  • Update your blog with the right version of the joomla! patches, the all end with #Joomla_1.5.x-Stable-Full_PackageForSecurityImages5.y.z_v01.03.00

OR

  • Edit the file components\com_user\controller.php and remove the line 274 ($this->register())
if ($useSecurityImagesInRegister && !$this->checkSecurityImagesCaptcha()) {   JError::raiseWarning('', JText::_('SECURITYIMAGES REJECT USER ENTRY'));     $this->register();   return false; }

These patches versions have the flaw

04/12/2008  #Joomla_1.5.1-Stable-Full_PackageForSecurityImages5.0.0.zip
05/01/2008  #Joomla_1.5.2-Stable-Full_PackageForSecurityImages5.0.0_v01.00.00.zip
05/01/2008  #Joomla_1.5.3-Stable-Full_PackageForSecurityImages5.0.0_v01.00.00.zip
07/10/2008  #Joomla_1.5.4-Stable-Full_PackageForSecurityImages5.0.0_v01.00.00.zip
08/03/2008  #Joomla_1.5.5-Stable-Full_PackageForSecurityImages5.0.0_v01.00.00.zip
08/03/2008  #Joomla_1.5.6-Stable-Full_PackageForSecurityImages5.0.0_v01.00.00.zip
08/19/2008  #Joomla_1.5.6-Stable-Full_PackageForSecurityImages5.1.0_v01.00.00.zip
09/13/2008  #Joomla_1.5.7-Stable-Full_PackageForSecurityImages5.0.0_v01.00.00.zip
09/20/2008  #Joomla_1.5.7-Stable-Full_PackageForSecurityImages5.1.0_v01.00.00.zip
11/11/2008  #Joomla_1.5.8-Stable-Full_PackageForSecurityImages5.0.0_v01.00.00.zip
01/19/2009  #Joomla_1.5.8-Stable-Full_PackageForSecurityImages5.1.0_v01.01.00.zip
01/19/2009  #Joomla_1.5.9-Stable-Full_PackageForSecurityImages5.1.0_v01.01.00.zip
03/28/2009  #Joomla_1.5.10-Stable-Full_PackageForSecurityImages5.1.0_v01.01.00.zip
06/03/2009  #Joomla_1.5.11-Stable-Full_PackageForSecurityImages5.1.0_v01.01.00.zip
07/04/2009  #Joomla_1.5.12-Stable-Full_PackageForSecurityImages5.1.x_v01.01.00.zip
07/26/2009  #Joomla_1.5.13-Stable-Full_PackageForSecurityImages5.1.x_v01.01.00.zip
07/26/2009  #Joomla_1.5.14-Stable-Full_PackageForSecurityImages5.1.x_v01.01.00.zip
09/11/2009  #Joomla_1.5.14-Stable-Full_PackageForSecurityImages5.1.x_v01.02.00.zip
11/09/2009  #Joomla_1.5.15-Stable-Full_PackageForSecurityImages5.1.x_v01.02.00.zip
04/24/2010  #Joomla_1.5.16-Stable-Full_PackageForSecurityImages5.1.x_v01.02.00.zip
04/24/2010  #Joomla_1.5.17-Stable-Full_PackageForSecurityImages5.1.x_v01.02.00.zip
09/12/2010  #Joomla_1.5.18-Stable-Full_PackageForSecurityImages5.1.x_v01.02.00.zip
04/24/2010  #Joomla_1.5.20-Stable-Full_PackageForSecurityImages5.1.x_v01.02.00.zip
01/09/2011  #Joomla_1.5.21-Stable-Full_PackageForSecurityImages5.1.x_v01.02.00.zip
01/09/2011  #Joomla_1.5.22-Stable-Full_PackageForSecurityImages5.1.x_v01.02.00.zip
01/09/2011  #Joomla_1.5.23-Stable-Full_PackageForSecurityImages5.1.x_v01.02.00.zip

You can download the updated versions in HERE or search the download section, type 1.5.23 for the patches for 1.5.23 for example

Flight Certificate – Certificates for STS-133 – Fly Your Face in Space

NASA wants to put a picture of you on one of two remaining space shuttle missions and launch it into orbit. To launch your face into space and become a part of history, just follow these steps:
First…Select the Participate button at the bottom of this page and upload your image/name, which will be flown aboard the space shuttle. Don’t have a picture to upload? No problem, just skip the image upload and we will fly your name only on your selected mission!
NextPrint and save the confirmation page with your flight information.
LaterReturn to this site after launch to print your Flight Certificate – a commemorative certificate signed by the Mission Commander. You can also check on mission status, view mission photographs, link to various NASA educational resources and follow the commander and crew on Twitter or Facebook.

35th shuttle mission

The 133rd space shuttle flight launched on February 24, 2011. On this 35th shuttle mission to the International Space Station, Discovery will deliver the Express Logistics Carrier 4 and critical spare components to the Station. The pressurized logistics module will be a permanent fixture at the Station for supply storage.
Thanks to 194,181 participants who sent your names and images with us on STS-133. View crew thank you message here.

Certificate

This certifies that the face of Cedric Walter has flown in space aboard the Space Shuttle Discovery on mission STS-133 from February 24 – March 9, 2011. The face was flown on Discovery’s mission to the International Space Station at an altitude of 220 miles above the Earth. It flew at a speed of more than 17,400 miles per hour as it orbited our planet. On behalf of my crew and all of NASA, we thank you for sharing the excitement of our mission and welcome your interest in space exploration. We were glad to have you aboard.

See my certificate at http://faceinspace.waltercedric.com/

Related stuff

Demo site countdown module for Joomla! 1.5/1.6

joomla_cms

 
A very simple plugin that is using a nice flash applet to display a retro clock countdown, you can see it in action at

demositecountdown_for_joomla

How it is working

  • It use the creation time of the file modules/mod_demositecountdown/index.html as reference when the demo site was renewed,
  • the file settings.xml contains the next time when the site will be renewed,

To make the magic work, it also use “Demo site for #Joomla!” the easy to use and configure framework to automatically renew demo Joomla! site.

For people that would like to reuse this technique, here is the bash function I’ve created to update the file settings.xml and index.html

# This create a new file that can be checked  for creation time in a dedicated #Joomla! module function updateJoomlaModule() { base="${packagedestination}/modules/mod_demositecountdown" file="${base}/settings.placeholder.xml"; targetfile="${base}/settings.xml"; if [ -f "$file" ] then   nextRun=`date --date "now +${nextrun}"`   targetYear=`date --date "now +${nextrun}" +%Y`   targetMonth=`date --date "now +${nextrun}" +%m`   targetDay=`date --date "now +${nextrun}" +%e`   targetHour=`date --date "now +${nextrun}" +%k`   targetMinute=`date --date "now +${nextrun}" +%M`    echo "Next update $nextRun Updating file at $file"   sed -i "s/_targetYear/${targetYear}/g" $file   sed -i "s/_targetMonth/${targetMonth}/g" $file   sed -i "s/_targetDay/${targetDay}/g" $file   sed -i "s/_targetHour/${targetHour}/g" $file   sed -i "s/_targetMinute/${targetMinute}/g" $file   echo "Move ${file} to ${targetfile}"   cp ${file} ${targetfile}         echo "" > ${base}/index.html else  echo "Joomla module mod_demositecountdown not detected”;  echo "install from";  echo "http://joomlacode.org/svn/demosite/trunk/RenewJoomlaDemo"; fi }

The latest version of can be downloaded at http://joomlacode.org/svn/demosite/trunk/RenewJoomlaDemo/ (login: anonymous pwd: anonymous)

The 2 modules for Joomla! 1.5 and 1.6 you an download HERE

A Joomla! 1.0 version will follow soon.

How To decompile all classes from a jar

What if you have to decompile a huge jar file (like weblogic.jar) to debug a nasty issue? for a lot of closed source binary the source code is not always available, in this small post I will show you how to automate the de-compilation of java classes with a bit of bash magic.

First you’ll have to get the JAD decompiler if you don’t already have this tool in your development toolbox

wget  www.varaneckas.com/sites/default/files/jad/jad158e.linux.static.zip 
unzip jad158e.linux.static.zip 

Unpack and decompile all class found in the jar file, replace the file weblogic.jar with any other jar file

jar  -xf weblogic.jar && find . -iname "*.class" | xargs /path.to/jad -r 

Delete all files *.class from the current directory recursively

find . -type f -name *.class -exec rm {} \;

And rename all decompile .jad files to .java

find -name *.jad -exec rename 's/\.jad$/\.java/' {} \;

You can now repack the whole directory into a zip that you may deploy in your local #maven repository or attached to weblogic.jar as source code in eclipse. I now just have to wish you good luck and happy debugging sessions!

Nintendo Donkey Kong Game and Watch Multi Screen series

Nintendo_Donkey_Kong_GameAndWatch_01

I am really happy to add these 2 game & watch to my collection of vintage video games, as I was playing with them in 1984

Donkey Kong was developed by Nintendo R&D1 as part of the Game & Watch Multi Screen series, featuring two LCD display screens. Released in 1982, it is a port of the arcade game, where Mario is a carpenter attempting to rescue his girlfriend from an evil donkey.

Like the arcade Donkey Kong, Mario must climb a building while avoiding barrels; The player must trigger a lever on the upper screen, activating a hook, which Mario must then jump and catch. If the player succeeds, a peg will be removed and Mario will return to the starting point, but if the player does not, Mario will fall to the ground and lose a life. Removing all available pegs in this manner will cause Donkey Kong’s platform to collapse, and he will fall to the ground.

Nintendo_Donkey_Kong_GameAndWatch_02 Nintendo_Donkey_Kong_GameAndWatch_03

More info about the game itself can be found at http://www.gameandwatch.com/screen/multiscreen/donkey/index.html

Donkey Kong Jr at Nintendo.com

How to install the latest PHP version for Ubuntu

Ubuntu 10.10 (Maverick) is offering as for today a relative old version PHP 5.3.3, if you want to have a better version, you’ll have to trust an unofficial APT repository. Here is How

Thanks to the NGINX team, you can find nearly the latest version of PHP online at https://launchpad.net/~nginx/+archive/php5

Create a new file php5-ppa.list

vi /etc/apt/sources.list.d/php5-ppa.list

and depending on the version of your ubuntu, you can replace the word maverick with the oldest oneiric, natty, or the latest lucid

deb http://ppa.launchpad.net/nginx/php5/ubuntu maverick main deb-src http://ppa.launchpad.net/nginx/php5/ubuntu maverick main

run an update, to get the latest PHP version

apt-get update 
apt-get dist-upgrade

Alternatively you can still compile PHP on your own..

Michelin Pilot Road 3 Tires

michelin_pilot_road3_tires 

I am changing my Tires this week end with the new Michelin Pilot Road 3.

Michelin has introduced the newest version of “dual-compound” tires. The Pilot Road 3 incorporates a soft compound in the shoulder tread for added traction during turning. The middle of the tire has a harder compound to give added mileage.

This is which tires went through my Honda Hornet till today.

 

From To Brand Price
0 5500 km Bridgestone BT 021
5500 km 11’110 km Bridgestone BT 021
11’110 km 22190 km Pirelli Diablo Corsa 409€
22190 km Michelin Pilot Road 3 170€

 

Continue reading Michelin Pilot Road 3 Tires