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
function logAccess($status = 200) { | |
file_put_contents("php://stdout", sprintf("custom =>[%s] %s:%s [%s]: %sn", | |
date("D M j H:i:s Y"), $_SERVER["REMOTE_ADDR"], | |
$_SERVER["REMOTE_PORT"], $status, $_SERVER["REQUEST_URI"])); | |
} | |
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
# more about graphite events at http://obfuscurity.com/2014/01/Graphite-Tip-A-Better-Way-to-Store-Events | |
import json | |
import requests | |
def create_graphite_event(event_description, tags): | |
required_data = "Graphite needs SSD!" # I tried withouth data attribute and it didn't work | |
tags_string = " ".join(str(x) for x in tags) # Since you will pass an array but graphite expects multi tags like "a,b,c" or "a b c" | |
event = {"what": event_description, "tags": tags_string, "data": required_data} | |
try: |
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 | |
old_sha1, new_sha1, ref = gets.split | |
if ref == "refs/heads/master": | |
puts "Pushing to origin/master is not permitted." | |
puts "This is a read-only branch." | |
puts "" | |
puts "Create a new branch instead, or commit to SVN." |
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
pi@raspberrypi ~ $ cat /etc/init/ssh_tunnel.conf | |
#!upstart | |
author "george" | |
description "SSH Tunnel" | |
start on stopped rc | |
stop on shutdown |