VPS常用命令
curl https://get.volta.sh | bash
export VOLTA_HOME="$HOME/.volta"
export PATH="$VOLTA_HOME/bin:$PATH"
source ~/.bashrc
volta install [email protected]
切换node版本只需再次安装需要的版本即可自动切换
bash <(curl -Ls https://raw.githubusercontent.com/admin8800/x-ui/main/install.sh)
wget -N https://gitlab.com/fscarmen/warp/-/raw/main/menu.sh && bash menu.sh [option] [lisence/url/token]
warp [option] [lisence]
curl -fsSL https://get.docker.com | sh
dpkg --print-architecture
uname -a
cat /etc/os-release
lsb_release -a
按目录名称查找
find / -type d -iname "目录名" 2>/dev/null
按文件名称查找
find / -type f -name "*文件名*" 2>/dev/null
按文件大小查找
find / -type f -size +20M -exec ls -lh {} \; 2>/dev/null
显示所有与主机建立连接的IP
ss -tunp
显示内存占用最大的10个进程
ps aux --sort=-%mem | head -n 10
mem为内存,可改为cpu
一键脚本
wget -N --no-check-certificate https://github.com/sky22333/rootvps/raw/main/rootvps && bash rootvps
sudo passwd root
Debian/Ubuntu 命令:
apt update
apt install curl wget git zip tar iptables lsof vim sudo -y
CentOS 命令:
yum update -y
yum install curl wget git zip tar iptables lsof vim sudo -y
wget -qO- git.io/besttrace | bash
curl https://raw.githubusercontent.com/zhanghanyun/backtrace/main/install.sh -sSf | sh
bash <(curl -L -s check.unlock.media)
bash <(curl -L -s check.unlock.media) -M 4
bash <(curl -L -s check.unlock.media) -M 6
sudo lsof -i -P -n
ss -tuln
ss -tunp
lsof -i:端口号
kill PID数字
sudo ufw allow 端口号
sudo ufw allow 起始端口:结束端口
sudo ufw enable
# 重启ufw防火墙
sudo ufw deny 端口号
sudo ufw allow from 192.168.1.100 to any port 22
# 多IP用英文的逗号分开
mv config.txt config.json
mv shell.txt shell.sh
sudo fallocate -l 3G /swapfile && sudo chmod 700 /swapfile && sudo mkswap /swapfile && sudo swapon /swapfile && echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
firewall-cmd --state
# 查看防火墙状态
systemctl stop firewalld.service
# 停止防火墙
systemctl disable firewalld.service
# 禁止防火墙开机自启
wget --no-check-certificate https://github.com/teddysun/across/raw/master/bbr.sh && chmod +x bbr.sh && ./bbr.sh
sysctl net.ipv4.tcp_congestion_control
wget https://raw.githubusercontent.com/TeamPGM/PagerMaid-Pyro/development/utils/install.sh -O install.sh && chmod +x install.sh && bash install.sh
使用该脚本会将 Pagermaid-Pyro
安装至 /var/lib/pagermaid
目录下。
在 Windows 8.1/10/11 上,右键单击 Windows 开始菜单并 选择 PowerShell 或终端(非 CMD)
irm https://massgrave.dev/get | iex
稍微等待一下,他会自动适配,并激活您的系统,当出现 Successful 的时候说明系统已经激活成功了
查看已连接过的wifi:
netsh wlan show profile
查看密码:
netsh wlan show profile name="WiFi名称" key=clear
打印到C盘:
netsh wlan export profile folder=C:\ key=clear
代理工具SSH工具下载
网站收藏or服务器
轻量级Liunx文件管理系统
支持实时管理liunx系统文件的项目
安装:
curl -fsSL https://raw.githubusercontent.com/filebrowser/get/master/get.sh | bash
启动:
filebrowser -a 0.0.0.0 -r /
设置—用户管理—用户编辑—增加文件管理命令unzip tar chmod
示例unzip you.zip
/ chmod -R 777 home
Liunx配置wrap
debian系统安装:
curl -fsSL https://pkg.cloudflareclient.com/pubkey.gpg | sudo gpg --yes --dearmor --output /usr/share/keyrings/cloudflare-warp-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/cloudflare-warp-archive-keyring.gpg] https://pkg.cloudflareclient.com/ $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/cloudflare-client.list
sudo apt-get update && sudo apt-get install cloudflare-warp -y
注册客户端:
warp-cli registration new
开启代理模式:
warp-cli mode proxy
启动wrap:
执行此命令前必须开启代理模式
否则机器可能失联
warp-cli connect
wrap将代理本地的40000
端口
更改代理端口:warp-cli proxy port 40000
配置文件:cd /var/lib/cloudflare-warp
查看代理IP:
curl -x "socks5://127.0.0.1:40000" ipinfo.io
开启全局代理:
export ALL_PROXY=socks5://127.0.0.1:40000
关闭全局代理:
unset ALL_PROXY
关闭wrap:
warp-cli disconnect
Git推送到GitHub仓库教程
连接远程仓库
git remote add origin [email protected]:用户名/仓库名.git
git checkout main
git add .
git commit -m "描述你的更改"
git push origin main
main
为分支名
输入用户名和key密钥即可推送完成
git config --global --unset credential.helper
git fetch upstream
git branch -r --contains 提交哈希
git cherry-pick -m 1 提交哈希
这里的-m 1
表示选择合并的提交中的第一个父提交的更改。
如果不是合并的提交则去掉-m 1
多个提交哈希
用空格隔开
修改后告诉git冲突已解决
git add 冲突文件路径
(可选)告诉所有已解决
git add .
继续之前因冲突而中止的提交
git cherry-pick --continue
本地dev分支推送到远程dev分支
git push origin refs/heads/dev:refs/heads/dev
(可选)放弃提交
git cherry-pick --abort