Posts

Showing posts from June, 2009

Week Numbers in google calendar

Image
I've found this website :

http://sites.google.com/site/gcalweeknumbers/googlecalendarweeknumbers

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/backupDatabaseJob.sh
#!/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 --defaults-extra-file=/root…

setup tomcat6 (with native library) with apache2 integration

Image
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 -sApache2 & 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 installationaptitude 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 is "dot space…

DHCP server with ubuntu

first install the correct package :
sudo aptitude install dhcp3-serverthen edit the configuration file :
vim /etc/dhcp3/dhcpd.confddns-update-style none; # option definitions common to all supported networks... option domain-name "domain.tld" option domain-name-servers 80.10.246.3, 80.10.246.1, 80.10.246.129; 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 192.168.2.0 netmask 255.255.255.0 { range 192.168.2.100 192.168.2.200; option routers 192.168.2.254; option broadcast-address 192.168.2.255; }Replace domain.tld by your local doma…