docker run -it --rm -t devth/alpine-bench -n3 -v2 http://google.com/ | jq -R 'fromjson?' 1>./test/speed-https-jamplay-world.json
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
# Get name andcs image from arguments | |
NAME=$1 | |
IMAGE=${2:-"ubuntu-16-04-x64"} | |
# Get droplet option | |
DO_OPTION=$(tr -d '\n' < ./droplets.json | tr -d ' ') | |
DO_OPTION=${DO_OPTION/'$NAME'/$NAME} | |
DO_OPTION=${DO_OPTION/'$IMAGE'/$IMAGE} | |
# Create droplet |
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
{ | |
"name": "$NAME", | |
"region": "sgp1", | |
"size": "512mb", | |
"image": "$IMAGE", | |
"backups": true, | |
"private_networking": true, | |
"ipv6": true, | |
"monitoring": true, | |
"ssh_keys": [ |
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
{ | |
"variables": { | |
"api_token": "{{env `DO_TOKEN`}}" | |
}, | |
"builders": [ | |
{ | |
"api_token": "{{user `api_token`}}", | |
"type": "digitalocean", | |
"region": "sgp1", | |
"image": "ubuntu-16-04-x64", |
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
# Just for perf, you can skip this. | |
START_SEC=$(date +'%s') | |
# Creating network. | |
docker-machine ssh node-1 "docker network create --driver overlay proxy" | |
# Grab the source. | |
docker-machine ssh node-1 "curl -o docker-compose-stack.yml https://raw.githubusercontent.com/vfarcic/docker-flow-proxy/master/docker-compose-stack.yml" | |
# Create docker-flow-proxy and docker-flow-swarm-listener services. |
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
# Ref : https://docs.docker.com/engine/getstarted-voting-app/deploy-app/ | |
# Just for perf, you can skip this. | |
START_SEC=$(date +'%s') | |
# Cleaning old manager and worker, you can skip this | |
docker-machine rm -f manager && docker-machine rm -f worker | |
# Create manager. | |
docker-machine create --driver virtualbox manager |
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
# Required DIGITALOCEAN_ACCESS_TOKEN from DigitalOcean's dashboard. | |
# https://cloud.digitalocean.com/settings/api/tokens | |
# | |
# Required DIGITALOCEAN_SSH_KEY_FINGERPRINT | |
# $ ssh-keygen -l -E md5 -f ~/.ssh/id_rsa.pub | |
# | |
docker-machine create \ | |
--driver digitalocean \ | |
--digitalocean-access-token=$DIGITALOCEAN_ACCESS_TOKEN \ | |
--digitalocean-image ubuntu-16-04-x64 \ |
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
// By XPATH | |
// https://github.com/facebook/react/graphs/participation?h=28&type=sparkline&w=155 | |
$x("//*[local-name() = 'polyline']/@points")[0].value.split(',') | |
// By String | |
fetch('https://github.com/facebook/react/graphs/participation?h=28&type=sparkline&w=155').then((res) => { | |
return (res.text()) | |
}).then((text) => { | |
// x0, y0, x1, y1, ... | |
console.log(text.match(/points=\"(.*?)"/)[1].trim().split(' ').join(',').split(',').map(s => Number(s))) |
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/sh | |
# https://github.com/certbot/certbot/issues/1833 | |
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games | |
# Ensure script is call | |
echo $(date)'|Renewal' >> /var/log/letsencrypt/daily.log | |
# This script renews all the Let's Encrypt certificates with a validity < 30 days | |
if ! /opt/letsencrypt/letsencrypt-auto renew > /var/log/letsencrypt/renew.log 2>&1 ; then | |
echo Automated renewal failed: |
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
// try this at https://github.com/syrusakbary/gdom | |
{ | |
page(url: "https://preactjs.com") { | |
title | |
html | |
items: query(selector:"link") { | |
url: attr(name:"href") | |
} | |
} | |
} |