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
#!/usr/bin/env bash | |
apt install -qq \ | |
fonts-droid-fallback \ | |
ttf-wqy-zenhei \ | |
ttf-wqy-microhei \ | |
fonts-arphic-ukai \ | |
fonts-arphic-uming \ | |
language-pack-zh-hans \ | |
sudo fc-cache -f -v |
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
#!/usr/bin/env bash | |
clear | |
printf "\n%s\n\n" "-----------------------" | |
echo "CPU: $(grep -c processor /proc/cpuinfo) 核心" | |
echo "内存: $(($(free | grep Mem | cut -d " " -f 9) / 1024 / 1024)) G" | |
echo "网络: $(curl -s cip.cc | grep "数据二" | cut -d " " -f 2)" | |
echo "磁盘: $(lsblk -f | grep ext4 | cut -d " " -f 14 | tr -s "\n" " ")" | |
printf "\n%s\n\n" "-----------------------" |
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
#!/usr/bin/env bash | |
if echo "$1" | tr -d " " | grep -E "^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$" > /dev/null; then | |
IP="$(echo "$1" | tr -d " " | grep -E "^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$")" | |
VALID_CHECK=$(echo "$IP"|awk -F. '$1<=255&&$2<=255&&$3<=255&&$4<=255{print "yes"}') | |
if [ "${VALID_CHECK:-no}" == "yes" ]; then | |
echo "IP [$IP] available." | |
else | |
echo "IP [$IP] not available!" | |
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
#!/usr/bin/env python3 | |
# -*- coding: UTF-8 -* | |
import requests | |
import xlwt | |
import datetime | |
import base64 | |
def banner(): |
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
#!/usr/bin/env python3 | |
# -*- coding: UTF-8 -*- | |
import json | |
import os | |
import socket | |
def server_init(): | |
HOST, PORT = '0.0.0.0', 9999 |
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
#!/usr/bin/env bash | |
set -ex | |
# clean history | |
history -c | |
rm -f ~/.bash_history ~/.zsh_history ~/.sh_history ~/.ash_history | |
# clean login history | |
rm -f /var/run/utmp /var/log/wtmp /var/log/lastlog /var/log/btmp /var/log/auth.log /var/log/secure /var/log/maillog /var/log/message /var/log/cron /var/log/spooler /var/log/boot.log |
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
#!/usr/bin/env sh | |
set -ex | |
WHITELIST_FILE="$( | |
cd "$(dirname "$0")" || exit | |
pwd | |
)/.whitelist.txt" | |
read line | |
WHITELIST_COMMAND="$(echo "$line" | sed -e 's/":/\n/g' | grep alert | cut -d '"' -f 2)" | |
WHITELIST_ARGUMENT="$(echo "$line" | sed -e 's/":/\n/g' | grep alert | cut -d '"' -f 4)" |
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
[Unit] | |
Description=iptables fwknopd ssh | |
After=fwknop-server.service | |
[Service] | |
Type=oneshot | |
RemainAfterExit=yes | |
ExecStart=/docker/init/iptable_fwknopd.sh | |
PrivateTmp=True |
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
#!/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)) |
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
#!/usr/bin/env sh | |
##### INIT ##### | |
set -ex | |
active_response_path=$( | |
cd "$(dirname "$0")" | |
pwd | |
) | |
read line |