Skip to content

Instantly share code, notes, and snippets.

@wamberg
wamberg / gist:179484
Created September 2, 2009 01:16
SQL script to create tables needed for ejabberd in postgresql
--
-- ejabberd, Copyright (C) 2002-2009 ProcessOne
--
-- This program is free software; you can redistribute it and/or
-- modify it under the terms of the GNU General Public License as
-- published by the Free Software Foundation; either version 2 of the
-- License, or (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
@wamberg
wamberg / bash mv
Created September 9, 2009 20:08
Simple mass rename script
#!/bin/bash
for i in $( find -name "*.php" ); do
mv $i ${i%%.php}.html
done
#!/bin/bash
for i in $( find /chroot/apache/var/www/vhosts -maxdepth 3 -wholename "*/logs/*" | grep -v "17" ); do
filename=$( basename $i )
member_dir=$( dirname $i )
member=$( echo "$member_dir" | awk -F"/" '{ print $7 }' )
echo "Sending $member/logs/$filename"
cat $i | \
gzip -c | \
@wamberg
wamberg / fab_ejabberd.py
Created May 1, 2010 18:47
Python Fabric ejabberd installation script
"""
Automated installation of ejabberd with a postgresql backend inspired by this
article: http://www.planeterlang.org/en/planet/article/How_to_install_ejabberd_2.0.0_with_PostgreSQL_support/
"""
from fabric.api import run, sudo
EJABBERD_VERSION = '2.0.5'
EJABBERD_SOURCE_HOME = '~/dev/xmpp/oss'
POSTGRES_PSQL_PASSWORD = 'user'
@wamberg
wamberg / xorg.conf
Created July 5, 2011 15:11
Dual Monitor (one portrait, one landscape) xorg.conf
# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings: version 270.29 (buildd@roseapple) Fri Feb 25 14:43:24 UTC 2011
Section "ServerLayout"
Identifier "Layout0"
Screen 0 "Screen0" 1680 0
Screen 1 "Screen1" LeftOf "Screen0"
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "Mouse0" "CorePointer"
Option "Xinerama" "1"
GENERAL:
Passport
Boarding pass
eReader
Cell phone
Charger
Wallet
Keys
Glasses
Sunglasses