Skip to content

Instantly share code, notes, and snippets.

proxy_cache_path /path/to/cache levels=1:2 keys_zone=my_cache:10m max_size=10g
inactive=60m use_temp_path=off;
server {
# ...
location / {
proxy_cache my_cache;
proxy_pass http://my_upstream;
}
}
@wzhliang
wzhliang / nginx_fallback
Created May 4, 2020 03:05
nginx fallback example
server {
location / {
proxy_pass http://new_server;
error_page 404 500 502 503 504 = @fallback;
}
location @fallback {
proxy_pass http://old_server;
}
}
@wzhliang
wzhliang / gist:2942fcd9311fdfbe88655caeed2425f5
Last active March 18, 2020 02:53
trivy scan python alpine result
+---------+------------------+----------+-------------------+---------------+--------------------------------+
| LIBRARY | VULNERABILITY ID | SEVERITY | INSTALLED VERSION | FIXED VERSION | TITLE |
+---------+------------------+----------+-------------------+---------------+--------------------------------+
| bzip2 | CVE-2019-12900 | HIGH | 1.0.6-r6 | 1.0.6-r7 | bzip2: out-of-bounds write in |
| | | | | | function BZ2_decompress |
+---------+------------------+ +-------------------+---------------+--------------------------------+
| expat | CVE-2018-20843 | | 2.2.6-r0 | 2.2.7-r0 | expat: large number of colons |
| | | | | | in input makes parser consume |
| | | | | | high amount... |
+ +--------------
+---------+------------------+----------+-------------------+---------------+--------------------------------+
| LIBRARY | VULNERABILITY ID | SEVERITY | INSTALLED VERSION | FIXED VERSION | TITLE |
+---------+------------------+----------+-------------------+---------------+--------------------------------+
| bzip2 | CVE-2019-12900 | HIGH | 1.0.6-r6 | 1.0.6-r7 | bzip2: out-of-bounds write in |
| | | | | | function BZ2_decompress |
+---------+------------------+ +-------------------+---------------+--------------------------------+
| expat | CVE-2018-20843 | | 2.2.6-r0 | 2.2.7-r0 | expat: large number of colons |
| | | | | | in input makes parser consume |
| | | | | | high amount... |
+ +--------------
@wzhliang
wzhliang / README.md
Created February 22, 2020 01:12
testing ruby based gist
description
A Kubernetes operator for the rqlite database.

rqlite-operator

Getting Started

You can install the rqlite-operator as follows:

description
A Kubernetes operator for the rqlite database.

rqlite-operator

Getting Started

You can install the rqlite-operator as follows:

@wzhliang
wzhliang / default.md
Last active December 5, 2019 02:46
dotnet wcfservice docker run fail on MacOS

$ docker run mcr.microsoft.com/dotnet/framework/samples:wcfservice

Unable to find image 'mcr.microsoft.com/dotnet/framework/samples:wcfservice' locally wcfservice: Pulling from dotnet/framework/samples docker: no matching manifest for linux/amd64 in the manifest list entries. See 'docker run --help'.

#!/bin/bash
# This script takes a remote repository and merges it into
# the current one as a subdirectory
set -e
if [ -z "$1" ]
then
echo "Usage:"
@wzhliang
wzhliang / k8s-ipvs-cli.txt
Created May 13, 2019 01:49
kubernetes kube-proxy IPVS CLI illustration
# kubectl describe svc nginx-service
Name: nginx-service
...
Type: ClusterIP
IP: 10.102.128.4
Port: http 3080/TCP
Endpoints: 10.244.0.235:8080,10.244.1.237:8080
Session Affinity: None
# ip addr
@wzhliang
wzhliang / ansible_dir_layout.txt
Created January 28, 2019 14:58
Ansible directory layout
production # inventory file for production servers
staging # inventory file for staging environment
group_vars/
group1.yml # here we assign variables to particular groups
group2.yml
host_vars/
hostname1.yml # here we assign variables to particular systems
hostname2.yml