This file contains hidden or 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 | |
usage="Usage: magback.sh <tarball file> <deploy|restore|clear>" | |
writelog(){ | |
echo $1 >> .magback.log | |
if [ $# -eq 2 ]; | |
then | |
echo $1 | |
fi |
This file contains hidden or 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
#!/Applications/MAMP/bin/php5.2/bin/php | |
<?php | |
class dzt{ | |
public $host = 'localhost'; | |
public $user = 'dbuser'; | |
public $pw = 'dbpassword'; | |
public $db = 'dbname'; | |
This file contains hidden or 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 | |
if [ $# -lt 3 ]; then | |
echo -e "hhhh v0.2\nUsage: hhhh <author> <from date> <to date>" | |
exit | |
fi | |
pretty="--pretty=%C(blue)%ad%Creset %C(yellow)%h%C(green)%d%Creset %C(blue)%s %C(magenta) [%an]%Creset" | |
fl=`git log "$pretty" --author "$1" --since "$2" --until "$3"|awk ' ORS="\n" { $4=$5=$6=$7=""; print $0}'` | |
echo "$fl"|awk 'FS=" " { gsub(/(\[[A-Za-z0-9&#\ ]+\] ?|Merge.*)/,"");\ | |
if (a != $1){ print sep$1sep$2 } else { print $2 } }\ | |
{ a=$1; sep="\n==========\n" }' |
This file contains hidden or 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 | |
usage="Tarbecue\nUsage: $0 <tarfile> [commit id]" | |
if [ $# -lt 1 ]; then | |
echo -e $usage | |
exit | |
elif [ $# -lt 2 ]; then | |
commit="" | |
else | |
commit=$2 | |
fi |
This file contains hidden or 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 ruby | |
require 'RMagick' | |
require 'fileutils' | |
#color parser from https://gist.github.com/edouard/1787879 | |
TOP_N = 10 # Number of swatches | |
def sort_by_decreasing_frequency(img) | |
hist = img.color_histogram | |
sorted = hist.keys.sort_by {|p| -hist[p]} | |
new_img = Magick::Image.new(hist.size, 1) |
This file contains hidden or 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
execute pathogen#infect() | |
filetype plugin indent on | |
filetype plugin on | |
syntax on | |
set clipboard=unnamed | |
"colorscheme desert "badwolf | |
"colorscheme gummybears | |
"colorscheme tokyo-metro | |
colorscheme pablo |
This file contains hidden or 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 | |
if [ $# -lt 1 ]; then | |
echo -e "Usage:" | |
echo -e "$0 <csvfile>" | |
exit | |
fi | |
total=$(wc -l $1|awk '{ print $1 }') | |
inc=4999 |
This file contains hidden or 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
#get array of cities by | |
#Schools.where('XX').map(&:city).uniq.sort { |a,b| a.downcase <=> b.downcase } | |
def group_in_pairs (arr) | |
ra = [] | |
skip = -1 | |
arr.each_with_index do |a,i| | |
return ra if arr[i+1].nil? | |
next if skip > i | |
if (a.downcase == arr[i+1].downcase) |
This file contains hidden or 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 | |
if [ $# -lt 1 ]; then | |
echo -e "Usage: $0 <target process>" | |
exit | |
fi | |
target=`ps aux|grep pow|awk -v app="$1" '{ if($11 == app) { pid = $2 } } END { print pid }'` | |
if [ ! -z "$target" -a "$target" != " " ]; then | |
kill -9 $target | |
fi |
This file contains hidden or 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 | |
tail -f $1 | awk '/INFO/ {print "\033[32m" $0 "\033[39m"} | |
/SEVERE/ {print "\033[5m\033[31m\033[40m" $0 "\033[39m"} | |
/kernel|lsd/ {print "\033[36m" $0 "\033[39m"} | |
/login|(a|A)uth|accountsd|secd/ {print "\033[46m\033[34m" $0 "\033[39m"} | |
/networkd|sharingd|blued|watchdogd|cdpd|locationd/ {print "\033[92m" $0 "\033[39m"} | |
/imagent/ {print "\033[7m\033[92m" $0 "\033[39m"} | |
/Google/ {print "\033[43m\033[90m" $0 "\033[39m"} | |
/Error|spindump/ {print "\033[101m\033[30m" $0 "\033[39m"} |
OlderNewer