System info at a glance
Runs as any userRead-only
One command to see the distro, kernel, CPU, memory, disk, network interfaces and common service states. Read-only, changes nothing.
curl -fsSL https://www.moiu.cn/scripts/sysinfo.sh | bashA handful of everyday server scripts. Copy one line and run it — reading the source first is recommended.
Filter by tag
Showing 23 of 23
Runs as any userRead-only
One command to see the distro, kernel, CPU, memory, disk, network interfaces and common service states. Read-only, changes nothing.
curl -fsSL https://www.moiu.cn/scripts/sysinfo.sh | bashRoot required
Installs Docker and Compose with the official script and writes in mainland mirror accelerators. Asks before reinstalling.
curl -fsSL https://www.moiu.cn/scripts/docker-install.sh | bashRoot required
Switches congestion control to BBR and the queueing discipline to fq via sysctl.d. Exits early on kernels below 4.9.
curl -fsSL https://www.moiu.cn/scripts/bbr-enable.sh | bashRoot required
Creates a swap file of the given size at /swapfile, adds it to fstab for boot, and lowers swappiness to 10.
curl -fsSL https://www.moiu.cn/scripts/swap-setup.sh | bashRoot required
Disables root login and password auth, tightens retries and the auth window. Refuses to run without an SSH key, and rolls back if sshd -t fails.
curl -fsSL https://www.moiu.cn/scripts/ssh-harden.sh | bashRuns as any user
Packs a directory into a timestamped tar.gz, excluding node_modules, .git, caches and dist. No root needed.
curl -fsSL https://www.moiu.cn/scripts/dir-backup.sh | bashRoot required
Deploys the Komari monitor using the NJU mirror, with data persisted at /opt/komari/data. Requires Docker first.
curl -fsSL https://www.moiu.cn/scripts/komari-install.sh | bashRoot required
Stops services, removes systemd units, cleans directories and leftover processes, then verifies itself. Handles random-suffixed names.
curl -fsSL https://www.moiu.cn/scripts/nezha-uninstall.sh | bashRoot required
Refreshes package sources, upgrades installed packages and drops unused dependencies. Warns about a pending reboot instead of taking one.
curl -fsSL https://www.moiu.cn/scripts/system-update.sh | bashRoot required
Defaults to Asia/Shanghai and turns on NTP sync. Pass a zone name to change it, for example UTC.
curl -fsSL https://www.moiu.cn/scripts/timezone-set.sh | bashRoot required
Denies inbound by default, allows outbound, and opens only SSH plus 80/443. Allows SSH before enabling, so you are not locked out.
curl -fsSL https://www.moiu.cn/scripts/ufw-firewall.sh | bashRoot required
Installs, starts and enables Nginx on boot. If it is already installed it exits without touching your configuration.
curl -fsSL https://www.moiu.cn/scripts/nginx-install.sh | bashRoot required
Uses the certbot nginx plugin to rewrite the config, set up the renewal timer and redirect http to https. The domain must already point here.
curl -fsSL https://www.moiu.cn/scripts/certbot-ssl.sh | bashRoot required
Clears apt caches, unused dependencies, journal logs, stale /tmp files and dangling Docker images. Leaves /home and your app directories alone.
curl -fsSL https://www.moiu.cn/scripts/disk-cleanup.sh | bashRuns as any userRead-only
Lists listening ports with their processes; pass a port number to narrow it down. Read-only, no root needed.
curl -fsSL https://www.moiu.cn/scripts/port-usage.sh | bashRoot required
Installs a chosen major version from the official NodeSource repository (22 LTS by default). Asks before overwriting an existing install.
curl -fsSL https://www.moiu.cn/scripts/nodejs-install.sh | bashRoot required
Sets up an sshd jail that bans an address for an hour after five failures within ten minutes. Pairs well with the firewall script.
curl -fsSL https://www.moiu.cn/scripts/fail2ban-install.sh | bashRoot required
Writes a public key into the given user authorized_keys and fixes the permissions. The key arrives as an argument, never from standard input.
curl -fsSL https://www.moiu.cn/scripts/ssh-key-setup.sh | bashRoot required
Creates a user with sudo rights and optionally installs a public key for it. Detects whether the admin group is called sudo or wheel.
curl -fsSL https://www.moiu.cn/scripts/user-add.sh | bashRoot required
Raises nofile to 65535 and lifts file-max plus the connection backlogs. Busy services tend to hit exactly these three walls.
curl -fsSL https://www.moiu.cn/scripts/limits-tune.sh | bashRuns as any userRead-only
Scans the usual certificate directories and can check a live domain, reporting days left. Read-only.
curl -fsSL https://www.moiu.cn/scripts/cert-check.sh | bashRuns as any userRead-only
Shows the configured resolvers, whether a domain resolves, whether public DNS is reachable, and the outbound IP. Read-only.
curl -fsSL https://www.moiu.cn/scripts/dns-check.sh | bashRoot requiredRead-only
Lists every user crontab, /etc/cron.d and the systemd timers. For finding out what runs at 3am. Read-only, but needs root.
curl -fsSL https://www.moiu.cn/scripts/crontab-list.sh | bash