6 · 01

How to auto-update Chromium on Mac OS X, Linux and other

I want to try to use Chromium as my first web browser. But for the moment, Chromium suffers from a lack of package maintaining though it targets developers. On my Gentoo Linux, I let portage to handle my Chromium version. But I also use Mac OS X at work, so I have written a little shell script to auto update my Chromium.app. Put the content of this scripts wherever you want and make it executable ($> chmod 755 chromium_update.sh).
#!/bin/sh
# Chromium update script
# - by shad <shad@zaphod.eu>
# mac | linux | ...
OS=mac
LATEST=$(wget -q -O - http://build.chromium.org/buildbot/snapshots/chromium-rel-${OS}/LATEST)
INSTALL_DIR=/Applications
TMP="/tmp/update-chrome-$RANDOM"
(
mkdir $TMP ; cd $TMP
echo Download...
wget -q -O chrome.zip http://build.chromium.org/buildbot/snapshots/chromium-rel-${OS}/${LATEST}/chrome-${OS}.zip
if [ $? -ne 0 ] ; then
echo Cannot update.
exit 1
fi
echo Unzip...
unzip -qq chrome.zip
echo Copying...
rm -rf "${INSTALL_DIR}/Chromium.app"
mv chrome-$OS/Chromium.app "$INSTALL_DIR"
)
rm -rf $TMP
Then, set a crontab rule to choose the update interval ($> crontab -e). Mine runs every day at 12:00.
# Run Chromium update script every day at 12:00
00 12 * * * /Users/shad/mbin/chromium_update.sh
I hope it will be useful for someone as much as for me.
18 · 01

FreeBSD on the ASUS Eee Box using an USB flash drive

I wanted my personal server to be closer to me. So I invested few days ago in the Asus Eee Box, thinking it is the best configuration for a light server at home.

I moved this blog and all my services from my dedicated server to my new one.

To setup FreeBSD on this kind of machine, you have two ways to do it:


Creating a bootable USB flash drive by using the original ISO image is a bit annoying if you haven't got a FreeBSD station yet. I have been using the fbsd2img.sh script,

I share my USB flash drive image: 7.1-RELEASE-i386-bootonly.img.
To setup the USB flash drive, use "dd" (/dev/XXX is the device of your USB flash drive):

dd if=7.1-RELEASE-i386-bootonly.img of=/dev/XXX bs=1m


Here is the result of the server hosting this blog :)

4 · 02

Windows Vista: BOOTMGR is missing!

I bought an additional hard drive last week to increase my storage capacity and to add a partition to backup data. I decided to move my Windows Vista installation to the second harddrive. Linux and grub are installed on the first one. Vista creates a Boot directory when it setups the MBR. I noticed that Vista does not create this directory when it is installed on the second harddrive, probably because the boot loader is on the first one. So after I restored grub to handle both windows and linux, when I tried to boot Vista, I saw the message "BOOTMGR is missing!". The boot directory cannot be seen on Windows systems, I verified its presence on my Linux system with the Windows partition mounted. I found a little trick to force windows Vista to create boot directory and bootmgr, I configured the bios to disable the first harddrive. Then I repaired the windows Vista installation with the dvd, the repair program created the boot directory and bootmgr program. Finally, I re-enabled the first harddrive. It's important to add a small setting to grub configuration to make Windows believe it is launched from the first harddrive. Grub is able to change the bios harddrives order virtually.
title=Windows Vista
rootnoverify (hd1,0)
map (hd0) (hd1)
map (hd1) (hd0)
chainloader +1
24 · 01

Duplicity: simple, efficient and secure backup solution for Unix

Backuping data is a real problem. Investing 2 RAID 1 harddrives is a little expensive for a workstation. Duplicity is able to do incremental backups with the rsync algorithm. All backuped data are encrypted with gpg. All duplicity options are available on the official website. I wrote a small script for automate backup on my workstation. backup.sh:
#!/bin/sh
ROOT="/root/backup"
DISTANT="ssh://user@zaphod.eu//home/user"
PASSPHRASE="xxxxxxxxxxxx"
KEEP_ARCHIVE="2M" # 2 Months
FILELIST="files.lst"
export PASSPHRASE
duplicity       --include-globbing-filelist "${ROOT}/${FILELIST}" \
--exclude '**' \
--full-if-older-than "${KEEP_ARCHIVE}" / "${DISTANT}"
duplicity remove-older-than ${KEEP_ARCHIVE} ${DISTANT}
Then a small file list specifies what has to be backuped or not.
files.lst:
- /home/shad/p0rn
- /home/shad/tmp
+ /etc
+ /home/shad
According to duplicity documentation, a line beginning with a '+' specify a directory or a file to include and '-' for exclude. Be aware of list order.
It remains to add a cron entry for a weekly schedule:
0 0 * * 1 backup.sh | mail -s "Backup Report" root@zaphod.eu
Now your worksation is secured, you can restore any files to any date within the backup delay.

Pages