This file contains hidden or 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/bash | |
set -ex | |
apt-get update | |
apt-get install \ | |
ca-certificates \ | |
curl \ | |
gnupg | |
mkdir -m 0755 -p /etc/apt/keyrings |
This file contains hidden or 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
docker run -d --name etcd-server -p 2379:2379 -p 2380:2380 quay.io/coreos/etcd:v3.5.0 etcd --advertise-client-urls http://0.0.0.0:2379 --listen-client-urls http://0.0.0.0:2379 | |
etcdctl --endpoints 127.0.0.1:2379 user add root | |
etcdctl --endpoints 127.0.0.1:2379 user grant-role root root | |
etcdctl --endpoints 127.0.0.1:2379 auth enable |
This file contains hidden or 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 ( | |
"log" | |
"net/http" | |
) | |
func CORS(next http.Handler) http.HandlerFunc { | |
return func(w http.ResponseWriter, r *http.Request) { | |
w.Header().Add("Access-Control-Allow-Origin", "*") |
This file contains hidden or 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
extends Sprite | |
export var speed = 400 | |
# Called when the node enters the scene tree for the first time. | |
func _ready(): | |
pass | |
# Called every frame. 'delta' is the elapsed time since the previous frame. |
This file contains hidden or 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
import fs from 'fs' | |
export default defineConfig({ | |
... | |
server: { | |
https: { | |
key: fs.readFileSync('server.key'), | |
cert: fs.readFileSync('server.cert'), | |
}, | |
port: 443, |
This file contains hidden or 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 { | |
listen 443 ssl; | |
server_name _; | |
ssl_certificate cert.pem; | |
ssl_certificate_key cert.key; | |
location / { | |
proxy_pass http://xxxxxx; | |
proxy_set_header Host $host; |
This file contains hidden or 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 corsMiddleware() gin.HandlerFunc { | |
return func(c *gin.Context) { | |
method := c.Request.Method | |
origin := c.Request.Header.Get("Origin") //请求头部 | |
if origin != "" { | |
c.Header("Access-Control-Allow-Origin", origin) | |
c.Header("Access-Control-Allow-Methods", "POST, GET, OPTIONS, PUT, DELETE") | |
c.Header("Access-Control-Allow-Headers", "Origin, X-Requested-With, X-Extra-Header, Content-Type, Accept, Authorization") | |
c.Header("Access-Control-Expose-Headers", "Content-Length, Access-Control-Allow-Origin, Access-Control-Allow-Headers, Cache-Control, Content-Language, Content-Type") | |
c.Header("Access-Control-Allow-Credentials", "true") |
This file contains hidden or 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 ( | |
"fmt" | |
"strconv" | |
"strings" | |
) | |
type Node struct { | |
Value int |
This file contains hidden or 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 | |
git config http.proxy http://127.0.0.1:8899 | |
http_proxy=127.0.0.1:8899 go get $@ | |
git config --unset http.proxy |
This file contains hidden or 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 | |
# | |
# echo utils | |
# | |
echo_prefix="" | |
set_echo_prefix(){ | |
echo_prefix=$1 |
NewerOlder