This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
\"text\": \"RELEASE has been released at URL \", | |
\"channel\": \"#CHANNEL\", | |
\"username\": \"USERNAME\", | |
\"icon_emoji\": \"EMOJI\" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 = "" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
aws_credentials_file=${HOME}/.aws/credentials | |
script_name=`basename $0` | |
error(){ | |
echo "[${script_name}] Error: $@. Exiting." | |
exit 1 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM busybox | |
COPY data/BUILD_REV / |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
import random | |
from grandfatherson import to_keep, to_delete, MONDAY | |
import pytz | |
# Install notes: | |
# require grandfatherson & pytz - pip3 install grandfatherson pytz | |
utc=pytz.UTC | |
now = datetime.datetime.now().replace(tzinfo=utc) # ensure TZ aware |