Skip to content

Instantly share code, notes, and snippets.

View Ran-Xing's full-sized avatar
💭
I may be slow to respond.

星冉 Ran-Xing

💭
I may be slow to respond.
View GitHub Profile
@Ran-Xing
Ran-Xing / gen_crt.sh
Created November 1, 2021 10:02
Nginx two-way authentication
#!/bin/sh
Echo_c(){
echo "\033[1;33m\n$1\n\033[0m"
}
Rand_Name(){
openssl rand -base64 8 | md5sum | cut -c1-8
}
@Ran-Xing
Ran-Xing / Build With Docker Push.yml
Created October 30, 2021 06:06
Build With Docker Push
name: Build With Docker Push
on:
watch:
types: [started]
jobs:
Build_With_Docker_Push:
name: AWVS14 Docker Build
runs-on: ubuntu-latest
steps:
@Ran-Xing
Ran-Xing / Delete old workflow runs.yml
Created October 30, 2021 06:00
Delete old workflow runs
name: Delete old workflow runs
on:
schedule:
- cron: '0 0 * * MON'
workflow_dispatch:
inputs:
days:
description: 'Number of days.'
required: true
default: "20"
@Ran-Xing
Ran-Xing / delete-older-releases
Created October 30, 2021 06:00
delete-older-releases
- uses: dev-drprasad/delete-older-releases@v0.2.0
with:
repo: User/repo
keep_latest: 3
delete_tag_pattern: ""
env:
GITHUB_TOKEN: ${{ secrets.TOKEN_GITHUB }}
@Ran-Xing
Ran-Xing / Timestamp_Releases_Action.yml
Created October 30, 2021 05:59
Timestamp Releases Action
- name: Get version
id: time_now
run: echo "::set-output name=dir::$(date +%Y_%m_%d)"
-
name: release
uses: softprops/action-gh-release@v1
with:
files: "App/**"
body: "README"
tag_name: ${{ steps.time_now.outputs.dir }}
@Ran-Xing
Ran-Xing / Check_linux_info.sh
Created November 18, 2021 02:40
Check linux info
#!/bin/bash
# =================基本配置=================
NETWORK_CARD='eth2'
# =================基本配置=================
# 将屏幕输出的文件,同时保存在文档中
# 用到知识点:文件描述符与重定向,管道
logfile=checkSystemConfig.log
fifofile=checkSystemConfig.fifo
@Ran-Xing
Ran-Xing / openssl.cnf
Created November 19, 2021 19:03
ssl_tools
[ ca ]
default_ca = CA_default
[ CA_default ]
default_md = sha256
[ v3_ca ]
subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid:always,issuer
basicConstraints = critical,CA:true
[ req ]
distinguished_name = req_distinguished_name
@Ran-Xing
Ran-Xing / docker_backup.sh
Created December 20, 2021 07:24
Docker Backup
#!/bin/env bash
set -ex
Docker_backup(){
backup_data=$1-$(date +%Y-%m-%d-%H:%M:%S)
echo -e "\n###### Docker Stop $1 ######\n" >> $Logs_path/$backup_data.log
docker stop $1 >> $Logs_path/$backup_data.log
backup_num=$(ls -l $Backup_path/$1* | wc -l)
echo -e "\n###### $1 Backup ######\n" >> $Logs_path/$backup_data.log
zip -r $Backup_path/$backup_data.zip /docker/$2/ >> $Logs_path/$backup_data.log
@Ran-Xing
Ran-Xing / back.py
Created January 8, 2022 14:07
Nackup mac app
#!/usr/bin/env python3
import sys, shutil, os
SYSTEMDISK = "MacintoshHD-DATA"
NEWPATH = sys.argv[1]
OLDPATH = "/Volumes/" + SYSTEMDISK + NEWPATH
def getinfo():
print("@1: PWD: " + os.path.dirname(NEWPATH))
@Ran-Xing
Ran-Xing / ssh_proxy.sh
Last active January 15, 2022 08:22
SSH Proxy
#!/usr/bin/env sh
clear
echo "#########################\n\nWorking on the WIZ tunnel\n"
if [ "$(ps -e | grep "0.0.0.0:9999" | grep -v "grep" | cut -d " " -f 1)" == "" ]; then
ssh -C -T -N -L 0.0.0.0:9999:10.0.4.6:80 wiz@bit &
else
kill $(ps -e | grep "0.0.0.0:9999" | grep -v "grep" | cut -d " " -f 1)
ssh -C -T -N -L 0.0.0.0:9999:10.0.4.6:80 wiz@bit &