Posts

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 --def...

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 -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 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...

Upgrade from kubuntu 8.10 to 9.04 with raid disk : no block devices found

Image
Well... I could have waited 15 more days to have the stable version of Ubuntu 9.04 available for upgrade... but no... It seems I wasn't aware i've so much time to loose. So I've upgraded my kubuntu 8.10 (64bit) to the 9.04 version. All went smoothly until I reboot where I get this nice message : no block devices found (4 times) Gave up waiting for root device. ALERT! /dev/md3 does not exist. dropping to a shell! Apparently the raid configuration has been dropped during the upgrade. I've filled a bug here : https://bugs.launchpad.net/ubuntu/+bug/358054 I don't know exactly what in my setup causes this, but it seems that it's a bug of the last kernel. Probably my raid setup. My computer is made of : P5N32-E Sli plus motherboard C2D 6250 4GB of RAM 2x 250GB SATA, RAID1 software for linux (sdc, sdd) 2x150GB Raptor SATA Raid0 for windows (fake raid from motherboard) (sda, sdb) To get my system back on line I just need to do this in the busybox shell : mdadm -As exit...

Send mail through gmail smtp server with Exim4 - What to do when gmail account has been disabled

Image
To send mail from a machine using gmail smtp server see this tutorial : http://www.manu-j.com/blog/wordpress-exim4-ubuntu-gmail-smtp/75/ I've just ran into a problem with this config. I've created a gmail account just for this purpose because you need to set the gmail account password in exim4 configuration file on each machine. I didn't want to use my personnal gmail account for obvious reasons. As it's a technical account, I never log into it through http://gmail.com web interface. Which lead to the account beeing disabled by gmail. As a result, all mail that exim4 tryed to send gives this warning message in /var/log/exim4/mainlog : R=send_via_gmail T=gmail_smtp defer (-53): retry time not reached for any host To solve this issue, you need to Login to http://gmail.com with the account you use with exim4. It will ask you to login a second time with a captcha... do so login on all of your machine that use this technique and issue the following command : sudo exim -qff ...

Holidays...

Image
Hi, I'm in holdiays until the end of march, far far away from any computers ;) Thomas.

Gears on linux x64 ...

Image
gmail, google docs and google calendar now offers offline support with google Gears ! Great... but... Gears is not available for x64 linux... I've ask the google support for a release date of an official x64 build... but meanwhile, I've found (yes... google is my friend) this blog : http://nielspeen.com/blog/2009/02/google-gears-64-bit/ that gives a x64 build of gears that actually works ;) Great ! Btw, I can understand that one loves Yahoo! webmail which is great, but Microsoft Live mail... seriously... it's ugly, slow, so poor in functionality... why use it when you have access to an awesome webmail like gmail?? ;) Update : new version of the x64 version is available on niespeen blog ( 0.5.18.0 version (instead of the 0.5.16.0 version proposed by the firefox updater))

Limit the upload bandwidth of your apache webserver with mod_bw

Image
I've a server at home on a ADSL connection which has 100kBytes/s of upload and 1.2MBytes/s of download as bandwidth. If someone download at full speed some large file on my web server, my internet connection become unusable. To avoid this, I start to ask my friends to use a download manager to limit their download speed... but it's somewhat far too tricky for a lot of them... So I use mod_bw developed by Ivan Barrera http://www.ivn.cl/apache/ (sourceforge : http://bwmod.sourceforge.net/ ). Here is a quick way to limit the bandwidth used by Apache : Install & enable (on Ubuntu): sudo apt-get install libapache2-mod-bw sudo a2enmod bw Configure (your apache virtualhost conf file like /etc/apache2/sites-available/default) : <virtualhost *:80> #... other config stuf for the virtual host BandWidthModule On ForceBandWidthModule On BandWidth 192.168.0.0/24 0 BandWidth all 80000 </virtualhost> Explaination : line 1 : Activate the mod for the virtualhost. line 2 : Set a...

How to solve GPG warning about apt/aptitude repository update

Image
When you add a repository in your /etc/apt/sources.list and run a apt-update you'll get the update of the newly added repository but also a warning about a GPG key like the following one : Hit http://ppa.launchpad.net intrepid/main Sources Hit http://fr.archive.ubuntu.com intrepid-proposed/universe Packages Hit http://ppa.launchpad.net intrepid/main Packages Fetched 309B in 0s (519B/s) Reading package lists... Done W: GPG error: http://ppa.launchpad.net intrepid Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY D702BF6B8C6C1EFD W: You may want to run apt-get update to correct these problems Running again apt-update won't solve the issue. This warning can be safely ignored, but I don't like to leave warning when there is a solution to get rid of it... because when something is going wrong, it would complicate to sort out what is safe to be ignored and what tells about a real issue. So, to get rid of this warning her...