Showing posts from June, 2009

Week Numbers in google calendar

I've found this website : that provide a calendar that displays week numbers in you calendar which is very usefull as at work (at least in France) where we refer to week number for planning.

MySQL backup

In this post, I'll setup an automatic backup script that create an sql compressed with bz2 file per database. sudo -s Autologin with MySQL : sudo -s vi /root/.my.cnf [client] user=root password=TheRootPassword protocol=tcp chmod 400 /root/.my.cnf Test : [root@dell1 ~]# mysql Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 870724 to server version: 4.1.22 Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> quit Bye [root@dell1 ~]# Script vi /root/scripts/cron/ #!/bin/bash TIME=`date` echo "Starting MySQL Backup at $TIME" BACKUPLOCATION=/home/backup/databases CURRENTDATE=`date +%Y%m%d` CURRENTLOCATION=$BACKUPLOCATION/MySQL_$CURRENTDATE if [ ! -d $BACKUPLOCATION ] then echo "create directory for database saves $BACKUPLOCATION" mkdir $BACKUPLOCATION fi echo "Databases saves at $CURRENTLOCATION"; mkdir -p $CURRENTLOCATION mysql --def

setup tomcat6 (with native library) with apache2 integration

In this post, I'll setup a apache2 with php5 and tomcat6 integrated with apache2. Since Tomcat 5, you don't need a front http server anymore, but since I want to have php5 and tomcat6 on port 80, I need the tomcat6-apache2 integration with modjk since a lot of operation need the root privilege, switch to root : sudo -s Apache2 & PHP5 installation The following command install php5, php5 command line interface (CLI to use php as shell script) and some common php extension. aptitude install php5 php5-cli apache2 php5-xmlrpc php5-mysql php5-gd php5-imagick php-pear php5-mcrypt a2enmod headers #Activation of Mod headers a2enmod deflate #Activation of Mod deflate Setup the timezone : vi /etc/php5/apache2/php.ini [Date] ; Defines the default timezone used by the date functions date.timezone = Europe/Paris Java installation aptitude install sun-java6-jdk vi /etc/profile Append the following line : export JAVA_HOME=/usr/lib/jvm/java-6-sun reload your .profile : (command to type

DHCP server with ubuntu

first install the correct package : sudo aptitude install dhcp3-server then edit the configuration file : vim /etc/dhcp3/dhcpd.conf ddns-update-style none; # option definitions common to all supported networks... option domain-name " domain.tld " option domain-name-servers,, ; default-lease-time 600; max-lease-time 7200; # If this DHCP server is the official DHCP server for the local # network, the authoritative directive should be uncommented. #authoritative; # Use this to send dhcp log messages to a different log file (you also # have to hack syslog.conf to complete the redirection). log-facility local7; # No service will be given on this subnet, but declaring it helps the # DHCP server to understand the network topology. # eth0 subnet configuration subnet netmask { range; option routers; option broadcast-address; } Replace domain.tld by your