Click to Import
This file contains 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
#!/usr/bin/env python | |
## Dependencies: | |
# | |
# pip install qiniu | |
# | |
## Tips for Deploy certs to Qiniu: | |
# | |
# export DOMAIN=lewangdev.com | |
# export QINIU_DOMAIN=images.${DOMAIN},staticfiles.${DOMAIN} |
This file contains 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
#!/usr/bin/env python | |
"""Simple HTTP Server With Upload. | |
This module builds on BaseHTTPServer by implementing the standard GET | |
and HEAD requests in a fairly straightforward manner. | |
""" |
This file contains 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
#!/usr/bin/env python3 | |
import ipaddress | |
import sys | |
def get_cidr_ip_info(ip_net): | |
try: | |
net = ipaddress.ip_network(ip_net, strict=False) | |
print('IP版本号 | %s ' % str(net.version)) | |
print('是否是私有地址 | %s ' % str(net.is_private)) |
This file contains 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
FROM centos/s2i-base-centos7 | |
MAINTAINER Le Wang <lewang.dev@gmail.com> | |
ARG PYTHON_VERSION=3.5.10 | |
RUN yum install -y \ | |
ncurses-libs \ | |
zlib-devel \ | |
mysql-devel \ |
This file contains 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
qemu-img create -f qcow2 /var/lib/libvirt/images/base-image-centos7.qcow2 40G | |
virt-install \ | |
--virt-type kvm \ | |
--name base-image-centos7 \ | |
--vcpus 2 \ | |
--ram 4096 \ | |
--cdrom=/root/Downloads/CentOS-7-x86_64-Minimal-2003.iso \ | |
--disk /var/lib/libvirt/images/base-image-centos7.qcow2,format=qcow2 \ | |
--network bridge=br0 \ |
This file contains 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
{ | |
"Retries": 1, | |
"ServeNodes": [ | |
"dns://127.0.0.1:15353?dns=https-chain://1.1.1.1/dns-query", | |
"red://:1081" | |
], | |
"ChainNodes": [ | |
"https://user:pass@ip:port?peer=/etc/qiangguo/gost/peer.txt" | |
] |
This file contains 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
# Load | |
launchctl load -w ~/Library/LaunchAgents/gost.plist | |
# Unload | |
launchctl unload -w ~/Library/LaunchAgents/gost.plist |
This file contains 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
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |