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
// ==UserScript== | |
// @name Codeforces Data Donwloader | |
// @namespace http://tampermonkey.net/ | |
// @version 2024-05-14 | |
// @description Download Script For Codeforces | |
// @author Sempr | |
// @match https://codeforces.com/contest/*/problems | |
// @icon https://aowuucdn.oss-accelerate.aliyuncs.com/codeforces.png | |
// @grant GM_addStyle | |
// @require https://cdnjs.cloudflare.com/ajax/libs/jszip/3.7.1/jszip.min.js |
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://zhaox.github.io/nginx/2019/09/05/explain-nginx-rate-limit | |
# 20 per second, 50ms each | |
limit_req_zone $remote_user zone=user_limit:10m rate=10r/s; | |
limit_req_zone $my_id zone=one:10m rate=20r/m; | |
server { | |
listen 80; | |
listen [::]:80; | |
server_name localhost; |
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
module github.com/sempr/gin-reverse-proxy | |
go 1.18 | |
require github.com/gin-gonic/gin v1.8.1 | |
require ( | |
github.com/gin-contrib/sse v0.1.0 // indirect | |
github.com/go-playground/locales v0.14.0 // indirect | |
github.com/go-playground/universal-translator v0.18.0 // indirect |
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 | |
DING_SEC="<Your SEC Here>" | |
DING_URL="<Your Webhook Here>" | |
function hash_hmac { | |
# hash_hmac sha256 data sec -binary | |
old_lc_collate=$LC_COLLATE | |
LC_COLLATE=C | |
digest="$1" |
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 ( | |
"fmt" | |
"gorm.io/driver/sqlite" | |
"gorm.io/gorm" | |
"gorm.io/gorm/logger" | |
) |
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
version: "3.8" | |
x-superenv: | |
&default-superenv | |
environment: | |
XX: 135 | |
FOO: superenv-foo | |
command: echo $${XX} $${FOO} | |
services: |
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
dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo | |
dnf install -y https://download.docker.com/linux/centos/7/x86_64/stable/Packages/containerd.io-1.2.13-3.2.el7.x86_64.rpm | |
dnf install -y docker-ce | |
curl -o /usr/local/bin/docker-compose -L https://github.com/docker/compose/releases/download/1.26.2/docker-compose-Linux-x86_64 | |
chmod +x /usr/local/bin/docker-compose | |
systemctl enable --now docker | |
#dnf install -y git |
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 python:3.8.1-slim | |
ADD ./requirements.txt /tmp/requirements.txt | |
RUN set -xe \ | |
&& pip install -i https://mirrors.aliyun.com/pypi/simple --no-cache -r /tmp/requirements.txt | |
ADD app.py /code/app.py | |
WORKDIR /code | |
CMD ["gunicorn", "-w4", "-b0.0.0.0:8000", "app:app"] |
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 ( | |
"path" | |
"github.com/gin-gonic/gin" | |
) | |
type oauthApp struct { | |
Prefix string |
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
latestkernel=`ls -t /boot/vmlinuz-* | sed "s/\/boot\/vmlinuz-//g" | head -n1` | |
echo $latestkernel | |
kexec -l /boot/vmlinuz-${latestkernel} --initrd=/boot/initramfs-${latestkernel}.img --append="`cat /proc/cmdline`" | |
kexec -e | |
# 备注,其实和重启没啥两样, uptime也会清零重算,唯一的好处就是比重启要快一点点 | |
# remove old kernels on centos 8 | |
dnf remove --oldinstallonly --setopt installonly_limit=1 kernel |
NewerOlder