Skip to content

Instantly share code, notes, and snippets.

View rms1000watt's full-sized avatar

Ryan M Smith rms1000watt

View GitHub Profile
@rms1000watt
rms1000watt / setup.sh
Created July 23, 2019 22:03
Direnv Setup
#!/usr/bin/env bash
cat << EOF > ~/.direnvrc
use_ryan () {
touch pizza.txt
echo "hello pizza"
}
EOF
cat << EOF > .envrc
@rms1000watt
rms1000watt / ignore-versioning-spinnaker.yaml
Created July 2, 2019 00:19
Ignore Versioning in Spinnaker
# https://www.spinnaker.io/reference/providers/kubernetes-v2/#strategy
# https://github.com/spinnaker/spinnaker/issues/3202#issuecomment-413527927
apiVersion: v1
kind: Secret
metadata:
name: myregistrykey
annotations:
'strategy.spinnaker.io/versioned': 'false' # <-- this is the important part
type: kubernetes.io/dockerconfigjson
data:
@rms1000watt
rms1000watt / go-list.sh
Created June 21, 2019 22:27
go list all deps of a golang project
go list -deps
go list -f '{{join .Deps "\n"}}'
@rms1000watt
rms1000watt / scidr.rb
Created June 20, 2019 19:56
Example Homebrew File
# github.com/unclever-labs/homebrew-unclever-labs
require "FileUtils"
$v = "0.0.1"
class Scidr < Formula
homepage "https://github.com/unclever-labs/scidr"
url "https://github.com/unclever-labs/scidr/releases/download/#{$v}/scidr-#{$v}-darwin-amd64"
@rms1000watt
rms1000watt / list-of-ip-ban-urls.txt
Last active June 19, 2019 18:11
List of IP Ban URL Lists
https://www.spamhaus.org/drop/drop.txt
https://www.spamhaus.org/drop/edrop.txt
https://rules.emergingthreats.net/fwrules/emerging-Block-IPs.txt
@rms1000watt
rms1000watt / helm-rbac.yaml
Created June 18, 2019 00:14
Install Helm on Kubernetes
---
apiVersion: v1
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: tiller-role-binding
roleRef:
kind: ClusterRole
name: cluster-admin
apiGroup: rbac.authorization.k8s.io
@rms1000watt
rms1000watt / create-athena-alb-table-s3.sql
Last active May 31, 2019 00:10
Create Table in AWS Athena for ALB -> S3 records
CREATE EXTERNAL TABLE IF NOT EXISTS alb_table_name_here (
type string,
time string,
elb string,
client_ip string,
client_port int,
target_ip string,
target_port int,
request_processing_time double,
target_processing_time double,
@rms1000watt
rms1000watt / waf-ip-updater.sh
Created May 13, 2019 21:37
Script to update WAF with a bunch of IP Addresses from file
#!/usr/bin/env bash
if [[ ! -f ips.txt ]]; then
echo "ERROR: missing file ./ips.txt"
exit 1
fi
if [[ ! ${1} ]]; then
echo "ERROR: ip-set-id not provided as \${1}"
exit 1
@rms1000watt
rms1000watt / generate-b64sha256.sh
Created May 8, 2019 23:26
Generate base64 sha256 the same way as AWS Lambda as seen by Terraform's `source_code_hash`
#!/usr/bin/env bash
openssl dgst -sha256 -binary lambda.zip | base64