View mail-cleanup.sh
#!/bin/bash
#
# Simple script for automatically emptying Spam and Trash folders
#
# Ulf Möhring <ulf@moehring.me>
#
echo "[Mail scripts] Emptying users' trash and spam folders..."
for email in $(find /var/mail/vhosts/*/* -regextype sed -regex ".*/\.\(Trash\|Spam\)/\(cur\|new\)/.*" -type f -mtime +30); do
rm -f "${email}"
View mp3join.sh
#!/bin/sh
#
# Joins mp3 files found in current directory into one, using the ffmpeg tool. Simple as can be.
#
# Ulf Möhring <ulf@moehring.me>
#
# Discover and join filenames
files=""
for file in *.mp3
View IPv6 for web hosts How To.md

Prerequisites

General requirements

One or more virtual or dedicated servers with root access, possibly located in the same data center. I'm running two Debian virtual machines (Lenny and Squeeze) but I assume you can adopt the recipe to work on any Linux box An account with tunnelbroker.net or similar service

All network configuration doesn't do any good if your web server software doesn't support IPv6 requests. For nginx this means compiling with the --with-ipv6 option. See my Human script for passenger w/ nginx for my favorite nginx compilation options.

My setup

View Passenger with nginx How To.md

Prerequisites

Ruby environment set up and configured, including passenger gem nginx source downloaded and extracted to /usr/local/src or wherever build-essential, curl and other basic development packages installed

"Solution"

Run passenger installer

passenger-install-nginx-module

View Compile PHP How To.md

Install necessary packages

apt-get install autoconf2.13 libssl-dev libcurl4-gnutls-dev libjpeg62-dev libpng12-dev libmcrypt-dev libmysql++-dev libfreetype6-dev libt1-dev libc-client-dev libbz2-dev mysql-client libevent-dev libxml2-dev

apt-get install autoconf libssl-dev libcurl4-gnutls-dev libjpeg62-dev libpng12-dev libmcrypt-dev libmysql++-dev libfreetype6-dev libt1-dev libc-client-dev libbz2-dev mysql-client libxml2-dev

Configure, compile and install

cd /usr/src/php-5.3.3`
View AirTunes on QNAP NAS How To.md

Prerequisites

  • QNAP NAS
  • Supported USB sound card

"Solution"

  • First of all install Optware via the QPKG menu
  • Connect to your NAS (e.g. ssh admin@192.168.1.1)
  • Install various software packages with ipkg install xxx (mainly avahi, openssl, and various build tools - refer to my package list shown below)
View config.ru
# Sinatra
require './toolbox.rb'
# Sproutcore
require 'sproutcore'
project = SC::Project.load "./sproutcore", :parent => SC.builtin_project
scApp = SC::Rack::Service.new(project, :allow_from_ips => '127.0.0.1')
# Run
run Rack::URLMap.new "/" => Sinatra::Application, "/apps" => scApp
View Passenger start-stop.sh
passenger start -d -e production --pid-file /var/www/sumayaagha.net/tmp/passenger.pid --socket /var/www/sumayaagha.net/tmp/passenger.sock --nginx-version 1.0.5
passenger stop --pid-file /var/www/sumayaagha.net/tmp/passenger.pid
View gist:6218422
#!/bin/bash
### BEGIN INIT INFO
# Provides: tuvocabulario.com
# Required-Start: $all
# Required-Stop: $network $local_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start the APPLICATION unicorns at boot
# Description: Enable tuvocabulario.com at boot time.
View gist:6218405
#!/bin/bash
#
# Auth: Ryan Bowlby
# Desc: Verify DynDNS address is listed in iptables. Logs to
# /var/log/secure on most Linux systems. Check syslog.conf
# to see where authpriv.notice is logged.
#
# FYI: Before first use add dummy rule to iptables ruleset (save it).
# ( i.e. /sbin/iptables -I INPUT 2 -s 127.0.0.1 -j ACCEPT )