Skip to content

Instantly share code, notes, and snippets.

@winmillwill
winmillwill / statsd-tee-initcontainer.yml
Created January 23, 2022 15:25
for teeing to a new statsd host in kube
initContainers:
- args:
- |
apk add iptables
iptables -t mangle -L
iptables -t nat -L
SOURCE_IP=$(ip route get 1 | head -n1 | sed 's/.* src \([^ ]*\) .*/\1/')
iptables -t mangle -A PREROUTING -p UDP -i eth0 --dport 8125 -j TEE --gateway 127.0.0.2 -m state --state NEW,ESTABLISHED,RELATED
iptables -t nat -A PREROUTING -i eth0 -p UDP --dport 8125 -j DNAT --to 10.0.95.199:3031 -m state --state NEW,ESTABLISHED,RELATED
iptables -t nat -A POSTROUTING -p UDP --dport 3031 -j SNAT --to-source ${SOURCE_IP} -m state --state NEW,ESTABLISHED,RELATED
@winmillwill
winmillwill / main.go
Created September 13, 2018 19:00
argo submit service
package main
import (
"bufio"
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
"strings"

Keybase proof

I hereby claim:

  • I am winmillwill on github.
  • I am winmillwill (https://keybase.io/winmillwill) on keybase.
  • I have a public key whose fingerprint is 9CC4 725C FC40 F602 0DF6 F259 BE94 1EF6 B148 C0B6

To claim this, I am signing this object:

require 'plist'
name_servers = ['172.17.42.1', '8.8.4.4', '8.8.8.8']
plist_file = '/Library/Preferences/SystemConfiguration/preferences.plist'
plist = Plist::parse_xml(plist_file)
current_set_key = plist['CurrentSet'].split('/').at(-1)
service_key = nil
plist['NetworkServices'].each do |key, dict|
if (addresses = dict['DNS']['ServerAddresses'])
addresses = addresses + (name_servers - addresses)
@winmillwill
winmillwill / gist:cdb6af0059d4f08196b1
Created August 8, 2014 15:28
tmux config for yanking to clipboard
# Copy mode¬
setw -g mode-keys vi¬
bind ` copy-mode¬
unbind [¬
unbind p¬
bind p paste-buffer¬
bind -t vi-copy H start-of-line¬
bind -t vi-copy L end-of-line¬
bind -t vi-copy v begin-selection¬
bind -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy"¬
{
"repositories": [{
"type": "composer",
"url": "http://drupal-packagist.org"
}],
"minimum-stability": "alpha",
"require": {
"drupal/panopoly": "7.*"
}
}
@winmillwill
winmillwill / pass_export.sh
Created February 18, 2014 16:30
export environment variables with sensitive values from pass (think aws)
#!/bin/bash
creds=( `pass $1` )
for cred in "${creds[@]}"; do
export $cred;
done
@winmillwill
winmillwill / Support.md
Created February 1, 2014 19:28 — forked from itendo/Support

Support

Authors

Prometsource

Michelle Krejci, Greg Pamier, Will Milton, Doug Dobrzynski, Matthew Gilboy

Client Paths

@winmillwill
winmillwill / export_features.sh
Created January 8, 2014 15:31
simple features export example in le script avec bash
#! /bin/bash
set -ex
# Pass all arguments to drush
while [ $# -gt 0 ]; do
drush_flags="$drush_flags $1"
shift
done
@winmillwill
winmillwill / apache rewrite proxy for drupal files
Created November 5, 2013 15:31
Keep your Drupal files in s3
<VirtualHost>
# ...
SSLProxyEngine On
# Since Drupal has infinite terrible file i/o already, doing a stat before proxying and avoiding it doesn't make me feel bad
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/sites/.*/files/(.*)$ https://s3.amazonaws.com/my.sweet.bucket.aws.bucket01/files/$1 [P]
ProxyPassReverse /sites/mysite.dev/files/ https://s3.amazonaws.com/my.sweet.bucket.aws.bucket01/files/
</VirtualHost>