start new:
tmux
start new with session name:
tmux new -s myname
| #!/bin/bash | |
| # <http://blog.philippklaus.de/2010/09/openvpn/> | |
| set -x | |
| #SERVERNAME=$(hostname) | |
| SERVERNAME=$(ifconfig | grep -A 5 eth0 | grep -w 'inet addr' | tr '\t' ' ' | cut -d ':' -f 2 | cut -d ' ' -f 1) | |
| read -e -p "Please enter the server you want your clients to connect to [default: $SERVERNAME]: " input | |
| SERVERNAME="${input:-$SERVERNAME}" |
| #!/usr/bin/env python | |
| import os, sys | |
| sys.path.append(os.getcwd()) | |
| import logging | |
| import rq | |
| MAX_FAILURES = 3 |
| # | |
| # Slightly tighter CORS config for nginx | |
| # | |
| # A modification of https://gist.github.com/1064640/ to include a white-list of URLs | |
| # | |
| # Despite the W3C guidance suggesting that a list of origins can be passed as part of | |
| # Access-Control-Allow-Origin headers, several browsers (well, at least Firefox) | |
| # don't seem to play nicely with this. | |
| # |
| // Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible). | |
| // Tweak the makePrettyJSON_ function to customize what kind of JSON to export. | |
| var FORMAT_ONELINE = 'One-line'; | |
| var FORMAT_MULTILINE = 'Multi-line'; | |
| var FORMAT_PRETTY = 'Pretty'; | |
| var LANGUAGE_JS = 'JavaScript'; | |
| var LANGUAGE_PYTHON = 'Python'; |
| package main | |
| import ( | |
| "os" | |
| "fmt" | |
| ) | |
| type Fetcher interface { | |
| // Fetch returns the body of URL and | |
| // a slice of URLs found on that page. |
| package main | |
| import ( | |
| "os" | |
| "fmt" | |
| ) | |
| type Fetcher interface { | |
| // Fetch returns the body of URL and | |
| // a slice of URLs found on that page. |
| #!/bin/sh | |
| # To enable this hook, rename this file to "pre-commit". | |
| ############################################################################### | |
| # https://gist.github.com/stuntgoat/8800170 | |
| # Git pre-commit hook for finding and warning about Python print | |
| # statements. | |
| # |
This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.
###Array ####Definition:
| # This script can be used to raise a graylog2/gelf message | |
| # gzip it and send it to a graylog server using netcat (nc) | |
| hostname='gelftester' | |
| short_message='test message short version' | |
| full_message='longer test message. dont\n worry be happy' | |
| level=1 | |
| facility='gelftester' | |
| # gnu date | |
| date=$(date +'%s.%N') |