Category Archives: en

SVN Server on Debian Etch

SVN now directly in Leopard (Mac OS 10.5). This is such a nice surprise that I decided to come back on the right way of programming.

Having known CVS, and then Tortoise SVN for many years, I was not proud to have no backup at all or version control.

You can find what is SVN on Wikipedia.

I followed this tutorial : http://hikage.developpez.com/linux/tutoriels/subversion/?page=page_2

Now I start with the very well known Debian command:

root@strange:/var# apt-get install subversion
root@strange:/var# mkdir /var/subversion
root@strange:/var# mkdir /var/subversion/depot
svnadmin create /var/subversion/depot/myproject (myproject must be replaced by a real name)
apt-get install install libapache2-svn
a2enmod dav_svn (si nécessaire)

/etc/apache2/mod-available/dav_svn.conf must be tuned:

<Location /svn>
DAV svn
Require valid-user
SVNParentPath /var/subversion/depot/
AuthType Basic
AuthName "Mon dépôt"
AuthUserFile /var/subversion/conf/htpasswd
AuthzSVNAccessFile /var/subversion/conf/access
</Location>

now let’s create the first user:

mkdir /var/subversion/conf
htpasswd -c /var/subversion/conf/htpasswd chris
htpasswd /var/subversion/conf/htpasswd user2

/var/subversion/conf/access :

[groups]
webmasters = chris, user2
[myproject:/]
@webmasters = rw
[oneotherproject:/]
chris= rw
* = r
[oneotherproject:/documentation/utilisateur]
authordoc = rw

And now my repository is available at : http://myurl/svn/myproject/

PS: I had to change the right file access to /var/subversion/depot/

chown -R chris:www-data /var/subversion/depot
chmod -R 770 /var/subversion/depot

Apache2 Mass Virtual Hosting

I’m preparing an IPv6 server to host all my projects. It’s so nice to start with a clean one.

First thing, I’ll use Apache2 with his wonderful Mass Virtual Hosting.
This will allow me to create a new web site named www.newwebsite.com only by creating the following directory : /home/hosts/www.newwebsite.com/

Nice isn’t it ?

I’m following this article: http://httpd.apache.org/docs/2.0/vhosts/mass.html

Here are all the command I used for Mass Hosting on Debian Etch:

root@strange:/etc/apache2/mods-enabled# ln -s ../mods-available/vhost_alias.load
mkdir /home/websites
mkdir /home/websites/www.example.com
mkdir /home/websites/www.example.com/online (for my online files)
mkdir /home/websites/www.example.com/offline (where I keep documents about the website)

Then I just replaced the content of /etc/apache2/sites-enabled/000-default by:

# get the server name from the Host: header
UseCanonicalName Off
# this log format can be split per-virtual-host based on the first field
LogFormat "%V %h %l %u %t \"%r\" %s %b" vcommon
CustomLog /var/log/apache2/access_log vcommon
# include the server name in the filenames used to satisfy requests
VirtualDocumentRoot /home/websites/%0/online
VirtualScriptAlias /home/websites/%0/cgi-bin

Here we are… just have to configure www.example.com’s IP

Next step : SVN Server. I’ll keep a backup of every versions of my projects…

Apple Dock?

Just one word: Wow!

 

http://www.macrumors.com/2008/01/03/apple-creating-imac-like-docking-station/

A patent application submitted in 2006 and published for the first time today has revealed that Apple is working on a docking station for portable computers, the exterior of which closely resembles Apple’s iMac line of desktop computers.

A docking station is disclosed. The docking station includes a display and a housing configured to hold the display in a manner that exposes a viewing surface of the display to view. The housing defines a docking area configured to receive a portable computer; The docking area is at least partly obscured by the display when viewed from the viewing surface side of the display at an angle substantially orthogonal to the viewing surface.

Apple argues that its docking station concept is superior in that it requires less desk space due to its vertical orientation. It is also simpler, as the display is integrated and wireless network technologies will be employed for communication between the dock and the portable.

There has been some speculation around the internet that the patent could be tied to the rumored Apple ultra-portable. While the timing of the publication is interesting, the application itself remains generic in nature, and appears to be applicable to any notebook computer.

Happy new year

For the new year I invited some friends at home (we were 11).

I was sure that 2am would be the end of the night, but at 6am everybody was still noisy and never thinking about living my house ^_^ I was proud to think that, after all, I was not so old… only the next day I understood where the difference is when older…. going to bed at 7:30 = 3 days off !

What surprised me was that nobody drank any alcohol or cigarette (or any prohibed substence). It was not on purpose, I was the first surprised. What a nice news: we can have a wonderful long night without any of these horrible things…

from IPv4 to IPv6

6to4
If you are on an IPv6 network, you can access to an IPv4 address. We just have to use the 2002: prefix.
for exemple 157.54.0.1 can be converted to hexadecimal : 9D36:1. So we can contact it via 2002:9D36:1::

