Jan
27
2007
0
Jan
27
2007
0

J.B.O. @ OHO, Oberwart, Austria


…seconds before the gig started

Written by Florian Beer in: moblog
rel-tag , , , , ,

Jan
26
2007
4

Installing php5-cgi on Debian

For a long time I wanted to be able to run both PHP 4 and PHP 5 on the same server. Now I finally managed to come up with a solution that is easy to install and easy to use.

  1. Add the Debian Backports repository to your /etc/apt/sources.listdeb http://www.backports.org/debian/ sarge-backports main contrib non-free(on one line)
  2. Issue a package update: aptitude update
  3. Install PHP 5 as CGI module: aptitude install php5-cgi
  4. Configure Apache by adding the following lines to your main config file. In my case this was /etc/apache2/apache2.confScriptAlias /php5-cgi /usr/lib/cgi-bin/php5
    Action php5-cgi /php5-cgi

  5. Now find the Virtual Host you want to run on PHP 5 and simply put the following line into the <Directory> directive.AddHandler php5-cgi .php
    This overrides the default handler for files ending in .php which would be the normal PHP 4 module. Whit this directive it is now parsed and executed by the PHP 5 CGI binary.
  6. Reload your webserver config with
    /etc/init.d/apache2 reload
Written by Florian Beer in: linux, server
rel-tag , , , ,

Jan
25
2007
2

Periodically delete files per cronjob

Another entry in my virtual “braindump” category, so I don’t have to look it up somewhere else all the time.

If you want to periodically delete files in a specific directory the unix program find comes to the rescue. In my specific case I needed to delete all the movie files from a surveillance camera that where older than 30 days.

This is the crontab entry to accomplish that:
0 0 * * * /usr/bin/find /videos/ -type f -name '*.avi' -mtime +30 -exec rm {} \;
(everything in one line)

The code runs the program /usr/bin/find every day at midnight (0 0 * * *). It checks the directory called /videos for everything that is a file (-type f), has a name that ends in .avi (-name ‘*.avi’) and is created 30 days ago or before that (-mtime +30).
The command then executes rm (remove) on all those files (-exec rm {} \;).

Written by Florian Beer in: linux, server
rel-tag , , , , , , , , ,

Jan
24
2007
11

Stop Apple Mail from syncing Exchange Public Folders via IMAP

Since I sometimes had very poor Internet connections over the last few month I thought about how I could lower the data transfer volume on my Mac. One of the things that already bothered me since ages is that Exchange accounts in Apple Mail always sync the Public Folders. I never want to read those items and they are really useless.

After a bit of searching around I found two solutions that worked for me. One is only applicable if you are a Domain Administrator on the Exchange server, the other one is not so elegant but also works if you just have a mail account.

As Domain Administrator

  1. Log into the Exchange server and open the “Active Directory Users and Computers” management console.
  2. Find your acoount, click on “Properties” and select the “Exchange Features” tab
  3. Select “IMAP4″ and click on “Properties”
  4. Disable “Use protocol defaults” and uncheck “Include all public folders when a folder list is requested”

Now give the Exchange some time to get the changes. After a while the Public Folders shouldn’t be displayed any more and when syncing this IMAP account they are left out as well.

On your local account

  1. Quit Mail
  2. Go to ~/Library/Mail/ (that’s the Library folder in your home directory) and find the folder that holds all the folders & messages for the Exchange account.
  3. Delete all the contents of “Public Folders” (always back-up first, before you delete ;) )
  4. Select “Public Folders” and press CMD+I to get the Info. (or CTRL+click on it and select “Get Info”)
  5. Now under “Ownership & Permissions” set the folder to “No Access”
  6. Start Mail and observe the beauty of an Exchange IMAP account that doesn’t do useless Public Folders syncing!
Written by Florian Beer in: mac, server
rel-tag , , , , ,

Jan
24
2007
2

Replace Lilo with Grub

I updated the kernel image via aptitude on one of my Debian Sarge servers but after a reboot it didn’t come up again. My first thought was that maybe there was something wrong with the boot loader and since I already wanted to switch from Lilo to Grub I took the opportunity and did just that.

Luckily the changeover is very easy, just follow those steps:

  1. aptitude install grub
  2. grub-install /dev/hda (Replace /dev/hda with the disk you want to install your bootloader on)
  3. update-grub to create the file menu.lst which holds all the information for booting with Grub
  4. Now we have to remove Lilo: aptitude purge lilo

That’s all folks! :)

If you want to automatically update the menu.lst whenever you install a new kernel, add the following to /etc/kernel-img.conf:
do_bootloader = no
do_initrd = Yes
postinst_hook = /sbin/update-grub
postrm_hook = /sbin/update-grub

…and now, reboot!

Written by Florian Beer in: linux, server
rel-tag