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 function set_cross_domain_name() | |
local domain = "xxx.com" -- replace this | |
local domain_reg = string.format(".*%s",domain) | |
local schema = ngx.var.scheme -- get schema | |
local server_name = ngx.var.server_name -- get request header server name | |
local origin_name = ngx.req.get_headers()['Origin'] -- get request header Origin value | |
local m_server,err = ngx.re.match(server_name,domain_reg,"iu") -- match domain value from request server name | |
if origin_name then | |
local m_origin,err = ngx.re.match(origin_name,domain_reg,"iu") -- match domain value from request Origin | |
if m_origin 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
import base64 | |
import hmac | |
import time | |
from hashlib import sha1 | |
from urllib.parse import quote | |
import random | |
class Sign(object): | |
FORMAT_ISO_8601 = "%Y-%m-%dT%H:%M:%SZ" |
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
import requests | |
import redis | |
import json | |
from bs4 import BeautifulSoup | |
from requests import request | |
from config.config import Config | |
pool = redis.ConnectionPool(host=Config.redis_host, port=Config.redis_port, db=Config.redis_db, | |
password=Config.redis_pass) |
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/bash | |
# Falcon Agent Bash | |
# https://www.cnblogs.com/pycode/p/6721373.html | |
endpoint="$hostname" | |
timestamp=`date +%s` | |
interval=30 | |
transfer="$gateway" | |
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
{ | |
"title": "PC-Style Modifiers", | |
"rules": [ | |
{ | |
"description": "其他功能键", | |
"manipulators": [ | |
{ | |
"type": "basic", | |
"from": { | |
"key_code": "home", |
阿里云STS相关文档:https://help.aliyun.com/document_detail/28763.html?spm=a2c4g.11186623.6.804.55aa3289dRtm3X
请求参数中policy为临时权限,如果不填写则将会使用角色默认的所有权限,填写的规则见相关服务的STS权限规则,最下方提供一个基本的SLS服务的自定义授权规则
DurationSeconds默认时间为3600秒
脚本的使用方式为:
python3 sign.py