ISATAP (Intra-Site Automatic Tunnel Addressing Protocol)
If you are on an IPv4 network, you can be contacted via an IPv6 address:
[64bits prefix]:0:5EFE: and the 32bits of the IPv4 address
For exemple : FE80::5EFE:192.168.41.30

Teredo
If you cannot use 6to4 because of NAT you may use Teredo.
Teredo Prefix is: 2001:0000::/32.

Airport Express and FrontRow on Leopard

Airport Express

What a shame!

Front Row 2 doesn’t work with Air Tunes! It was so fine with Front Row 1.3… and Leopart (Mac OS 10.5) includes Front Row 2 only.

I found how to downgrade here and in french here.

Here is the solution, just in case:

****************
As you may know FrontRow 2.0 misses on important FrontRow 1.x features. Opening it without stopping the music. That is why we downgrade Frontrow to 1.x :)

First get the Front Row 1.3 Update: http://www.apple.com/support/downloads/frontrow131.html and mount the Image.

Open a Terminal (Applications -> Utilities -> Terminal.app)

Backup your Front Row 2.0

sudo mv /System/Library/CoreServices/Front\ Row.app /System/Library/CoreServices/Front\ Row.app2.0

Once the image mounted you can right click on the package and chose “show package contents”
Then, in “Content” double click on “Archive.pax.gz”. A folder named “Archive” will be added to you download folder.
Then go in Archive > System > Library > Coreservice
Copy (command C) FrontRow. Then go to you local Hard Drive and past it in system > library > coreservice

(I didn’t need a restart for Front Row to work again)

If you want to come back to Front Row 2.0 :

  • sudo mv /System/Library/CoreServices/Front\ Row.app /System/Library/CoreServices/Front\ Row.app1.0
  • sudo mv /System/Library/CoreServices/Front\ Row.app2.0 /System/Library/CoreServices/Front\ Row.app

And back to Front Row 1 again :

  • sudo mv /System/Library/CoreServices/Front\ Row.app /System/Library/CoreServices/Front\ Row.app2.0
  • sudo mv /System/Library/CoreServices/Front\ Row.app1.0 /System/Library/CoreServices/Front\ Row.app

Spamassassin can learn from Exchange

Stop Spam

Our users asked me to improve the antispam system.

We use Exchange 2003 but the antispam/antivirus system is on a linux debian etch. The only way I could think about was to let spamassassin learn.

The command “sa-learn –spam /rep/” can only read mbox formatted emails.
The solution came from imap2mbox .

Very easy to schedule on my Windows server
imap2mbox.exe --config="c:\imap2mbox\spam.cfg" --path="Pubic Folders/" --folder="SPAM/" --server=YourExchangeServer --delete --username="username" --mbox="c:\shared_folder\spam.mbox" --pass=yourpassword

I had to replace "Pubic Folders/" by "Dossiers publics/" because our Exchange is French.
Then we have to put the mails in the public folder SPAM.

On my debian server I just added a crontab entry for the sa-learn.sh I created:


#!/bin/bash
rep_sauv=/home/backup/spam
rep_sauv_dist=/home/backup/winsrv
email=chris@company.com
#
smbserver=//winsrv/shared_folder
smbuser=homer
smbpwd=aabbccddeeff
#
#connexion Samba
mount -t cifs ${smbserver} ${rep_sauv_dist} -o "user=${smbuser},pass=${smbpwd}"
#
if test -f ${rep_sauv_dist}/verif.txt; then
/usr/bin/sa-learn --spam ${rep_sauv_dist}/spam.mbox
rm -f ${rep_sauv_dist}/spam.mbox
texte="spamassassin learning ok"
echo $texte # | mail ${email} -s "Apprentissage SpamAssassin OK"
#
else
#
texte="Error: spamassassin learning error, connexion samba impossible"
echo $texte # | mail ${email} -s "Error Spamassassin learning"
#
fi
#
umount ${rep_sauv_dist}

Reading slowly

Should I tell you this blog will be one of the worst ever made ?

I don’t even know if a main line will be followed, I just guess I’ll talk about the books I’m reading, the IT problems I got and resolve or even worst: my life !

I’ve a strange way of reading, I noticed that even if the universe produced by the author becomes very familiar, even if it becomes a nice place where flying to whenever we want… this place stops existing at the end of the book.

I also noticed that one of my favorite moments in books are the long travels. Strange! I feel lucky to live when it takes less then a day to go wherever we want and I enjoy more than all to read the long stories that couldn’t be so long with a mobile phone and airports everywhere.

My conclusion came when reading Musashi, a japonese roman written by Yoshikawa Eiji:

I have to read several books in the same time! that’s the only way to make this universes slow down. It’s was so sad to read many years of a great life in such few days… My favorite moment to switch books became the long journeys between 2 events.

Trust me, that’s was one of the best choices of my life. But it must not be hard to understand that it’s very nice to keep reading a wonderful book 1 month instead of 1 week… I must be like sex: the longer…