Skip to content

Instantly share code, notes, and snippets.

View gavinzhou's full-sized avatar
🏠
Working from home

Gavin Zhou gavinzhou

🏠
Working from home
View GitHub Profile
@gavinzhou
gavinzhou / nginx-cache-influxdb-query
Created December 20, 2016 02:55
nginx-cache-influxdb-query
proxy_cache_path /var/cache/nginx-influxdb levels=2:2 keys_zone=influxdb:6m max_size=300m inactive=2d;
server {
listen 8088;
server_name {{ grains['fqdn'] }};
set $cbypass 0;
set $mycc "public, max-age=20s";
location / {
@gavinzhou
gavinzhou / kube-status.log
Created December 18, 2016 01:12 — forked from theobolo/kube-status.log
IngressController
Test
worker_processes 1;
events {
worker_connections 1024;
}
http {
server {
listen 80 default_server;
server_name orangesys;
@gavinzhou
gavinzhou / grafana custom.ini
Created December 16, 2016 04:21 — forked from mvadu/grafana custom.ini
nginx config for using grafana, Influxdb via reverse proxy with authentication
# The full public facing url
#root_url = %(protocol)s://%(domain)s:%(http_port)s/
root_url = http://localhost:80/grafana/
@gavinzhou
gavinzhou / .noserc
Created December 9, 2016 02:20 — forked from SpainTrain/.noserc
Relevant config files for a python GAE app using CircleCI
[nosetests]
verbosity=3
with-coverage=1
cover-branches=1
cover-xml=1
cover-xml-file=./coverage.xml
cover-min-percentage=66
with-profile=1
@gavinzhou
gavinzhou / bash.generate.random.alphanumeric.string.sh
Created October 18, 2016 01:45 — forked from earthgecko/bash.generate.random.alphanumeric.string.sh
shell/bash generate random alphanumeric string
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1
@gavinzhou
gavinzhou / influxdb.conf
Created September 20, 2016 04:51 — forked from acherunilam/influxdb.conf
Nginx config for InfluxDB HA
http {
client_max_body_size 20M;
upstream influxdb {
server server1:8086;
server server2:8086;
}
upstream relay {
server server1:9096;
server server2:9096;
@gavinzhou
gavinzhou / README.md
Created September 15, 2016 04:58 — forked from rowanmanning/README.md
Writing a Friendly README. This a companion-gist to the post: http://rowanmanning.com/posts/writing-a-friendly-readme/

some tools for diagrams in software documentation

Diagrams For Documentation

Obvious Choices

ASCII

@gavinzhou
gavinzhou / influxdb2json
Last active August 24, 2016 07:10
backup influxdb to json
#!/bin/bash
function parse_options {
function usage() {
echo -e >&2 "Usage: $0 dump DATABASE [options...]
\t-u USERNAME\t(default: root)
\t-p PASSWORD\t(default: root)
\t-h HOST\t\t(default: localhost:8086)
\t-s\t\t(use HTTPS)"
}