Skip to content

Instantly share code, notes, and snippets.

View wgzhao's full-sized avatar

wgzhao wgzhao

  • China
View GitHub Profile
@wgzhao
wgzhao / shadowrocket.conf
Last active September 24, 2023 08:43
shadowrocket configuration file
# Shadowrocket: 2020-12-13 10:10:56
[General]
bypass-system = true
skip-proxy = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12, localhost, *.local, e.crashlytics.com, captive.apple.com
bypass-tun = 10.0.0.0/8,100.64.0.0/10,127.0.0.0/8,169.254.0.0/16,172.16.0.0/12,192.0.0.0/24,192.0.2.0/24,192.88.99.0/24,192.168.0.0/16,198.18.0.0/15,198.51.100.0/24,203.0.113.0/24,224.0.0.0/4,255.255.255.255/32
#dns-server = 119.29.29.29,114.114.114.114,223.5.5.5,8.8.8.8
ipv6 = false
[Rule]
DOMAIN-SUFFIX,rfi.fr,PROXY
@wgzhao
wgzhao / k8s-event-seq-complicate.md
Last active March 20, 2023 11:32
diagram collections
sequenceDiagram
    participant User
    participant ApiServer
    participant Etcd
    participant ControllerManager
    participant ReplicaSetController
    participant Scheduler
    participant Kubelet
    participant Docker
@wgzhao
wgzhao / heredoc-argoff-2.sh
Created December 29, 2011 14:36
shell here document usage sample
#!/bin/bash
# generate-script.sh
# Based on an idea by Albert Reiner.
OUTFILE=generated.sh # Name of the file to generate.
# -----------------------------------------------------------
# 'Here document containing the body of the generated script.
(
@wgzhao
wgzhao / mkdocs-release.yaml
Created October 29, 2021 05:55
MkDocs action setup
name: mkdoc-release
on:
push:
tags:
- '*'
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
@echo off
pushd "%~dp0"
dir /b %SystemRoot%\servicing\Packages\Microsoft-Windows-GroupPolicy-ClientExtensions-Package~3*.mum >List.txt
dir /b %SystemRoot%\servicing\Packages\Microsoft-Windows-GroupPolicy-ClientTools-Package~3*.mum >>List.txt
@wgzhao
wgzhao / config_git_use_proxy.md
Created May 18, 2021 01:16
Configure Git to use a proxy

Configure Git to use a proxy

In Brief

You may need to configure a proxy server if you're having trouble cloning or fetching from a remote repository or getting an error like unable to access '...' Couldn't resolve host '...'.

Consider something like:

222.211.64.122 se.itunes.apple.com
222.211.64.122 su.itunes.apple.com
222.211.64.122 upp.itunes.apple.com
222.211.64.122 play.itunes.apple.com
222.211.64.122 client-api.itunes.apple.com
# API-2-ChinaCache [ChinaNet] (Avg RTT: 15.339ms)
125.65.247.14 itunes.apple.com
125.65.247.14 init.itunes.apple.com
# API-HK-Akamai-1 [HongKong0] (Avg RTT: 52.706ms)
184.87.97.50 search.itunes.apple.com
@wgzhao
wgzhao / extract_from_jks.sh
Created December 12, 2018 00:28
Extract private and public key from Java KeyStore file (JKS)
JKS=mykeystore
JKS_PASS=changeit
JKS_ALIAS=tomcat
OUTPASS=$(cat /dev/urandom |env LC_CTYPE=C tr -dc 'a-zA-Z0-9' | fold -w 8 |head -n1)
PK12_KEY=mykeystore.pk12
PEM=server.pem
KEY=server.key
keytool -importkeystore -srckeystore $JKS -destkeystore $PK12_KEY -srcstoretype JKS -deststoretype PKCS12 -srcstorepass $JKS_PASS -deststorepass $OUTPASS -srcalias $JKS_ALIAS -destalias $JKS_ALIAS -srckeypass $JKS_PASS -destkeypass $OUTPASS -noprompt
@wgzhao
wgzhao / zbc_create_screen.py
Last active November 2, 2018 18:47
Create a zabbix screen by specific item or graph
#!/usr/bin/env python
# encoding:utf8
__Author__ = 'zhaoweiguo<wgzhao@gmail.com>'
'''
create zabbix screen,specified graph name,rows x cols
script will get all hosts whose include graph name ,then write screens and screens_items table
Usage: $0 -s <screen name> -g <graph name> [ -c <cols> ] [-d ] [ -t ]
'''
from optparse import OptionParser
@wgzhao
wgzhao / xinfadi_sku_scrap.py
Created August 16, 2018 03:20
从北京新发地(xinfadi.com.cn) 获取每个类目中有典型代表的商品(SKU)的2018年历史价格,然后验证是否出于上涨趋势
from bs4 import BeautifulSoup as bs
import pandas as pd
import numpy as np
import requests
from urllib.parse import quote
"""
从北京新发地(xinfadi.com.cn) 获取每个类目中有典型代表的商品(SKU)的2018年历史价格,然后验证是否出于上涨趋势
"""
# 索引与品类的映射关系