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 http = require('http') | |
const port = 3000; | |
const server = http.createServer((req, res) => { | |
res.writeHead(200); | |
res.write('OK'); | |
res.end(); | |
}); | |
// 如果超时3秒,就触发 timeout event |
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
// 云函数代码 | |
// querycloud/ | |
const request = require('request'); | |
exports.main = async (event, context) => { | |
return new Promise((resolve, reject) => { | |
request(event, (err, res, body) => { | |
if (err) return reject(err); | |
resolve(body); |
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 request = require('request'); | |
const rp = require('request-promise'); | |
const j = rp.jar(); | |
const cookie = rp.cookie(` | |
YOUR_V2EX_COOKIE | |
`.trim()); | |
const url = "https://v2ex.com"; | |
j.setCookie(cookie, url); |
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
server=/cn/114.114.114.114 |
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
// 返回的接口结构 如下: | |
// 游戏Id不存在 | |
const idDoNotExist = | |
{ | |
error: 1, | |
msg: '游戏Id不存在' | |
} | |
// 游戏Id存在 |
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
server { | |
server_name default_server; | |
# This is for Let's Encrypt certification renewal | |
include /etc/nginx/snippets/letsencrypt.conf; | |
# Redirect to https | |
location / { | |
return 301 https://$server_name$request_uri; | |
} | |
} |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# All Vagrant configuration is done below. The "2" in Vagrant.configure | |
# configures the configuration version (we support older styles for | |
# backwards compatibility). Please don't change it unless you know what | |
# you're doing. | |
Vagrant.configure("2") do |config| | |
# The most common configuration options are documented and commented below. | |
# For a complete reference, please see the online documentation at |
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 request = require('request'); | |
const SocksProxyAgent = require('socks-proxy-agent'); | |
const proxy = 'socks5://127.0.0.1:1086'; | |
const agent = new SocksProxyAgent(proxy) | |
request({ | |
method: 'get', | |
url: 'https://ipinfo.io', | |
headers: { |
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
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. | |
; #Warn ; Enable warnings to assist with detecting common errors. | |
SendMode Input ; Recommended for new scripts due to its superior speed and reliability. | |
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. | |
#MaxThreadsPerHotkey 255 | |
toggle := 0 | |
F1:: | |
toggle := !toggle |
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
# https://github.com/fivesheep/chnroutes | |
# 下载分配给国内运营商的 IP 段 | |
# curl 'http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest' | grep ipv4 | grep CN | awk -F\| '{ printf("%s/%d\n", $4, 32-log($5)/log(2)) }' > chnroute.txt | |
# 输出所有ip段 | |
# curl http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest | grep 'apnic|CN|ipv4' | awk -F\| '{ printf("-A SHADOWSOCKS -d %s/%d -j RETURN\n", $4, 32-log($5)/log(2)) }' > cn_rules.conf | |
# 输出如下: | |
-A SHADOWSOCKS -d 1.0.1.0/24 -j RETURN |
NewerOlder