Skip to content

Instantly share code, notes, and snippets.

Avatar

Jo Boiteau jobwat

View GitHub Profile
@jobwat
jobwat / commands
Created Mar 10, 2017
Docker nodes load balancer with nginx upstream
View commands
# Run 3 nodes
for i in 1 2 3; do
nod="n$i"
mkdir $nod
echo "$nod" >> $nod/index.html
docker run -d --name $nod -p 888${i}:80 -v `pwd`/${nod}:/usr/share/nginx/html:ro nginx
done
# Run a router proxy node
docker run --rm --name router -p 8888:80 -v `pwd`/default.conf:/etc/nginx/conf.d/default.conf nginx
@jobwat
jobwat / Dockerfile
Created Mar 9, 2017
Docker node crontab
View Dockerfile
FROM node:6
RUN apt-get update && apt-get -y install cron
RUN mkdir /app
ADD test.js /app
# Add crontab file in the cron directory
ADD crontab /etc/cron.d/hello-cron
@jobwat
jobwat / Dockerfile-app
Created Jan 24, 2017
Codeship demo case: write CI environment variables to file in image
View Dockerfile-app
FROM busybox
COPY data/BUILD_REV /
@jobwat
jobwat / curl_to_snappass.sh
Last active Feb 24, 2017
Send a file to snappass with curl via command line
View curl_to_snappass.sh
cat my-file | curl https://snappass.nurun.com.au -s --data "password=$(cat - | perl -p -e 's/([^A-Za-z0-9])/sprintf("%%%02X", ord($1))/seg')&ttl=1+day" | grep 'password-link.*readonly' | sed -E 's/.*"(http[^"]*)".*/\1/'
@jobwat
jobwat / tmux.pres.remark.html
Created Oct 26, 2016
Quick Presentation tmux - remark
View tmux.pres.remark.html
<!DOCTYPE html>
<html>
<head>
<title>Title</title>
<meta charset="utf-8">
<style>
@import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz);
@import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic);
@import url(https://fonts.googleapis.com/css?family=Ubuntu+Mono:400,700,400italic);
View keybase.md

Keybase proof

I hereby claim:

  • I am jobwat on github.
  • I am jobwat (https://keybase.io/jobwat) on keybase.
  • I have a public key whose fingerprint is 13BB 4AB0 583F 7337 5F24 CF95 EE58 D592 4AF7 781A

To claim this, I am signing this object:

@jobwat
jobwat / guess_account.sh
Last active Dec 3, 2019
update .ssh/config with CloudFormation stack IPs
View guess_account.sh
#!/bin/bash
aws_credentials_file=${HOME}/.aws/credentials
script_name=`basename $0`
error(){
echo "[${script_name}] Error: $@. Exiting."
exit 1
}
@jobwat
jobwat / 0_reuse_code.js
Created Jan 11, 2016
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@jobwat
jobwat / consul.lua
Last active Jul 21, 2018 — forked from gmr/consul.lua
Dynamic Nginx upstream nodes using Consul
View consul.lua
module("resty.consul", package.seeall)
_VERSION = '0.1.0'
function service_nodes(service)
local http = require "resty.http"
local json = require "cjson"
local hc = http:new()
local upstream = ""
@jobwat
jobwat / payload.json
Last active Aug 29, 2015
Curl message into a slack.com channel
View payload.json
{
\"text\": \"RELEASE has been released at URL \",
\"channel\": \"#CHANNEL\",
\"username\": \"USERNAME\",
\"icon_emoji\": \"EMOJI\"
}