This file contains hidden or 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 | |
# Color output functions | |
info() { echo -e "\033[1;34m$1\033[0m"; } | |
success() { echo -e "\033[1;32m$1\033[0m"; } | |
error() { echo -e "\033[1;31m$1\033[0m"; exit 1; } | |
# -------------------------- | |
# Detect nvm installation (optimized for oh-my-zsh) |
This file contains hidden or 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 # Exit immediately if any command fails | |
# 1. Update system package index | |
echo "=== Updating system package index ===" | |
sudo apt-get update -y | |
# 2. Install basic compilation tools and dependencies (via system repositories) | |
echo -e "\n=== Installing basic compilation tools ===" | |
sudo apt install -y build-essential clang llvm libc6-dev linux-libc-dev git |
This file contains hidden or 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 | |
# Purpose: Send port knocking sequences to open/close SSH access (with pre-checks) | |
# Usage: ./knock_ssh_client.sh <server_ip> <action> | |
# Actions: "open" (allow SSH), "close" (block SSH after use) | |
# Match these with the server's OPEN_PORTS and CLOSE_PORTS | |
OPEN_SEQ="10001 10002 10003" | |
CLOSE_SEQ="10003 10002 10001" | |
# Check arguments |
This file contains hidden or 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 | |
# Ensure the script is executed with root privileges | |
if [ "$(id -u)" -ne 0 ]; then | |
echo "Error: Please run with root privileges (sudo $0)" >&2 | |
exit 1 | |
fi | |
# Configuration variables | |
IP_FILE="ips.txt" |
This file contains hidden or 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 | |
# Check if running as root | |
if [ "$(id -u)" -ne 0 ]; then | |
echo "This script must be run as root" >&2 | |
exit 1 | |
fi | |
# Prompt for custom workflow | |
echo "Do you want to customize user creation and SSH key setup? (y/n)" |
This file contains hidden or 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
// <script> | |
// 消除控制台打印 | |
var HoldLog = console.log; | |
console.log = function () {}; | |
let now1 = new Date(); | |
queueMicrotask(() => { | |
const Log = function () { | |
HoldLog.apply(console, arguments); | |
}; | |
//在恢复前输出日志 |
This file contains hidden or 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 | |
code --list-extensions > extensions_list.txt | |
echo "#!/bin/bash" > install_vscode_extensions.sh | |
echo "" >> install_vscode_extensions.sh | |
while IFS= read -r extension | |
do | |
echo "code --install-extension $extension" >> install_vscode_extensions.sh | |
done < extensions_list.txt |