Skip to content

Instantly share code, notes, and snippets.

View bobwei's full-sized avatar

Bob Wei bobwei

View GitHub Profile
@bobwei
bobwei / generate_docker_cert.sh
Last active July 26, 2016 16:33 — forked from bradrydzewski/generate_docker_cert.sh
Generate trusted CA certificates for running Docker with HTTPS
#!/bin/bash
#
# Generates client and server certificates used to enable HTTPS
# remote authentication to a Docker daemon.
#
# See http://docs.docker.com/articles/https/
#
# To start the Docker Daemon:
#
# sudo docker -d \
@bobwei
bobwei / ExpressJS rawBody
Created August 7, 2016 17:37 — forked from enreeco/ExpressJS rawBody
NodeJS ExpressJS Getting Raw Body on request object
app.configure(function() {
//. . .
app.use(express.bodyParser());
app.use(function(req, res, next) {
var data = '';
req.setEncoding('utf8');
req.on('data', function(chunk) {
data += chunk;
});
req.on('end', function() {
@bobwei
bobwei / ngrok_hostname.sh
Created April 11, 2017 02:41 — forked from rjz/ngrok_hostname.sh
Get ngrok hostname from command line
#!/bin/sh
# ngrok's web interface is HTML, but configuration is bootstrapped as a JSON
# string. We can hack out the forwarded hostname by extracting the next
# `*.ngrok.io` string from the JSON
#
# Brittle as all get out--YMMV. If you're still reading, usage is:
#
# $ ./ngrok_hostname.sh <proto> <addr>
#
@bobwei
bobwei / .drone.yml
Created December 15, 2017 17:13 — forked from learncodeacademy/.drone.yml
Rancher Drone CD Pipeline Setup
pipeline:
slack:
image: plugins/slack
webhook: <your slack webhook url>
channel: deployments
username: drone
template: "<{{build.link}}|Deployment #{{build.number}} started> on <http://github.com/{{repo.owner}}/{{repo.name}}/tree/{{build.branch}}|{{repo.name}}:{{build.branch}}> by {{build.author}}"
when:
branch: [ master, staging ]
build: