Skip to content

Instantly share code, notes, and snippets.

@colby
colby / ee-perms.sh
Created July 7, 2014 23:58
A small bash script to set the required permissions for an ExpressionEngine installation.
#!/usr/bin/env bash
pushd /var/www/html/
# Set default permissions
find . -type d -exec chmod 755 '{}' ';'
find . -type f -exec chmod 644 '{}' ';'
# Set directories permissions
ee_dirs=(
@colby
colby / Time tracking bash function
Last active August 29, 2015 13:57
A simple function for your bashrc to track time into a dotfile.
now() {
$file="$HOME/.now"
if [[ -z $@ ]]; then
today="$(date "+%Y-%m-%d")"
grep --color=never $today $file | cut -d' ' -f2-
else
stamp="$(date "+%Y-%m-%d %H:%M:%S")"
echo $stamp - "$@" >> $file
fi
}
@colby
colby / gist:657791
Created November 1, 2010 07:41
Connects to simpledesktops.com and grabs a random image to assign as your profiles desktop image.
import random
import urllib
import urllib2
import tempfile
import subprocess
from appscript import app, mactypes
import lxml.html as lh
url = "http://simpledesktops.com/browse/"
random_page = str(random.randint(1,20))