發表文章

目前顯示的是 2月, 2020的文章

debian 10 install pptpd

apt install pptpd apt install firewalld vim /etc/pptpd.conf 要加入: localip 192.168.0.21 remoteip 192.168.1.5-238,192.168.1.245 vim /etc/ppp/pptpd-options 要加入: ms-dns 8.8.8.8 ms-dns 8.8.4.4 vim /etc/ppp/chap-secrets 要加入: username <TAB> * <TAB> users-password <TAB> * sudo /etc/init.d/pptpd restart vim /etc/firewalld/firewalld.conf 有個InvividualCalls=no 把它改成InvividualCalls=yes firewall-cmd --zone=public --permanent --add-port=1723/tcp firewall-cmd --zone=public --add-masquerade --permanent firewall-cmd --permanent --direct --add-rule ipv4 nat POSTROUTING 0 -o ens33 -j MASQUERADE firewall-cmd --permanent --direct --add-rule ipv4 filter INPUT 0 -i ens33 -p gre -j ACCEPT firewall-cmd --permanent --direct --add-rule ipv4 filter FORWARD -p tcp --tcp-flags SYN,RST SYN -s 192.168.1.0/24 -j TCPMSS  --clamp-mss-to-pmtu firewall-cmd --reload sudo /etc/init.d/pptpd restart

centos 8 安裝node-red 與 mosquitto-1.6.8

今天來用我大centos裝node-red 與 mosquitto 裝到一半 幹咧 阿怎麼沒有mosquitto 只好從官網抓QAQ 然後自己make 自己 make install 不囉嗦 上步驟: yum install epel-release yum install gcc-c++ make yum install openssl-devel firewall-cmd --permanent --zone=public --add-port=1880/tcp firewall-cmd --permanent --zone=public --add-port=1883/tcp firewall-cmd --reload curl -sL https://rpm.nodesource.com/setup_12.x | bash - yum install nodejs npm install -g node-red npm install -g node-red-dashboard npm install -g node-red-admin node-red-admin hash-pw vim .node-red/settings.js (把你的username 跟 password 的hash填進去) wget https://mosquitto.org/files/source/mosquitto-1.6.8.tar.gz tar -zxvf mosquitto-1.6.8.tar.gz make make install mosquitto_passwd -c /etc/mosquitto/passwd admin cp /etc/mosquitto/mosquitto.conf.example /etc/mosquitto/mosquitto.conf vim /etc/mosquitto/mosquitto.conf 199行 加入 user root 因為新的mosquitto 好像不讓root開(? 650行 加入 password_file /etc/mosquitto/passwd 這邊是要指定password file 最後: mosquitto

node-red 寫成服務時遇到 typeerror the path argument must be of type string. received type undefined

之前有在我的NUC的VM上架過node-red 這次把它寫成服務時 卻噴了 typeerror the path argument must be of type string. received type undefined 這個錯誤 以下是我服務寫成的內容 [Unit] Description=node-redd Daemon after=network.target [Service] Type=forking ExecStart=/home/node-red-start.sh ExecStop=/home/node-red-stop.sh StandardOutput=tty [Install] WantedBy=multi-user.target node-red-stop.sh: #!/bin/sh ps aux | grep node-red | awk '{print $2}' | xargs kill -9 node-red-start.sh: #!/bin/sh node-red & 會噴出錯誤的原因主要是我之前居然是用root開node-red的 他找不到我放在 /root/.node-red/settings.js 所以把node-red-start.sh 內容修改一下: #!/bin/sh node-red -s /root/.node-red/settings.js & 就行了