Skip to content

Instantly share code, notes, and snippets.

View wpsmithtwc's full-sized avatar

Travis Smith wpsmithtwc

View GitHub Profile
@wpsmithtwc
wpsmithtwc / main.vcl
Created May 9, 2017 14:53
Fastly Default Main VCL
sub vcl_recv {
# Note: the convention of if (req.http.Fastly-FF) indicates this should only happen on the shield. Use !Fastly-FF to only execute on the edge
if (req.http.Fastly-FF) {
set req.max_stale_while_revalidate = 0s;
}
# Note: do not remove the macros below, this inserts whatever is configured in the web portal, and is required
@wpsmithtwc
wpsmithtwc / google-dorks
Created May 5, 2017 23:58 — forked from clarketm/google-dorks
Listing of a number of useful Google dorks.
" _ _ "
" _ /|| . . ||\ _ "
" ( } \||D ' ' ' C||/ { % "
" | /\__,=_[_] ' . . ' [_]_=,__/\ |"
" |_\_ |----| |----| _/_|"
" | |/ | | | | \| |"
" | /_ | | | | _\ |"
It is all fun and games until someone gets hacked!
@wpsmithtwc
wpsmithtwc / .gitignore
Created May 4, 2017 15:09 — forked from octocat/.gitignore
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
# use a desktop user-agent string
#user-agent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_1) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.186 Safari/535.1"
# use a mobile user-agent string
#user-agent = "Mozilla/5.0 (iPhone; CPU iPhone OS 5_0 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9A334 Safari/7534.48.3"
# When following a redirect, automatically set the previous URL as referer.
#referer = ";auto"
referer = "http://domain.com"
<?php
// Silence is golden
// Moved to https://gist.github.com/wpsmith/b759bedf8f755cb88157703f49e969e7
<?php
// Silence is golden
// Moved to https://gist.github.com/wpsmith/1c48ad42ec790f9f27e865bc724a8311
<?php
// Silence is golden
// Moved to https://gist.github.com/wpsmith/9401d2eb179ad8bdb2b2849603eed922
<?php
/**
* Outputs the state link.
*
* @param $articles array Array of articles array('url'=>'', 'title'=> '',)
* @param $state string State name.
*/
function do_state( $articles, $state ) {
if ( isset( $articles[ $state ] ) ) {

Raspberry Pi VPN Router

This is a quick-and-dirty guide to setting up a Raspberry Pi as a "router on a stick" to PrivateInternetAccess VPN.

Requirements

Install Raspbian Jessie (2016-05-27-raspbian-jessie.img) to your Pi's sdcard.

Use the Raspberry Pi Configuration tool or sudo raspi-config to:

@wpsmithtwc
wpsmithtwc / file_response_writer.go
Created April 12, 2017 19:43
Write backend HTTP response to http.ResponseWriter and File
// fileResponseWriter wraps an http.ResponseWriter and a File
// passing it to an http.Handler's ServeHTTP
// will write to both the file and the response.
type fileResponseWriter struct {
file io.Writer
resp http.ResponseWriter
multi io.Writer
}