Skip to content

Instantly share code, notes, and snippets.

View georgebashi's full-sized avatar

George Bashi georgebashi

View GitHub Profile
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
require 'rubygems'
require 'nokogiri'
require 'open-uri'
require 'json'
require 'cgi'
require 'find'
require 'net/http'
require 'progressbar'
class Movie
server {
server_name www.georgebashi.com;
rewrite ^(.*) http://georgebashi.com$1 permanent;
}
@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 $< > $@
<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 / 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
@georgebashi
georgebashi / gist:1284494
Created October 13, 2011 15:20
edit file with regex
perl -p -i -e 's/xmlns:tei/xmlns/ if 1..5' gdlc/0/EC-abelles-1.xml
<?xml version="1.0" encoding="UTF-8"?>
<book xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0">
<chapter>
<title />
<para>test</para>
</chapter>
</book>
/*
* GLOW.Compiler
* @author: Mikael Emtinger, gomo.se
* Compiles vertex- and fragementshader, uniforms, attributes and elements into a GLOW.CompiledData
*/
GLOW.Compiler = (function() {
"use strict";
"use restrict";
Array.prototype.forEachG = function(f) {
for (var i = 0; i < this.length; i++) {
f(this[i], i, this);
}
}