ubuntu bash history
常用bash shell
#1 wireguard
$ systemctl stop wg-quick@wg0 && systemctl start wg-quick@wg0 && systemctl status wg-quick@wg0 && wg show
$ ping -c 4 192.168.2.1 && ping -c 4 192.168.2.2 && ping -c 4 192.168.2.3 && ping -c 4 192.168.10.1 && ping -c 4 192.168.10.200
# nginx
$ ln -s /var/www/seagm-tech/nginx/prod.conf mkdocs.seagm.tech.conf
$ nginx -t && systemctl restart nginx && systemctl status nginx
# frps
$ systemctl stop frps && systemctl start frps && systemctl status frps
# 用certbot更新证书
$ certbot certonly --manual --preferred-challenges dns -d cp-frps.seagm.tech
# 项目更新和发布
$ git clone http://192.168.2.2:3000/jihong/seagm-tech.git
$ cd /var/www/my-seagm-tech-site/ && git pull
$ cd /var/www/seagm-tech && git pull
# 查看IP
$ ipconfig && curl ipinfo.io/ip
# 查看服务
$ systemctl list-units --type=service && systemctl list-units --state=running
Bash History
    1  apt update
    2  apt info nginx
    4  apt install nginx
    5  which nginx 
    6  nginx -t
    8  systemctl restart nginx
    9  systemctl status nginx
   10  curl 127.0.0.1
   12  cd /etc/nginx/
   14  cat nginx.conf 
   18  cd /etc/nginx/sites-enabled/
   21  vi seagm.tech.default.conf 
   22  cat seagm.tech.default.conf 
   23  vi seagm.tech.default.conf 
   24  nginx -t
   25  systemctl restart nginx
   53  ipconfig
   54  curl ipinfo.io/ip
   55  systemctl restart nginx
   56  which visudo 
   57  visudo --help
   58  apt info visudo
   61  systemctl list-units --type=service
   62  ps -ef |grep vs
   63  top |grep vs
   76  cd /etc/nginx/sites-enabled/
   79  cat seagm.tech.default.conf 
   80  cat default 
   85  vi /etc/nginx/sites-enabled/seagm.tech.default.conf 
   86  nginx -t
   87  systemctl restart nginx
   88  cd /etc/ssl/
   97  mkdir seagm-tech
   99  cd seagm-tech/
  103  vi /etc/nginx/sites-enabled/seagm.tech.default.conf 
  104  nginx -t
  105  systemctl restart nginx
  107  apt update
  109  apt search certbot
  110  apt info certbot
  112  which wget
  113  cd /usr/share/
  115  mkdir frp
  116  cd frp/
  117  wget https://github.com/fatedier/frp/releases/download/v0.61.0/frp_0.61.0_linux_amd64.tar.gz
  118  lscpu
  119  wget https://github.com/fatedier/frp/releases/download/v0.61.1/frp_0.61.1_linux_arm64.tar.gz
  120  tar -zxvf frp_0.61.1_linux_arm64.tar.gz 
  121  ls
  122  mv frp_0.61.1_linux_arm64 ../frps06101
  126  cd frps06101/
  128  vi frps.toml 
  129  ./frps -c ./frps.toml 
  134  cd ..
  135  cd frp
  137  https://github.com/fatedier/frp/releases/download/v0.61.1/frp_0.61.1_linux_amd64.tar.gz
  138  wget https://github.com/fatedier/frp/releases/download/v0.61.1/frp_0.61.1_linux_amd64.tar.gz
  141  tar -zxvf frp_0.61.1_linux_amd64.tar.gz 
  143  mv frp_0.61.1_linux_amd64 frps06101
  145  cd frps06101/
  147  rm frps.toml 
  149  cp /usr/share/frps06101/frps.toml frps.toml
  152  rm -f frps06101/
  153  rm -rf frps06101/
  154  mv frp/frps06101/ frps06101
  156  cd frps06101/
  158  ./frps -c ./frps.toml 
  159  pwd
  161  which systemctl
  162  systemctl list-unit
  163  systemctl list-units
  164  systemctl list-units starting
  165  systemctl list-units --starting
  166  systemctl list-units -starting
  167  systemctl list-units --state=running
  168  cd /etc/systemd/system
  170  vi ./frps.service
  172  systemctl start frps
  173  systemctl status frps
  174  vi frps.service 
  175  systemctl start frps
  176  systemctl daemon-reload
  177  systemctl start frps
  178  systemctl stop frps
  179  systemctl start frps
  180  systemctl status frps
  189  apt update
  190  cd /etc/ssl/seagm-tech/
  192  mkdir cp-frps.seagm.tech
  194  cd cp-frps.seagm.tech/
  196  apt show certbot
  197  apt install certbot
  198  which certbot 
  199  certbot certonly --manual --preferred-challenges dns -d cp-frps.seagm.tech
  201  cd ..
  203  rm cp-frps.seagm.tech/
  204  rp -rf cp-frps.seagm.tech/
  205  rm -rf cp-frps.seagm.tech/
  207  cd /etc/letsencrypt/live/
  209  pwd
  210  cd /etc/nginx/
  212  cd sites-available/
  214  cd ..
  215  cd conf.d/
  217  cat /etc/nginx/sites-enabled/default 
  218  cd /etc/nginx/sites-enabled/
  220  mv seagm.tech.default.conf www.seagm.tech.conf
  222  cp www.seagm.tech.conf cp-frps.seagm.tech
  224  mv cp-frps.seagm.tech cp-frps.seagm.tech.conf
  225  which vim
  226  vim cp-frps.seagm.tech.conf 
  227  nginx -t
  228  cd /etc/letsencrypt/live/cp-frps.seagm.tech/
  230  vi /etc/nginx/sites-enabled/cp-frps.seagm.tech.conf 
  231  nginx -t
  232  systemctl restart nginx
  233  cat /usr/share/frps06101/frps.toml 
  234  vim /usr/share/frps06101/frps.toml 
  235  systemctl restart frps
  236  systemctl status frps
  238  cd /etc/nginx/sites-enabled/
  240  cat cp-frps.seagm.tech.conf 
  244  apt update
  245  apt search wireguard
  246  apt show wireguard
  247  apt install wireguard
  250  cd /etc/wireguard/
  255  cd /var/www/
  257  wg --help
  258  wg getkey | tee privatekey | wg pubkey > publickey
  259  wg genkey | tee privatekey | wg pubkey > publickey
  261  mv privatekey /etc/wireguard/privatekey
  263  mv publickey /etc/wireguard/publickey
  265  cd /etc/wireguard/
  268  ps aux |grep wg
  269  vim wg0.conf
  270  cat privatekey 
  271  vim wg0.conf
  272  cat publickey 
  273  vim wg0.conf
  274  which wg-quick 
  275  wg-quick --help
  276  systemctl enable wg-quick@wg0
  277  systemctl start wg-quick@wg0
  278  systemctl status wg-quick@wg0
  279  vim wg0.conf
  280  systemctl enable wg-quick@wg0
  281  systemctl start wg-quick@wg0
  282  systemctl status wg-quick@wg0
  283  wg
  284  journalctl -u wg-quick@wg0 -f
  285  echo "test message" | nc -u 127.0.0.1 23399
  286  echo "test message" | nc -u 172.18.230.175 23399
  287  ping 192.168.2.2
  288  wg show
  289  cat /etc/wireguard/wg0.conf 
  290  wg show
  291  vim /etc/sysctl.conf 
  292  sysctl -p
  293  sysctl net.ipv4.ip_forward
  294  show
  295  wg show
  298  echo "test message" | nc -u 172.18.230.175 23399
  299  echo "test message" | nc -u 127.0.0.1 23399
  300  netstat -anup | grep 23399
  302  wg genkey | tee client1_privatekey | wg pubkey > client1_publickey
  303  wg genkey | tee client2_privatekey | wg pubkey > client2_publickey
  305  mv client1_privatekey /etc/wireguard/client1_privatekey
  306  mv client1_publickey /etc/wireguard/client1_publickey
  307  mv client2_privatekey /etc/wireguard/
  308  mv client2_publickey /etc/wireguard/
  309  cd /etc/wireguard/
  311  vim wg0.conf
  313  systemctl enable wg-quick@wg0
  314  systemctl restart wg-quick@wg0
  315  systemctl status wg-quick@wg0
  316  wg
  317  ifconfig
  318  curl ipinfo.io/ip
  319  systemctl status wg-quick@wg0
  321  wg show
  322  vim wg0.conf 
  323  wg show
  324  vim wg0.conf 
  325  telnet localhost 23399
  326  telnet 192.168.2.1 23399
  327  history
  328  systemctl status wg-quick@wg0
  329  vim wg0.conf 
  330  systemctl stop wg-quick@wg0
  331  systemctl status wg-quick@wg0
  332  systemctl enable wg-quick@wg0
  333  systemctl disable wg-quick@wg0
  334  systemctl enable wg-quick@wg0
  335  systemctl start wg-quick@wg0
  336  systemctl status wg-quick@wg0
  337  ip link
  338  telnet 192.168.2.1 23399
  339  vim wg0.conf
  340  ifconfig
  341  telnet 172.18.230.175 23399
  342  wg show
  343  netstat -tunlp | grep wireguard
  344  netstat -tunlp | grep w
  345  lsof -i -P -n | grep w
  346  vim wg0.conf 
  347  lsof -i -P -n | grep 233
  348  lsmod | grep wireguard
  349  iptables -L -v -n
  350  nc -ul 23399
  351  systemctl restart wg-quick@wg0
  352  ufw allow 23399/udp
  353  iptables -L -v -n
  354  systemctl restart wg-quick@wg0
  355  iptables -L -v -n
  356  lsof -i -P -n | grep 233
  357  systemctl restart wg-quick@wg0
  358  ping 192.168.2.1
  359  ping 192.168.2.2
  360  wg show
  361  telnet 172.18.230.175 23399
  362  ip link show wg0
  363  ip addr show wg0
  364  nc -ul 23302
  365  systemctl stop wg-quick@wg0
  366  wg-quick up wg0 
  367  lsof -i -P -n | grep 233
  369  telnet 172.18.230.175 23399
  370  nc -ul 23399
  371  lsof -i -P -n | grep 233
  373  wg show
  374  ufw allow 23399/udp
  375  iptables -L -v -n
  376  iptables -A INPUT -p udp --dport 23399 -j ACCEPT
  377  iptables -L -v -n
  378  wg-quick down wg0 
  379  systemctl disable wg-quick@wg0
  380  systemctl enable wg-quick@wg0
  381  systemctl start wg-quick@wg0
  382  lsof -i -P -n | grep 233
  383  iptables -L -v -n
  384  wg show
  385  ip link show wg0
  386  ip addr show wg0
  387  wg show
  388  lsof -i -P -n | grep 233
  389  history |grep nc
  390  nc -vz -w 127.0.0.1 23399
  391  nc -vz -w 192.168.2.1 23399
  392  nc -vz -w -2 192.168.2.1 23399
  393  nc -vz -w 2 192.168.2.1 23399
  394  nc -vz -w 2 127.0.0.1 23399
  395  nc -vz -w 2 172.18.230.175 23399
  396  nc -ul 23399
  397  lsof -i -P -n | grep 23399
  398  nc -vz -w 2 172.18.230.175 23380
  399  nc -ul 23399
  400  echo "test message" | nc -u 127.0.0.1 23399
  401  ping 192.168.2.1
  402  tcpdump -i any port 23399
  403  history
  404  nc -ul 23399
  405  cat wg0.conf 
  406  tcpdump -i any port 23399
  407  ps -ef |grep tcp
  408  ps aux |grep tcp
  409  which tcpdump 
  410  tcpdump -i any port 23399
  411  wg show
  412  systemctl stop wg-quick@wg0
  413  systemctl start wg-quick@wg0
  414  systemctl status wg-quick@wg0
  415  wg show
  416  tcpdump -i any port 23399
  417  nc -ul 23399
  418  netstat -anup | grep 23399
  419  netstat -tulnp | grep 23399
  420  ss -tulnp | grep 23399
  421  systemctl stop wg-quick@wg0
  422  nc -ul 23399
  423  systemctl start wg-quick@wg0
  424  systemctl status wg-quick@wg0
  425  netstat -tulnp | grep 23399
  426  ss -tulnp | grep 23399
  428  iptables -L -v -n
  429  ip link show wg0
  430  ip addr show wg0
  431  wg show
  434  systemctl status wg-quick@wg0
  436  wg show
  437  tcpdump -i any port 23399
  443  cat /etc/nginx/sites-enabled/cp-frps.seagm.tech.conf 
  447  vim /etc/wireguard/wg0.conf 
  448  systemctl restart wg-quick@wg0
  449  wg show
  452  tcpdump -i any port 23399
  453  wg show
  454  tcpdump -i any port 23399
  455  vim /etc/wireguard/wg0.conf 
  456  systemctl restart wg-quick@wg0
  457  systemctl status wg-quick@wg0
  458  wg show
  459  systemctl stop wg-quick@wg0
  460  systemctl start wg-quick@wg0
  461  systemctl status wg-quick@wg0
  466  vim /etc/wireguard/wg0.conf 
  474  cat frps.20241225-000000.log 
  475  tail -f syslog
  477  cat frps.log 
  480  systemctl restart wg-quick@wg0
  481  systemctl stop wg-quick@wg0 && systemctl start wg-quick@wg0 && systemctl status wg-quick@wg0 && wg show
  482  systemctl daemon-reload
  483  systemctl stop wg-quick@wg0 && systemctl start wg-quick@wg0 && systemctl status wg-quick@wg0 && wg show
  485  ping -c 4 192.168.2.1 && ping -c 4 192.168.2.2 && ping -c 4 192.168.2.3 && ping -c 4 192.168.10.1 && ping -c 4 192.168.10.2
  486  exit
  487  ping -c 4 192.168.2.1 && ping -c 4 192.168.2.2 && ping -c 4 192.168.2.3 && ping -c 4 192.168.10.1 && ping -c 4 192.168.10.200
  488  exit
  489  ping -c 4 192.168.2.1 && ping -c 4 192.168.2.2 && ping -c 4 192.168.2.3 && ping -c 4 192.168.10.1 && ping -c 4 192.168.10.200
  490  cat /etc/wireguard/wg0.conf 
  491  wg-quick down wg0 
  492  wg-quick up wg0 
  493  systemctl stop wg-quick@wg0 && systemctl start wg-quick@wg0 && systemctl status wg-quick@wg0 && wg show
  494  ping -c 4 192.168.2.1 && ping -c 4 192.168.2.2 && ping -c 4 192.168.2.3 && ping -c 4 192.168.10.1 && ping -c 4 192.168.10.200
  495  curl http://192.168.10.200:5244
  496  curl http://192.168.2.2:5244
  502  cd sites-enabled/
  504  cat www.seagm.tech.conf 
  507  cd /etc/ssl/seagm-tech/
  514  certbot certonly --manual --preferred-challenges dns -d mkdocs.seagm.tech
  517  cd sites-enabled/
  519  cat cp-frps.seagm.tech.conf 
  522  which git
  523  ping -c 4 192.168.2.1 && ping -c 4 192.168.2.2 && ping -c 4 192.168.2.3 && ping -c 4 192.168.10.1 && ping -c 4 192.168.10.200
  525  git clone http://192.168.2.2:3000/jihong/seagm-tech.git
  526  cd seagm-tech/
  527  git log
  530  mv seagm-tech seagm-tech2
  532  git clone http://192.168.2.2:3000/jihong/seagm-tech.git
  534  cd seagm-tech
  537  git clone http://192.168.2.2:3000/jihong/my-seagm-tech-site.git
  539  cd my-seagm-tech-site/
  542  git config --global credential.helper store
  543  git pull
  544  cat ~/.gitconfig 
  545  cat ~/.git-credentials 
  552  cd /var/www/my-seagm-tech-site/
  559  cd /etc/nginx/sites-enabled/`
  560  cd /etc/nginx/sites-enabled/
  568  mv www.seagm.tech.conf ../sites-available/www.seagm.tech.conf
  573  ln -s /var/www/seagm-tech/nginx/prod.conf mkdocs.seagm.tech.conf
  575  nginx -t
  576  ln -s /var/www/my-seagm-tech-site/nginx/prod.conf www.seagm.tech.conf
  579  nginx -t
  581  systemctl restart nginx
  582  systemctl status nginx
  584  cat mkdocs.seagm.tech.conf 
  585  cat /etc/letsencrypt/live/mkdocs.seagm.tech/fullchain.pem
  586  cd /var/log/nginx/
  588  cat access.log
  589  tail -f *.log
  590  curl http://mkdocs.seagm.tech/
  595  cd /var/www/my-seagm-tech-site/ && git pull
  597  cd /var/www/my-seagm-tech-site/ && git pull
  598  cat /etc/nginx/sites-enabled/cp-frps.seagm.tech.conf 
  599  cd /var/www/my-seagm-tech-site/ && git pull
  602  cd /var/www/my-seagm-tech-site/ && git pull
  607  apt update
  608  apt info apache2-utils
  610  apt install apache2-utils
  612  htpasswd -c mkdocs_pwd admin
  614  cat mkdocs_pwd 
  616  cd /var/www/my-seagm-tech-site/ && git pull
  620  cd /var/www/seagm-tech && git pull
  621  nginx -t
  622  systemctl restart nginx
  623  nginx -t && systemctl restart nginx && systemctl status nginx