08/07/2011 Written by Cyril GRANDJEAN

Here is a small tutorial for all who want to install Apache Tomcat on a QNAP.

First of all, download Java and Apache Tomcat and upload on your NAS.

Below are the paths to install Java and Apache Tomcat that I used :

  • Java : /share/Qweb/java6
  • Tomcat : /share/Qweb/tomcat6

Then, I have created the file tomcat.sh on the root of tomcat6.

#!/bin/sh
#Tomcat self-starting
#Auteur : Cyril GRANDJEAN
#Description : Self-starting de tomcat
#name of the process : tomcat
#pid of  : /var/run/tomcat.pid
RETVAL=0
QPKG_NAME="tomcat6"
_exit()
{
   /bin/echo -e "Error: $*"
   /bin/echo
   exit 1
}

JRE_HOME="/share/Qweb/java6"
CATALINA_HOME="/share/Qweb/tomcat6"

case $1 in
  start)
    sh /share/Qweb/tomcat6/bin/startup.sh
    ;;
  stop)
    sh /share/Qweb/tomcat6/bin/shutdown.sh
    ;;
  restart)
    sh /share/Qweb/tomcat6/bin/shutdown.sh
    sh /share/Qweb/tomcat6/bin/startup.sh
    ;;
  *)
    echo "Usage: $0 {start|stop|restart}"
    exit 1
esac
exit $RETVAL

Then, to use it as a package on the interface of the QNAP, I have used the following commands :

echo "[tomcat6]" >> /etc/config/qpkg.conf
echo "Name = Tomcat6" >> /etc/config/qpkg.conf
echo "Version = 6.0" >> /etc/config/qpkg.conf
echo "Enable = TRUE" >> /etc/config/qpkg.conf
echo "Shell = /share/Qweb/tomcat6/tomcat.sh" >> /etc/config/qpkg.conf

You can now use Apache Tomcat on your QNAP.

23/03/2011 Written by Cyril GRANDJEAN

During my internship at Distrame from July 2010 to September 2011, I have participated to the creation of the solution Efficacenergie. This solution, directly installed on the intranet network of the customer, allows the measure of energy consumption of a building such as water consumption, gas, electricity or the measure of temperature, … Efficacenergie is compatible with the wireless sensors of the brands LEM and Coronis.

The solution is installed on a NAS working on a linux operating system. Our NAS server is going to play collector’s role of data resulting from wireless sensors. Thanks to the application server Apache Tomcat and a mySQL database, the customer can visualize his consumptions with an ergonomic Web interface developed from the javascript framework Ext-JS. You can find on my portfolio a list of available features with Efficacenergie.

Here is a small video of presentation of the solution (French video) :

29/06/2010 Written by Cyril GRANDJEAN

Agora Immobilier has just changed design followed by the addition of new features such as the geo-localization of the possessions to be rented on Google Maps.

19/03/2010 Written by Cyril GRANDJEAN

As you can notice, my website has a new design to bring more sobriety and professionalisme.

I was able to count on Antoine Lenoir’s support for the creation of the new graphics standards (www.studio-khaz.com).

01/03/2010 Written by Cyril GRANDJEAN

I inform you about the release of a new version of Redim Picture, my software to resize image.

What’s new :

  • Management of the main formats of image (JPEG, PNG, GIF, BMP)
  • New management of the proportions
  • Possibility of changing formats of favorites images
  • Addition which allows the user to save dimensions defined by images
  • Choice of the path where to save the image

The ancient version of Redim Picture was developed in VB.NET and suffered numerous bugs (Be indulgent, it was my first program 🙂 ). This new version, developed there in C#, is a beta version. Thus, if you notice bugs or if you wish to announce me a possibility of improvement of the software, do not hesitate to contact me.

Description of the program :

  • Name : Redim Picture
  • Description : Software to resize images (see novelties)
  • System compatibles : Windows xp, vista, seven. (Require the .NET Framework 3.5, to download it, click here).
  • Download : link
