搞机常用命令

日常玩机过程中不断积累的常用命令

宝塔纯净版

来源网站:

https://www.hostcli.com/

centos

yum install -y wget && wget -O install.sh http://v7.hostcli.com/install/install_6.0.sh && sh install.sh

ubuntu/debian

wget -O install.sh http://v7.hostcli.com/install/install-ubuntu_6.0.sh && bash install.sh

Docker

sudo apt update
sudo apt upgrade 
sudo apt install docker
sudo apt install docker-compose
#创建daoker_net网桥
docker network create daoker_net

docker开启ipv6支持

cat > /etc/docker/daemon.json << EOF
{
    "log-driver": "json-file",
    "log-opts": {
        "max-size": "20m",
        "max-file": "3"
    },
    "ipv6": true,
    "fixed-cidr-v6": "fd00:dead:beef:c0::/80",
    "experimental":true,
    "ip6tables":true
}
EOF

portainer

https://docs.portainer.io/start/install/server/docker/linux

docker run -d -p 8000:8000 -p 9443:9443 --name portainer --restart=always --privileged=true -v /var/run/docker.sock:/var/run/docker.sock -v /docker/portainer_data:/data portainer/portainer-ce:latest

portainer管理面板: https://ip:9443

Nginx Proxy Manager

貌似也有本地版的,但是对于arm不兼容,docker版的ARM和x86都可用,docker-compose 构建:

管理后台: http://ip:81

Default Admin User:

  • Email: admin@example.com
  • Password: changeme
version: '2'
services:
  app:
    image: 'jc21/nginx-proxy-manager:latest'
    restart: unless-stopped
    ports:
      - '80:80'
      - '81:81'
      - '443:443'
    environment:
      DB_MYSQL_HOST: ""
      DB_MYSQL_PORT: 
      DB_MYSQL_USER: ""
      DB_MYSQL_PASSWORD: ""
      DB_MYSQL_NAME: ""
    volumes:
      - /docker/npm/data:/data
      - /docker/npm/letsencrypt:/etc/letsencrypt
  db:
    image: 'jc21/mariadb-aria:latest'
    restart: unless-stopped
    environment:
      MYSQL_ROOT_PASSWORD: ''
      MYSQL_DATABASE: ''
      MYSQL_USER: ''
      MYSQL_PASSWORD: ''
    volumes:
      - /docker/npm/data/mysql:/var/lib/mysql
networks:
  default:
    name: daoker_net
    external: true

WordPress

NPM中已经安装了mysql,这里也可以把其中的mysql的部分删除
version: "3"
services:
   mysql:
     image: mysql
     ports:
       - "31306:3306"
     networks:
       - persist    
     environment:
       - "MYSQL_ROOT_PASSWORD="
       - "MYSQL_PASSWORD="
       - "MYSQL_USER="
       - "MYSQL_DATABASE="
   wordpress:
     image: wordpress
     ports:
       - "9001:80"
     networks:
       - persist    
     environment:
       - "WORDPRESS_DB_NAME="
       - "WORDPRESS_DB_USER="
       - "WORDPRESS_DB_PASSWORD="
       - "WORDPRESS_DB_HOST="
networks:
  persist:
    external:
      name: daoker_net

Alist

安装时正好遇到作者更新了最新版,结果发觉bug很多,所以手动安装了上一个版本

docker run -d --restart=always -v /docker/alist:/opt/alist/data  -p 5244:5244 --name="alist" xhofe/alist:v2.6.4

nginx反代信息:

location / {
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header Range $http_range;
	  proxy_set_header If-Range $http_if_range;
    proxy_redirect off;
    proxy_pass http://alist:5244;
    # the max size of file to upload
    client_max_body_size 20000m;
}

初始密码请查看日志输出:

docker logs alist
# 或者
docker exec -it alist ./alist -password
温馨提示:此处内容仅管理员可见!

x-ui

docker版

编译:

首先从GitHub git clone下来,然后进入到文件夹里docker bulid,最后到要安装的目录里docker run

git clone https://github.com/vaxilu/x-ui.git
cd x-ui
docker build -t x-ui .
#建立的镜像名为x-ui
mkdir -p /docker/x-ui && cd /docker/x-ui
docker run -itd --network=host \
    -v /docker/x-ui/db/:/etc/x-ui/ \
    -v /docker/x-ui/cert/:/root/cert/ \
    --name x-ui --restart=unless-stopped \
    x-ui

