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
#!/bin/sh | |
apt update && apt install -y curl sudo dnsutils ufw | |
adduser --gecos "" --disabled-password cloverstd | |
usermod -aG sudo cloverstd | |
echo "cloverstd ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/90-cloverstd | |
runuser -u cloverstd -- bash -c "mkdir -p ~/.ssh && curl https://github.com/cloverstd.keys | tee -a ~/.ssh/authorized_keys && chmod 0600 ~/.ssh/authorized_keys && chmod 0700 ~/.ssh" | |
sed -i '/PermitRootLogin/d' /etc/ssh/sshd_config | |
sed -i '/PasswordAuthentication/d' /etc/ssh/sshd_config | |
echo "PasswordAuthentication no" >> /etc/ssh/sshd_config |
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
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDI+CFCrtFoUCO5StL3hFD5nyvPNutLmkazMEHC43nLQfj+ZtsOHJUyhj5TSsFHogoi3XdTi1MexFk5zPfwgRnXvWAYRlhqiG0fx7zKaqy/1RI2t/+JWcOGhEy91s2t8gHOj2Tub/vAzKWvgJRzhTjDlZ+LumkpuWL3tIHXcd9X2R16JQ92PpkTwgSefpcogOObiQbuYVTpjq9WCCjKktxR7G/BxfeoOjQbDjzhEkqI96Bsl73cMPn9VyLazZVXacLF0C7KZ19GWSER0+3d3KYOFSUdS22OfnirwVwaoFnDvCX7bBStzVdpT4q2M/6uSTRpp5JjL69hiXwFemjksWOT [email protected] |
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
--[[ | |
function print_metric(metric, labels, value) | |
local label_string = "" | |
if labels then | |
for label,value in pairs(labels) do | |
label_string = label_string .. label .. '="' .. value .. '",' | |
end | |
label_string = "{" .. string.sub(label_string, 1, -2) .. "}" | |
end | |
io.write(string.format("%s%s %s", metric, label_string, value)) |
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
<script> | |
/** | |
* [js-sha3]{@link https://github.com/emn178/js-sha3} | |
* | |
* @version 0.8.0 | |
* @author Chen, Yi-Cyuan [[email protected]] | |
* @copyright Chen, Yi-Cyuan 2015-2018 | |
* @license MIT | |
*/ |
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
package main | |
import ( | |
"archive/tar" | |
"bytes" | |
"compress/gzip" | |
"crypto/sha1" | |
"crypto/sha512" | |
"encoding/base64" | |
"encoding/hex" |
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
ssh-keygen -f id_rsa -m pem -p |
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
local origin_pattern = [=[(\.hui\.lu|\.cloverstd\.com)(:\d+)?$]=] | |
local headers = ngx.req.get_headers() | |
ngx.header['Access-Control-Max-Age'] = '3600' | |
ngx.header['Access-Control-Allow-Credentials'] = 'true' | |
local origin = headers['Origin'] | |
if origin then | |
local m, err = ngx.re.match(origin, origin_pattern, "jo") | |
if m then |
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
func main() { | |
var i interface{} = 100 | |
/** | |
type eface struct { | |
_type *_type | |
data unsafe.Pointer | |
} | |
*/ | |
n := *(*int)(*(*unsafe.Pointer)(unsafe.Pointer(uintptr(unsafe.Pointer(&i)) + unsafe.Alignof(i)))) | |
fmt.Println(n) |
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
mixed-port: 17890 | |
redir-port: 17892 | |
allow-lan: true | |
mode: rule | |
log-level: info |
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
function getParams() { | |
const pairs = window.location.hash.substr(1).split('::'); | |
if (!pairs) { | |
throw new Error('取不到参数'); | |
} | |
return { | |
sndId: pairs[1].split('=')[1], | |
sndMagic: pairs[2].split('=')[1] | |
}; | |
} |
NewerOlder