Skip to content

Instantly share code, notes, and snippets.

View bvanderlugt's full-sized avatar
🌵

Blair Vanderlugt bvanderlugt

🌵
View GitHub Profile
@bvanderlugt
bvanderlugt / python_oneliners
Created June 12, 2015 16:56
cool python one-liners...or multi-liners
# cool way to increment a value in a dict
some_dict[aKey] = some_dict.get(aKey, 0) + 1
# React webpack and sass
# depends on: npm babel webpack weback-dev-server -g
npm init
npm install react react-dom --save
npm install babel-loader babel-core babel-preset-es2015 babel-preset-react
# for a simple project make a directory structure like so
touch index.html App.js main.js webpack.config.js
## webpack.config.js using sass loader
@bvanderlugt
bvanderlugt / dronehelp.md
Last active June 19, 2017 21:19
drone.io troubleshooting

Did you set up env vars?

export DRONE_SERVER=http://buildme.com

export DRONE_TOKEN=specialtoken

Need to add a secret?

drone secret add --image=plugins/downstream
octocat/hello-world DOWNSTREAM_TOKEN my-secret-token

Note: In automated pipelines, you may need to run the following command for your Git repository prior to calling terragrunt to ensure that the ssh host is registered locally, e.g.:
$ ssh -T -oStrictHostKeyChecking=no git@github.com || true
@bvanderlugt
bvanderlugt / README.md
Created August 15, 2017 19:32
Set up letsencrypt certs manually on aws

Manually set up letsencrypt certs on AWS

Create an AWS ec2 instance. Create a route53 record. Create and elb.

git clone https://github.com/letsencrypt/letsencrypt
cd letsencrypt
const https = require('https');
const fs = require('fs');
const options = {
key: fs.readFileSync('privkey.pem'),
cert: fs.readFileSync('cert.pem'),
ca: fs.readFileSync('fullchain.pem'),
requestCert: true,
}
@bvanderlugt
bvanderlugt / handler.js
Created August 16, 2017 16:31 — forked from jeffrafter/handler.js
Simple HTTP Server and Router in node.js
exports.createHandler = function (method) {
return new Handler(method);
}
Handler = function(method) {
this.process = function(req, res) {
params = null;
return method.apply(this, [req, res, params]);
}
}

brew info somedanktool

brew switch somedanktool 1.6.9

@bvanderlugt
bvanderlugt / linux_trix.md
Last active August 30, 2017 20:21
Linux Trix

a better way to cat things into a file, use EOF!

cat > somethang.txt <<EOF
Yo we heard you like text in your text files so we put text inside your text.
EOF

make multiple dirs

sudo mkdir -p /var/lib/{kubelet,kube-proxy,kubernetes}
# filter amis on region and name
aws ec2 describe-images --region us-west-2 --filters "Name=name,Values=rancheros-v1.1*" "Name=virtualization-type,Values=hvm" --query 'Images[*].Name'
# create key-pair and save to file
aws ec2 create-key-pair --key-name dummy --query "KeyMaterial" > dummy.pem