1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | #!/bin/bash # samu 2010-02-23 STATIC_DEST="/var/www/awstats/static" cat > "$STATIC_DEST/index.html" << EOF <html><head><title>AWSTATS - Static</title></head><body> <h1>AWSTATS - Static Statistics</h1> <ul> EOF for conf in $( ls /etc/awstats/ | grep "^awstats\..*\.conf\$" | sed "s/^awstats\.\(.*\).conf\$/\1/" ); do echo "Generating static pages for $conf ..." if [ ! -e "${STATIC_DEST}/${conf}" ]; then mkdir -p "${STATIC_DEST}/${conf}" fi |
I just wanted something like the "share on facebook" button, but to post links on my (this) blog. I thought I would have to write a module to do that but.. no, Drupal itself allows us to do that directly :)
First of all, I created a CCK content named "bookmark". Here is the exported CCK code.
Download Bookmark CCK here
Yep, I copied this from the facebook "SHARE IT" button.. :)
New theme for the under-development http://natouren.eu!

Many times we download a song we like from YouTube, or other sites, as a FLV video. But how to convert it to a regulare audio-only MP3 file? Here is a nice solution I found on the net, using FFMPEG.
The syntax of the command is:
ffmpeg [[infile options][-i infile]]... {[outfile options] outfile}
So, to convert a flv video to mp3, we could use something like:
I'm proud to announce that the Drupal administration module for PowerDNS I was writing is now available on Drupal.org at the address http://drupal.org/project/poweradmin.
Here is an useful script to register APT keys, to avoid the "There are no public key available for the following key IDs" warning message.
1 2 3 4 5 6 7 8 9 10 11 12 |
#!/bin/bash # samu 2010-01-01 # (c) 2010 Samuele ~redShadow~ Santi # redshadow&hackzine.org - http://www.hackzine.org # Under Gnu GPL v3 KEYID="$1" echo "Registering APT key $1..." gpg --keyserver wwwkeys.eu.pgp.net --recv-keys "$KEYID" gpg –export –armor "$KEYID" | apt-key add - |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | #!/bin/bash # (c)2009 Samuele ~redShadow~ Santi <redshadowAThackzineDOTorg> # Under GPL v3 # Please visit: http://www.hackzine.org # Download from: http://svn.hackzine.org/misc/scripts/drupal/drupal-module-from-svn.sh # samu 2009-12-30 MODNAME="$1" SVNREPO="$2" if [ "$MODNAME" == "" ] || [ "$SVNREPO" == "" ]; then echo "Usage: $0 <modname> <svnrepo>" exit 1 fi CDATE="$( date +%s )" ORIGPWD="$( pwd )" TEMPDIR="/tmp/.drupal-module-${MODNAME}-${CDATE}" mkdir -p "$TEMPDIR" cd "$TEMPDIR" echo "Exporting $SVNREPO -> $MODNAME" svn export "$SVNREPO" "./$MODNAME" |
fdisk /dev/sdx cryptsetup -y --cipher aes-cbc-essiv:sha256 --key-size 256 luksFormat /dev/sdx1 cryptsetup luksOpen /dev/sdx1 crypt_sdx1 mkfs.ext3 -m 0 -j -O dir_index,filetype,sparse_super /dev/mapper/crypt_sdx1 tune2fs -m 0 -c 0 -i 0 -L label /dev/mapper/crypt_sdx1 mount /dev/mapper/crypt_sdx1 /mnt/crypt_sdx1 umount /dev/mapper/crypt_sdx1 cryptsetup luksClose crypt_sdx1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | #!/bin/bash # # Drupal sites cronjob runner. Useful to be put into crontab. # samu 2009-12-06 # ## --- Configuration --- CONF_SITES="/usr/local/etc/drupal-sites" # sites list CONF_LOGDIR="/var/log/drupal-cron" # logs dir ## --- End Config --- # load sites list, stripping lines that are empty or starting by # SITES="$(cat "$CONF_SITES" |grep -ve "^$\|^[^A-Za-z0-9]*#")" # create log directory if not exists if [ ! |