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
FROM mcr.microsoft.com/devcontainers/python:1-3.8-bullseye | |
ARG DEBIAN_FRONTEND=noninteractive | |
ARG USER=vscode | |
RUN sed -i "s|http://deb.debian.org/debian|http://mirror.sjtu.edu.cn/debian|g" /etc/apt/sources.list | |
USER $USER | |
ARG HOME="/home/$USER" | |
ENV PATH="${HOME}/.local/bin:$PATH" |
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
Windows Registry Editor Version 5.00 | |
[HKEY_CURRENT_USER\Software\Microsoft\InputMethod\Settings\CHS] | |
"LangBar Force On"=dword:00000000 | |
"Enable Double Pinyin"=dword:00000001 | |
"EmoticonTipTriggerCount"=dword:00000001 | |
"HapLastDownloadTime"=hex(b):eb,69,29,59,00,00,00,00 | |
"UserDefinedDoublePinyinScheme0"="小鹤双拼*2*^*iuvdjhcwfg xmlnpbksqszxkrltvyovt" | |
"DoublePinyinScheme"=dword:0000000a | |
"UDLLastUpdatedTime"="2019-05-08 09:30:00" | |
"UDLCount"=dword:0000018b |
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
from django.db import migrations, models | |
import django.db.models.manager | |
def delete_all(apps, schema_editor): | |
'''删除所有的老旧poc''' | |
Poc = apps.get_model("vuln_scan", "Poc") | |
# 此处使用 hard_delete_objects 的原因参见 https://stackoverflow.com/a/69767087/16654916 | |
# 因 safedelete 的 Manager 均未设置 use_in_migrations = True,故不可用 | |
Poc.hard_delete_objects.all().delete() |
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
compose_names=`docker compose ls | awk '(NR>1) && (/^[a-f0-9]{32}\s+/) {print($1)}'` | |
for name in ${compose_names[@]}; do | |
cids=`docker ps --filter "label=com.docker.compose.project=${name}" --format '{{.ID}}'` | |
for cid in ${cids[@]}; do | |
docker rm -f -v "$cid" | |
done | |
done |
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 ( | |
"time" | |
lokihook "github.com/akkuman/logrus-loki-hook" | |
"github.com/sirupsen/logrus" | |
) | |
var log = logrus.New() |
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
-- @desc: The fastest, type-agnostic way to copy a Redis key | |
-- @usage: redis-cli --eval copy_key.lua <source> <dest> , [NX] | |
local s = KEYS[1] | |
local d = KEYS[2] | |
if redis.call("EXISTS", d) == 1 then | |
if type(ARGV[1]) == "string" and ARGV[1]:upper() == "NX" then | |
return nil | |
else |
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
<!DOCTYPE html> <html><!-- | |
Page saved with SingleFile | |
url: http://127.0.0.1:8000/ | |
saved date: Thu Apr 14 2022 09:44:16 GMT+0800 (中国标准时间) | |
--><meta charset=utf-8> | |
<meta http-equiv=X-UA-Compatible content="IE=edge"> | |
<meta name=format-detection content="telephone=no"> | |
<title>系统维护中</title> | |
<style>:root{--sf-img-0: url("data:text/html;base64,PCFET0NUWVBFIEhUTUwgUFVCTElDICItLy9XM0MvL0RURCBIVE1MIDQuMDEvL0VOIgogICAgICAgICJodHRwOi8vd3d3LnczLm9yZy9UUi9odG1sNC9zdHJpY3QuZHRkIj4KPGh0bWw+CiAgICA8aGVhZD4KICAgICAgICA8bWV0YSBodHRwLWVxdWl2PSJDb250ZW50LVR5cGUiIGNvbnRlbnQ9InRleHQvaHRtbDtjaGFyc2V0PXV0Zi04Ij4KICAgICAgICA8dGl0bGU+RXJyb3IgcmVzcG9uc2U8L3RpdGxlPgogICAgPC9oZWFkPgogICAgPGJvZHk+CiAgICAgICAgPGgxPkVycm9yIHJlc3BvbnNlPC9oMT4KICAgICAgICA8cD5FcnJvciBjb2RlOiA0MDQ8L3A+CiAgICAgICAgPHA+TWVzc2FnZTogRmlsZSBub3QgZm91bmQuPC9wPgogICAgICAgIDxwPkVycm9yIGNvZGUgZXhwbGFuYXRpb246IEhUVFBTdGF0dXMuTk9UX0ZPVU5EIC0gTm90aGluZyBtYXRjaGVzIHRoZSBnaXZlbiBVUkkuPC9wPgogICAgPC9ib2R5Pgo8L2h0bWw+Cg==");--sf-img-1: url("data:text/html;base64,PCFET0NUWVB |
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
21,22,23,25,80,81,82,83,84,85,86,87,88,89,90,91,92,98,99,110,135,139,143,161,389,443,445,512,513,514,800,801,808,873,880,888,889,1000,1010,1080,1081,1082,1090,1099,1118,1352,1433,1521,1888,2008,2020,2049,2100,2181,2222,2375,2379,2601,3000,3008,3128,3306,3389,3505,4100,4440,4848,4899,5000,5422,5432,5555,5632,5900,6080,6379,6648,6868,7000,7001,7002,7003,7004,7005,7007,7008,7070,7071,7074,7078,7080,7088,7200,7680,7687,7688,7777,7890,8000,8001,8002,8003,8004,8006,8008,8009,8010,8011,8012,8016,8018,8020,8028,8030,8038,8042,8044,8046,8048,8053,8060,8069,8070,8080,8081,8082,8083,8084,8085,8086,8087,8088,8089,8090,8091,8092,8093,8094,8095,8096,8097,8098,8099,8100,8101,8108,8118,8161,8172,8180,8181,8200,8222,8244,8258,8280,8288,8300,8360,8443,8448,8484,8649,8800,8834,8838,8848,8858,8868,8879,8880,8881,8888,8899,8980,8983,8989,9000,9001,9002,9008,9010,9043,9060,9080,9081,9082,9083,9084,9085,9086,9087,9088,9089,9090,9091,9092,9093,9094,9095,9096,9097,9098,9099,9100,9200,9300,9443,9448,9800,9981,9986,9988,9998,9999,10000 |
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
name: build | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
build-rotateproxy: | |
runs-on: ubuntu-18.04 |
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
from pydantic import BaseModel, validator | |
class MyBaseModel(BaseModel): | |
@validator('*', pre=True) | |
def fill_values(cls, v, **kwargs): | |
# 对于一些字段,如果没有加 Optional 则会无法传递 null 值,就算设置了默认值也会校验失败 | |
# 此校验函数用来处理这部分字段,如果传递的值为假,且设置了默认值,则返回默认值 | |
# 注意,如果业务需求必须接收假值(比如空字符串),请不要使用此基类 | |
field_name = kwargs['field'].name |