19/09/2009 Written by Cyril GRANDJEAN

RPS1 de chez OVH

After having tested the RPS1 from OVH and after having globally been satisfied by the possibilities offered by this low-cost server from OVH, I decided to continue the adventure by launching me in the hosting of the websites that I have created.

I could use my knowledge about hosting during this migration and I could also ask advices of my colleagues from Planet Bourgogne who manage of the hosting of websites in case of problems.

I remind that the RPS is endowed with a processor Atom 1,6 Ghz, 512 Mo of RAM, 20 Gb of accessible storage with a SAN from OVH and a connection of 100 Mbps. The operating system is a Gentoo Release 2 which is a Gentoo modified for needs from OVH.

I could write some articles for all those who wish as me to dash into the adventure of the hosting.

New : This website is now on the RPS server.

13/09/2009 Written by Cyril GRANDJEAN

Synology DS 109

Here is my last acquisition for my home server.

This NAS is not a simple storage system. This is a complete server, customisable, energy-efficient who allows natively to reach very easily its files in FTP and HTTP in local area network or on internet. He can also host websites, share files, photos and videos with a beautiful AJAX interface. To see the features integrated natively, click here.

To be able to add other features, the forum www.nas-forum.com can help you.

01/09/2009 Written by Cyril GRANDJEAN

During my work for the company Planet Bourgogne, I had to create an XLS file using PHP and MySQL. I’ve also discovered a PHP library for reading and writing XLSX files.

The format XLSX is supported by Excel 2007 and later. For the previous versions, it requires the installation of the following module : http://www.microsoft.com/downloads/details.aspx?displaylang=fr&FamilyID=941b3470-3ae9-4aee-8f43-c6bb74cd1466.

Here are some lines of codes which are going to allow you to create your first file XLS by using PHP.

  1. Download and copy the library PHPExcel in your PHP Project
  2. Create a PHP file by using the following syntax :
/** Errors report */
error_reporting(E_ALL);

/** Include path **/
set_include_path(get_include_path() . PATH_SEPARATOR . 'PHPExcel/Classes/');

/** PHPExcel */
include 'PHPExcel.php';

/** PHPExcel_Writer_Excel2007 */
include 'PHPExcel/Writer/Excel2007.php';

// Create new PHPExcel object
$objPHPExcel = new PHPExcel();

//We add contents
//Warning, a utf8_encode() is necessary for the character like 'é', 'è', ..
$objPHPExcel->getActiveSheet()->setCellValue('A1', 'Ligne 1 Colonne 1');
$objPHPExcel->getActiveSheet()->setCellValue('A2', utf8_encode('Durée'));

//Manage the size of the column
$objPHPExcel->getActiveSheet()->getColumnDimension('A')->setWidth(15);

//Manage font style
$objPHPExcel->getActiveSheet()->getStyle('A1')->getFont()->setSize(10);
$objPHPExcel->getActiveSheet()->getStyle('A1')->getFont()->setBold(true);
$objPHPExcel->getActiveSheet()->getStyle('A1')->getFont()->setUnderline(PHPExcel_Style_Font::UNDERLINE_SINGLE);
$objPHPExcel->getActiveSheet()->getStyle('A1')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);

//Make a border style
$objPHPExcel->getActiveSheet()->getStyle('A1')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
$objPHPExcel->getActiveSheet()->getStyle('A1')->getBorders()->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
$objPHPExcel->getActiveSheet()->getStyle('A1')->getBorders()->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
$objPHPExcel->getActiveSheet()->getStyle('A1')->getBorders()->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);

// Save our file xlsx
$objWriter = new PHPExcel_Writer_Excel2007($objPHPExcel);
$objWriter->save('../data_xls/myfileXLS.xlsx');

This tutorial is only the bases necessary for the creation of a simple file XLSLX. For advanced used : click here.