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 | |
set -e | |
DOMAIN_KEY="example.cn" | |
# 1. Request cert by acme.sh | |
# Copy cert and key files to acme_target directory after issued. | |
TARGET_PREFIX=$(date +%Y%m%d) |
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 | |
# Directory structure | |
# ─ /etc/pki/nginx | |
# ├─ 20231204_3m | |
# │ └─ example.com | |
# │ ├─ chain | |
# │ └─ key | |
# ├─ example.com.cer --> 20231204_3m/example.com/chain | |
# └─ private |
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.1' | |
services: | |
zookeeper: | |
image: zookeeper:3.8.4-jre-17 | |
restart: always | |
hostname: zoo1 | |
ports: | |
- 2181:2181 | |
deploy: | |
resources: |
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 | |
rsync -avzh --progress --stats some_file_dir/ demo@127.0.0.1:/data/some_file_dir/ |
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 | |
ACTION=$1 | |
TOMCAT_HOME=$2 | |
STARTUP_SH="startup.sh" | |
STOP_SH="shutdown.sh" | |
PORTER=$(which tomcat-porter 2>/dev/null) | |
HEALTH_HTTP_CODE=(200 404 403 405) | |
APP_START_TIMEOUT=30 | |
[ -z "$ACTION" ] && echo "ERROR: Not found argument 1" && exit 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
export RUSTUP_DIST_SERVER=https://mirrors.ustc.edu.cn/rust-static | |
cargo build --release |
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 | |
[ -z "$1" ] && echo "Please provide a password" && exit 1 | |
[ "${#1}" -lt 8 ] && echo "Password length must greater then 8" && exit 2 | |
ADD_USER="<Please replace here>" | |
echo "Adding user $ADD_USER" | |
useradd $ADD_USER | |
echo "Succeed add user $ADD_USER" | |
echo -e "$1\n$1\n" | passwd --stdin $ADD_USER | |
echo "Changed $ADD_USER password" |
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 | |
[ -z "$1" ] && echo "Please provide DEV" && exit 1 | |
[ -z "$2" ] && echo "Please provide MTN" && exit 2 | |
DEV=$1 | |
MNT=$2 | |
PAR="${DEV}1" | |
printf """Partition~ | |
Will: | |
Init disk: \"$DEV\" | |
Create partition: \"$PAR\" |
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 | |
cd /usr/local/nginx/logs | |
PID=$(cat nginx.pid) | |
DATE=$(date +%Y%m%d) | |
LOG="access.log" | |
FILE="$LOG.$DATE" | |
GZ="${FILE}.gz" | |
echo "Working in $(pwd), PID: $PID" | |
[ -f $GZ ] && echo "\"$GZ\" already exists, skip." && exit 1 | |
mv $LOG $FILE |
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
$env:JAVA_OPTS = "-Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=7890" | |
.\gradlew.bat |
NewerOlder