Skip to content

Instantly share code, notes, and snippets.

View georgebashi's full-sized avatar

George Bashi georgebashi

View GitHub Profile
@georgebashi
georgebashi / git-foreach.sh
Created September 22, 2011 16:59
handy script for working with multiple repos
#!/bin/sh
cmd="$1"
if [ $# -gt 1 ]; then
shift 1
files=$@
else
files=`find . -depth 1 -type d -not -name '.*' | cut -c 3-`
fi
<settings>
<profiles>
<profile>
<id>flex-mojos</id>
<repositories>
<repository>
<id>flex-mojos-repository</id>
<url>http://repository.sonatype.org/content/groups/flexgroup/</url>
<releases> <enabled>true</enabled> </releases>
@georgebashi
georgebashi / gist:785368
Created January 18, 2011 23:20
Suffix rules for Haml and Sass
.SUFFIXES: .html .haml .css .sass
.haml.html:
haml $< > $@
.css.sass:
sass $< > $@
server {
server_name www.georgebashi.com;
rewrite ^(.*) http://georgebashi.com$1 permanent;
}
require 'rubygems'
require 'nokogiri'
require 'open-uri'
require 'json'
require 'cgi'
require 'find'
require 'net/http'
require 'progressbar'
class Movie
check process nginx with pidfile /opt/nginx/logs/nginx.pid
start program = "/etc/init.d/nginx start" with timeout 10 seconds
stop program = "/etc/init.d/nginx stop"
if cpu > 60% for 2 cycles then alert
if cpu > 80% for 5 cycles then restart
if totalmem > 200.0 MB for 5 cycles then restart
if loadavg(5min) greater than 10 for 8 cycles then stop
if failed host rly.gd port 80 protocol http
and request "/"
then restart
#!/bin/sh
rm -rf /opt/nginx/conf/* /opt/nginx/conf/.git
git clone --depth=1 /home/git/repositories/nginx-conf.git /opt/nginx/conf
git clone [email protected]:nginx-conf.git
git remote add origin [email protected]:nginx-conf.git
git push origin master
cd /opt/nginx/conf
git init .
git add .
git commit