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
# 1. certbot 更新证书 | |
# 2. 上传证书到七牛云 | |
# 3. 部署证书到域名 | |
import os.path | |
import subprocess | |
import qiniu # pip install qiniu | |
from qiniu import DomainManager | |
domain = 'dyxzs.cn' |
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
/*使用golang实现一个函数,功能是生成一串6位数的随机数字字符串*/ | |
package main | |
import ( | |
"fmt" | |
"math/rand" | |
"time" | |
) | |
var digits = []rune("0123456789") |
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
type IPMatcher struct { | |
IP net.IP | |
SubNet *net.IPNet | |
} | |
type IPMatchers []*IPMatcher | |
func NewIPMatcher(ipStr string) (*IPMatcher, error) { | |
ip, subNet, err := net.ParseCIDR(ipStr) | |
if err != nil { |
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
/** | |
* Converts an RGB color value to HSL. Conversion formula | |
* adapted from http://en.wikipedia.org/wiki/HSL_color_space. | |
* Assumes r, g, and b are contained in the set [0, 255] and | |
* returns h, s, and l in the set [0, 1]. | |
* | |
* @param Number r The red color value | |
* @param Number g The green color value | |
* @param Number b The blue color value | |
* @return Array The HSL representation |
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
const Server = require('./ihttp').Server; | |
const app = new Server().listen(3000); |