View rename_media_to_directory_name.php
<?php
/**
* Media renamer for Obfuscated file names sometimes found when downloading from usenet.
* This script will find scan all directories in $in_path.
* For each directory, it will search for a media file.
* If a media file is found, it will copy that file into the "output path" while also renaming the file to the "basepath" of the containing directory.
*/
$find_extensions = ['mkv','avi'];
$remove_from_filename = ['-Obfuscated','-postbot'];
View keybase.md

Keybase proof

I hereby claim:

  • I am incredimike on github.
  • I am incredimike (https://keybase.io/incredimike) on keybase.
  • I have a public key whose fingerprint is 0C61 4943 5490 2401 09CE E3EA 0035 5C1D F3BB 04CA

To claim this, I am signing this object:

View Chrome Form Filler options
eyJlbmFibGVDb250ZXh0TWVudSI6dHJ1ZSwiaWdub3JlRmllbGRzV2l0aENvbnRlbnQiOmZhbHNlLCJ0cmlnZ2VyQ2xpY2tFdmVudHMiOnRydWUsImlnbm9yZUhpZGRlbkZpZWxkcyI6dHJ1ZSwiaWdub3JlZEZpZWxkcyI6WyJjYXB0Y2hhIiwiaGlwaW5wdXR0ZXh0Il0sImNvbmZpcm1GaWVsZHMiOlsiY29uZmlybSIsInJlZW50ZXIiLCJyZXR5cGUiLCJyZXBlYXQiXSwicGFzc3dvcmRTZXR0aW5ncyI6eyJtb2RlIjoiZGVmaW5lZCIsInBhc3N3b3JkIjoiUGEkJHcwcmQhIn0sImVtYWlsU2V0dGluZ3MiOnsidXNlcm5hbWUiOiJyYW5kb20iLCJ1c2VybmFtZUxpc3QiOlsiamFjayIsInNwYXJyb3ciLCJmcm9kbyIsImJhZ2dpbnMiXSwiaG9zdG5hbWUiOiJsaXN0IiwiaG9zdG5hbWVMaXN0IjpbImhvdG1haWwuY29tIiwiZ21haWwuY29tIiwieWFob28uY29tIl19LCJmaWVsZE1hdGNoU2V0dGluZ3MiOnsibWF0Y2hMYWJlbCI6ZmFsc2UsIm1hdGNoSWQiOmZhbHNlLCJtYXRjaE5hbWUiOnRydWUsIm1hdGNoQ2xhc3MiOmZhbHNlfSwiZmllbGRzIjpbeyJ0eXBlIjoidXNlcm5hbWUiLCJuYW1lIjoiVXNlcm5hbWUiLCJtYXRjaCI6WyJ1c2VyaWQiLCJ1c2VybmFtZSJdfSx7InR5cGUiOiJmaXJzdC1uYW1lIiwibmFtZSI6IkZpcnN0IE5hbWUiLCJtYXRjaCI6WyJmaXJzdG5hbWUiLCJuYW1lZmlyc3QiXX0seyJ0eXBlIjoibGFzdC1uYW1lIiwibmFtZSI6Ikxhc3QgTmFtZSIsIm1hdGNoIjpbImxhc3RuYW1lIiwic3VybmFtZSIsInNlY29uZG5hbWUiLCJuYW1l
View osx-for-hackers.sh
#!/bin/sh
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
View .bash_profile
function git_branch_brackets {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\ [\1\]/'
}
export -f git_branch_brackets
TITLEBAR="\[\033]0;\u@\h:\w\007\]"
export PS1="${TITLEBAR}\[\033[31m\]\u@\h\[\033[00m\]:\[\033[37m\]\w\[\033[00m\]\[\033[0;32m\]\$(git_branch_brackets)\[\033[00m\]$ "
View json_decode_nice.php
<?php
function json_decode_nice($json, $assoc = FALSE){
$json = str_replace(array("\n","\r"),"",$json);
$json = preg_replace('/([{,]+)(\s*)([^"]+?)\s*:/','$1"$3":',$json);
$json = preg_replace('/(,)\s*}$/','}',$json);
return json_decode($json,$assoc);
}
// Example:
View gist:5292867
<?php # Add the following to config.inc.php
$cfg['Export']['sql_drop_database'] = true;
$cfg['Export']['sql_drop_table'] = true;
$cfg['Export']['compression'] = 'zip';
View gist:3087059
find . -type d -exec chmod 775 {} \;
find . -type f -exec chmod 664 {} \;
View fix-permissions.sh
#!/bin/bash
# setfacl script for Web hosting
root=/mnt/data
admin_group=admin
users_group=devs
www_user=www-data
# Clear all acls
sudo setfacl -R -b $root/{environments,repositories,common}
View rsync_project.sh
# Borrowed idea from http://web.onassar.com/blog/2011/04/05/web-development-flow-ubuntu-parallels-coda-and-rsync/
rsync --delete --archive --quiet --progress --stats --compress
--exclude '.svn' \
--exclude '.DS_Store' \
--exclude '.' \
--exclude '..' \
--exclude 'thumbs.db' \
--exclude '*/tmp/*' \
--exclude '*/logs/' \