Skip to content

Instantly share code, notes, and snippets.

View scalopus's full-sized avatar

Warun Kietduriyakul scalopus

View GitHub Profile
@georgeredinger
georgeredinger / tunnels
Created July 31, 2012 21:50
raspberrypi reverse ssh tunnel upstart scripts
pi@raspberrypi ~ $ cat /etc/init/ssh_tunnel.conf
#!upstart
author "george"
description "SSH Tunnel"
start on stopped rc
stop on shutdown
@Fedalto
Fedalto / pre-receive
Created March 27, 2013 20:25
Git hook to make a git repository master branch read only. This should go in .git/hooks/
#!/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."
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active May 15, 2025 02:02
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@leandromoreira
leandromoreira / create_graphite_event.py
Last active July 24, 2017 19:07
Post event on graphite using python as a client
# 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:
@up1
up1 / router.php
Last active August 29, 2015 14:08
Demo :: php router
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"]));
}