docker run -itd --network daoker_net -p 666:54321 58253:58253 -v /docker/x-ui/db/:/etc/x-ui/ -v /docker/x-ui/cert/:/root/cert/ --name x-ui --restart=unlessstopped x-ui

默认用户名、密码:admin

一键安装带tg提醒版

bash <(curl -Ls https://raw.githubusercontent.com/FranzKafkaYu/x-ui/master/install.sh)

speedtest

支持ARM和x86

docker run -d --name=speedtest-x --restart=always -p 12345:80 stilleshan/speedtest-x

青龙面板

docker run -dit \
  -v docker/ql/data:/ql/data \
  -p 5700:5700 \
  --name qinglong \
  --hostname qinglong \
  --restart unless-stopped \
  whyour/qinglong:latest
docker run -dit \
-v $pwd/ql/config:/ql/config \
-v $pwd/ql/log:/ql/log \
-v $pwd/ql/db:/ql/db \
-v $pwd/ql/scripts:/ql/scripts \
-v $pwd/ql/jbot:/ql/jbot \
-p 5700:5700 \
-e ENABLE_HANGUP=true \
-e ENABLE_WEB_PANEL=true \
--name qinglong \
--hostname qinglong \
--restart always \
whyour/qinglong:latest

远程ubuntu桌面

docker run -d -p 6080:80 -v /docker/ubuntudesktop:/workspace:rw -e HTTP_PASSWORD=415408807 -e RESOLUTION=1280x720 --name ubuntu-novnc fredblgr/ubuntu-novnc:20.04

远程chrome浏览器

访问远程局域网的神器

sudo docker run --rm -it --shm-size=512m -p 6901:6901 -e VNC_PW=password kasmweb/chrome:1.13.0
管理界面https://IP:6901
用户名kasm_user
密码password
这里的IP可以用zerotier进行内网穿透

综合工具箱

wget -O box.sh https://raw.githubusercontent.com/BlueSkyXN/SKY-BOX/main/box.sh && chmod +x box.sh && clear && ./box.sh

重装

实测甲骨文ubuntu -> Debian 成功,Debian -> ubuntu 失败

bash <(wget --no-check-certificate -qO- 'https://raw.githubusercontent.com/MoeClub/Note/master/InstallNET.sh') -d 11 -v 64 -p 123456 -port 22

系统参数

-d 10  【7、8、9、10,11】Debian

-u 20.04 【14.04、16.04、18.04、20.04】Ubuntu

密码参数,可以改成别的

-p 12345

端口参数

port 22

BBRPLUS四合一脚本

wget -N --no-check-certificate "https://raw.githubusercontent.com/chiakge/Linux-NetSpeed/master/tcp.sh" && chmod +x tcp.sh && ./tcp.sh

命令行代理

https://zhuanlan.zhihu.com/p/166375631

笔记

哪吒面板相关

准备迁移服务器时才发现,我哪吒面板是搭建在国外洛杉矶的服务器上,但是哪吒面板的域名指向的是国内的阿里云的服务器,然后反代到洛杉矶的服务器上,我也想不起来当初为啥要这么做了。

阿里云服务器上npm里的设置:

#PROXY-START/
location / {
    proxy_pass http://204.44.94.242:8008;
    proxy_set_header Host $http_host;
    proxy_set_header      Upgrade $http_upgrade;
}
location ~ ^/(ws|terminal/.+)$  {
    proxy_pass http://204.44.94.242:8008;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "Upgrade";
    proxy_set_header Host $http_host;
}
#PROXY-END/

debian开机自动挂载目录

1.查看uuid

blkid

2.配置开机自动挂载

sudo vim /etc/fstab

跟着原有的在末尾填入挂载信息

第一个参数是磁盘uuid,第二个参数是挂载在哪里,第三个参数是磁盘格式,第四个参数是默认,第五个参数是是否备份,0不备份,1或2备份,第六个参数是是否检查磁盘,1表示检查

3.验证挂载是否成功,无输出就是成功

mount -a

ubuntu相关

1.查看cpu当前频率

 cat /sys/devices/system/cpu/cpu*/cpufreq/cpuinfo_cur_freq 

2.合上盖子不挂起

把/etc/systemd/logind.conf中的#HandleLidSwitch=suspend改成ingnroe,然后使用services systemd-logind restart重启服务

评论

  1. 匿名
    Linux Chrome 114.0.0.0
    10月前
    2023-6-07 10:47:28
  2. 匿名
    Linux Chrome 114.0.0.0
    10月前
    2023-6-07 10:14:25

发送评论 编辑评论


|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