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:

@winmillwill
winmillwill / gist:2410110
Created April 18, 2012 00:32
provision-install error
$ drush provision-save '@dev01.airbox.ld' --context_type='site' --uri='dev01.airbox.ld' --platform='@platform_drupal712' --server='@server_master' --db_server='@server_master' --profile='default' --client_name='admin'
$ cat ~/.drush/dev01.airbox.ld.alias.drushrc.php
<?php
$aliases['dev01.airbox.ld'] = array (
'context_type' => 'site',
'platform' => '@platform_drupal712',
'server' => '@server_master',
'db_server' => '@server_master',
@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>
@winmillwill
winmillwill / drupal_vagary.sh
Created May 22, 2013 17:06
simple bash script to download gists to
#!/usr/bin/env bash
#get the Vagrantfile
curl https://gist.github.com/winmillwill/5629071/raw/98351386ee2bf068a585153a7c2c59d0f76d1e59/Vagrantfile -o Vagrantfile
#get the Berksfile
curl https://gist.github.com/winmillwill/5629140/raw/c53e901d95244562d4d6190feadebb70eb4b4d41/Berksfile -o Berksfile
#install the necessary plugins
vagrant plugin install vagrant-berkshelf
@winmillwill
winmillwill / Berksfile
Created May 22, 2013 16:58
An example Berksfile for local development with vagrant and drupal
site :opscode
cookbook "drupal", git: "https://github.com/promet/drupal_cookbook"
cookbook "solo-helper", git: "https://github.com/glennpratt/solo-helper_cookbook.git"
@winmillwill
winmillwill / Vagrantfile
Last active December 17, 2015 15:08
Example Vagrantfile for drupal, specifically github.com/promet/drupal_cookbook
Vagrant.configure("2") do |config|
config.berkshelf.enabled = true
config.berkshelf.berksfile_path = "./Berksfile"
config.vm.box = "squeeze"
config.vm.box_url = "https://s3.amazonaws.com/wa.milton.aws.bucket01/sqeeze.box"
config.ssh.max_tries = 40
config.ssh.timeout = 120
require 'rake/clean'
DRUPAL_ROOT = "#{File.dirname(__FILE__)}/www"
PROJECT = "airbox"
DRUPAL_URI = "#{PROJECT}.dev"
DATABASE_PATH = "archives/current/database.sql"
FILES_PATH = "archives/current/files"
ARCHIVE_DIR = "/var/drupals/archives/#{PROJECT}"
DRUSH_DIR = "#{ENV['HOME']}/.drush"
BUILD_DIR = "build"