Skip to content

Instantly share code, notes, and snippets.

Avatar

Tao Wang twang2218

  • Sydney, Australia
View GitHub Profile
View beta_plot.py
from scipy.stats import beta
from scipy.stats import arcsine
import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(0, 1.0, 100)
x_ticks = np.linspace(0, 1.0, 5)
temp = np.linspace(10, 40, 5)
@twang2218
twang2218 / run.sh
Last active Oct 23, 2017
利用 docker-machine 架设代理服务器
View run.sh
#!/bin/bash
# set -e
DOMAIN=lab99.org
NAME=v1
PORT=8080
MODE=aes-256-gcm
TOKEN=dockerrocks
function start() {
View zazu-clipboard-performance-adjust.md
  • System: Elementary OS Loki

master branch

{"plugin":"tinytacoteam/zazu-clipboard","block":"Monitor","level":"info","message":"monitor(): 648 ms","timestamp":"2017-02-10T08:46:58.839Z"}
{"plugin":"tinytacoteam/zazu-clipboard","block":"Monitor","level":"info","message":"monitor(): 636 ms","timestamp":"2017-02-10T08:46:59.579Z"}
{"plugin":"tinytacoteam/zazu-clipboard","block":"Monitor","level":"info","message":"monitor(): 641 ms","timestamp":"2017-02-10T08:47:00.325Z"}
{"plugin":"tinytacoteam/zazu-clipboard","block":"Monitor","level":"info","message":"monitor(): 642 ms","timestamp":"2017-02-10T08:47:01.071Z"}
{"plugin":"tinytacoteam/zazu-clipboard","block":"Monitor","level":"info","message":"monitor(): 647 ms","timestamp":"2017-02-10T08:47:01.820Z"}
View atom-beautify-sqlformat-debug.md
View test.md

存在,【中文】;《标点》、符号!的标题?

中间有空格 和.符号.的 (标题)

中间有空格 和.符号.的(标题)

。?!,、

;:“”【】

()〔〕[]

﹃﹄“ ”‘’

﹁﹂—…-~

##《》〈〉﹏_「」

英文标点

@twang2218
twang2218 / docker-compose.yml
Last active Sep 18, 2021
HAProxy + Nginx + PHP with client IP attached (don't forget docker daemon option `--userland-proxy=false`)
View docker-compose.yml
version: '2'
services:
haproxy:
image: haproxy:alpine
volumes:
- ./haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg
ports:
- "80:80"
depends_on:
- nginx
View docker-info.txt
$ docker info
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 0
Server Version: swarm/1.2.4
Role: primary
Strategy: spread
Filters: health, port, containerslots, dependency, affinity, constraint
@twang2218
twang2218 / create-swarm-mode-cluster.sh
Last active Jan 18, 2022
Script to create a swarm mode cluster which introduced in Docker 1.12
View create-swarm-mode-cluster.sh
#!/bin/bash
Size=3
if [ -z "${DOCKER_MACHINE_DRIVER}" ]; then
DOCKER_MACHINE_DRIVER=virtualbox
fi
# REGISTRY_MIRROR_OPTS="--engine-registry-mirror https://jxus37ac.mirror.aliyuncs.com"
# INSECURE_OPTS="--engine-insecure-registry 192.168.99.0/24"
@twang2218
twang2218 / Dockerfile
Created Jul 14, 2016
Docker cron example
View Dockerfile
FROM python:3.5.2
ENV TZ=Asia/Shanghai
RUN apt-get update \
&& apt-get install -y cron \
&& apt-get autoremove -y
COPY ./cronpy /etc/cron.d/cronpy
CMD ["cron", "-f"]
@twang2218
twang2218 / prepare-openvpn-service.sh
Created Jul 12, 2016
Script to create an OpenVPN service
View prepare-openvpn-service.sh
#!/bin/sh
# Before run this script, a docker host in a public cloud should be available
# The host can be created by the following commands:
#
# docker-machine create -d digitalocean dev
# eval $(docker-machine env dev)
#
# Then you can run this command simply by :
#