This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
_whack_a_mole_log=~/dotfiles/log/whack-a-mole.log | |
_whack_a_mole () { | |
printf $@: | |
while true | |
do | |
i=$(ps aux | grep $@ | grep -ve grep -ve whack-a-mole | awk '{print $2}') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
_log () { | |
echo $(date) $@ >> /var/log/sequelpro.log | |
} | |
for i do | |
case "$i" | |
in | |
-L\ *) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function autoinst() | |
{ | |
declare -a _list=() | |
for i | |
do | |
command -v "$i" > /dev/null || _list[${#_list[@]}]="$i" | |
done | |
test ${#_list[@]} -eq 0 && return |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
abstract class M3SystemProperty_model extends MY_Model | |
{ | |
/** | |
* @var M3SystemProperty_model | |
*/ | |
protected $system_property_api = null; | |
protected $system_property_cache = array('enabled'=>FALSE, 'expiry'=>300, 'driver'=>null); | |
protected static $GET_SYSTEM_PROPERTY = '/system/property/%s'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
case $1 in | |
-clean|clean) | |
/Applications/eclipse/Eclipse.app/Contents/MacOS/eclipse -clean | |
;; | |
*) | |
[ $# -gt 0 ] && | |
FILES="$@" || | |
while read _FILES |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
print_r(apache_request_headers()); | |
foreach ($_SERVER as $key => $val) | |
{ | |
if (sscanf($key, 'HTTP_%s', $header) === 1) | |
{ | |
// take SOME_HEADER and turn it into Some-Header | |
$header = str_replace('_', ' ', strtolower($header)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$examples = array( | |
'../' => '' | |
, '/../' => '' | |
, 'abc/../' => 'abc' | |
, '../def' => 'def' | |
, '/../def' => 'def' | |
, 'abc/../../def' => 'abc/def' | |
, 'abc../' => 'abc..' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
variable_name="$1" | |
shift | |
while read "$variable_name" | |
do | |
eval "$(echo "$@" | sed s/"$variable_name"/'"'\$"$variable_name"'"'/g)" | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
function _usage() | |
{ | |
echo "$0 [php53|php54|php55|php56]" | |
} | |
function phpversion() | |
{ | |
local _VERSION=$1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Set the following SSH configurations to no: | |
# ChallengeResponseAuthentication | |
# PasswordAuthentication | |
# UsePAM | |
test -f /etc/ssh/sshd_config || exit 1 | |
sed -i -r -e \ |