登入站台後選擇修改目前連線的設定值
當連線收到"請輸入代碼",設定自動回覆帳號 (^M表示鍵入Enter)
當連線收到"請輸入您的密碼",設定自動回覆密碼 (下方用密碼保護自動回覆的文字內容可選可不選)
有時候重複登入會卡在確認是否刪除其他重複連線,這邊自動回覆Y/n都可以
請按任意鍵繼續,這邊如果不想看之前登入的IP,想直接跳過就自動回覆Enter(^M)
做為一個要開發又要兼顧設備的可憐攻城屍,趕案子同時又要幫其他人設置機器的情景是三天兩頭都會碰到的事情,僅開設VM還好處理,有做過快照以及範本映像檔五分鐘內就可以馬上起一台測試機環境出來。不過若是個人電腦就很麻煩,為確保開發環境乾淨,整台重灌是最保險的方式(老舊的開發環境常有legacy package殘留),流動率越高重灌次數也就越頻繁,確保重灌用的快照不必常常重裝software,找了以下這個工具。
安裝步驟
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
With PowerShell, there is an additional step. You must ensure Get-ExecutionPolicy is not Restricted. We suggest using Bypass to bypass the policy to get things installed or AllSigned for quite a bit more security.
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
NOTE: Please inspect https://chocolatey.org/install.ps1 prior to running any of these scripts to ensure safety. We already know it's safe, but you should verify the security and contents of any script from the internet you are not familiar with. All of these scripts download a remote PowerShell script and execute it on your machine.We take security very seriously. Learn more.
choco upgrade chocolatey choco install docker choco install ruby --version 1.8.7.37402 choco uninstall nodejs.install --all-versions choco uninstall docker notepadplusplus googlechrome choco list --local-only choco outdated choco outdated -s https://somewhere/out/there choco outdated -s "'https://somewhere/protected'" -u user -p pass# 清除DNS快取 ipconfig /flushdns# tracert指令檢查網路停止點 tracert 8.8.8.8 > C:\tracert.txtCMD直接下載檔案 說明:-t是重試次數1次、-T是逾時時間1秒、-O指定檔名 wget -t 1 -T 1 -O test.zip https://github.com/download/test.zipCMD解壓縮 壓縮一個文件 makecab D:/test.txt D:/test.zip 解壓一個文件 expand D:\home\test.zip# 刪除資料夾↓ sudo rm -r foo/# 改名↓ sudo mv foo foo_ori_1012 sudo mv webpack.config.js webpack.config.js_1012# 查詢使用port↓ sudo lsof -i :3000 | grep LISTEN# 移除佔用port↓ sudo kill $(sudo lsof -t -i:3000)# 列出所有程序↓ ps aux sudo kill 16406# 傳送資料夾↓ pscp -r -pw password C:\ssm\locales user@127.0.0.1:/home/social/ssm# linux傳送至windows #pscp root@192.168.2.8:/srv/docker/gitlab d:\gitlab# = = = 防火牆設定(centOS 7) = = = # 開啟6379port --permanent為設置永久 firewall-cmd --zone=public --add-port=6379/tcp --permanent# 確認防火牆是否開啟 firewall-cmd --zone=public --list-all# 重新讀取 firewall 設定 firewall-cmd --reloadauto loiface lo inet loopback
# The primary network interfaceauto eth0iface eth0 inet dhcp# post-up iptables-restore < /etc/iptables.up.rules
auto eth1iface eth1 inet staticaddress 192.168.2.184netmask 255.255.255.0# geteway 192.168.2.1sudo /etc/init.d/networking restartsudo ifdown eth0 && sudo ifup eth0sudo ifdown eth1 && sudo ifup eth1# To create a new screen with the name foo, usescreen -S foo # Then to reattach it, runscreen -r foo # or use -x, as inscreen -x foo # for "Multi display mode" (see the man page)SmokePing官方網站
SmokePing 是一個監測網路延遲並且呈現視覺化圖表的開源軟件 開發者為Tobi Oetiker
以下以GCP上的VM環境做安裝,OS為Debian GUN/Liunx 9.2 首先檢查更新並安裝所需工具 sudo apt-get update sudo apt-get install smokeping sudo apt-get install curl
至smokeping資料夾目錄底下 cd /etc/smokeping/config.d/ 在此需要修改pathnames、Probes、Targets主要的三個檔案 *** pathnames *** 將sendmail註解(在此不使用通知功能) #sendmail = /usr/sbin/sendmail 使用Fping來做檢測,可在此新增檢查執行的時間間隔或次數的設定 在此每隔300秒為一區間,做10次檢測 *** Probes *** + FPing binary = /usr/bin/fping offset = 50% step = 300 pings = 10 + Curl binary = /usr/bin/curl forks = 5 offset = 50% step = 300urlformat = http://$host$/因為一些網路環境比較嚴謹會擋掉封包而ping不到,但我們又需要檢測網站是否穩定我在這增加了Curl的參數設定,為了可以針對特定port號像是網站的80或8080去監測urlformat這邊相關設定說明可以查看官方的範例*** Targets ***主要設定Smokeping要監控的主機probe = Curlmenu = Toptitle = Network Latency Grapherremark = Welcome to this SmokePing website.+ HTTPmenu = httptitle = HTTP latency++ myhost1menu = myhost1title = HTTP latency for myhost1host = myhost1.example++ myhost2menu = myhost2title = HTTP latency for myhost2host = myhost2.example++ myhost3menu = myhost3title = HTTP latency for myhost3 (port 8080!)host = myhost3.exampleurlformat = http://%host%:8080/依照需要偵測的IP或者網站去設定如果只需要監控一般網路延遲的話可以不用用到Curl需要偵測網站特定port號即需要使用CurlTargets內的設定,+即為用來區別階層以及各個項目可以同時顯示多個監控結果或是只顯示一個像是上面例子中HTTP僅為一個分類項目,並無設置監控在頁面中點開即可看到階層內會有三個項目myhost1~myhost3menu 為選單上顯示名稱title 為該監控項目標題名稱host 要監控的主機urlformat 要偵測的網頁網址,可自動帶入host參數,這樣之後要更動會比較方便若不需要直接在前面加上#註解掉即可
透過lynx在liunx文字命令底下瀏覽網頁
sudo apt-get install lynx
lynx https://lanlanlue.blogspot.tw/
選項:
- case: 在搜索字串時,區分大小寫;
- ftp: 關閉ftp功能;
- nobrowse: 關閉目錄瀏覽功能;
- noclor: 關閉色彩顯示模式;
- reload: 更新代理服務器的緩存, 只對首頁有效;
--color: 如果系統支持彩色模式, 則使用彩色模式;
--help: 顯示指令的幫助信息;
--versiom: 顯示指令的版本信息。
官方來源:https://code.google.com/archive/p/paping/
確認有安裝基本工具
apt-get update
apt-get -y install wget bash
下載最新檔案(至官網抓取符合系統版本的檔案)
wget https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/paping/paping_1.5.5_x86-64_linux.tar.gz
解壓縮
tar zvxf paping_1.5.5_x86-64_linux.tar.gz
加入paping命令並移至bin目錄
chmod +x paping
mv paping /bin
檢測80 port
paping lanlanlue.blogspot.tw -p 80
結果
CCMakeFiles / xmr-stak-cpu.dir / build.make: 182: recipe for target 'CMakeFiles / xmr-stak-cpu.dir / executor.cpp.o' failed
make [2]: *** [CMakeFiles / xmr-stak-cpu.dir / executor.cpp.o] Interrupt
CMakeFiles / Makefile2: 104: recipe for target 'CMakeFiles / xmr-stak-cpu.dir / all' failed
make [1]: *** [CMakeFiles / xmr-stak-cpu.dir / all] Interrupt
Makefile: 127: recipe for target 'all' failed
make: *** [all] Interrupt
use swap:
sudo dd if=/dev/zero of=/swapfile bs=64M count=16
sudo mkswap /swapfile
sudo swapon /swapfile
順利編譯過後,用不到的話可以移除
rm swap:
sudo swapoff /swapfile
sudo rm /swapfile
sudo apt-get update
sudo apt-get -y dist-upgrade
sudo apt-get install zip unzip
sudo apt-get clean
1
2
3
| sudo apt-get updatesudo apt-get install ubuntu-desktop |
1
| sudo apt-get install --no-install-recommends ubuntu-desktop |
安裝MySQL(可改用Cloud SQL執行個體即可建立) 安裝Nodejs 安裝npm 設置防火牆規則 (需設置網路標籤)
MySQL sudo apt-get -y install mysql-server sudo mysql sudo service mysql status sudo service mysql restart mysql -u root -p ERROR 1130: Host '*.*.*.*' is not allowed to connect to this MySQL server 1 可能是你的帳號不允許從遠端登陸,只能在localhost。這個時候只要在localhost的那台電腦,登入mysql後,更改 "mysql" 資料庫裡的 "user" 表裡的 "host" 項,從"localhost"改稱"%" mysql -u root -pvmwaremysql>use mysql; mysql>update user set host = '%' where user = 'root'; mysql>select host, user from user; 2. 例如,你想myuser使用mypassword從任何主機連接到mysql伺服器的話。 GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION; 如果你想允許使用者myuser從ip為192.168.1.2的主機連接到mysql伺服器,並使用mypassword作為密碼 GRANT ALL PRIVILEGES ON *.* TO 'root'@'192.168.1.2' IDENTIFIED BY 'newpassword' WITH GRANT OPTION; GRANT ALL PRIVILEGES ON *.* TO 'root'@'192.168.1.2' IDENTIFIED BY '123456' WITH GRANT OPTION; mysql>flush privileges; 這句一定要加上。npm相關套件:
nginx相關
sudo nginx -t #測試
sudo service nginx restart #伺服器重啟
cd /etc/nginx/sites-enabled
sudo vim domain1
server {
listen 80;
server_name *.*.*.*; #domain或IP
access_log /var/log/nginx/domain1.access.log;
location / {
proxy_pass http://127.0.0.1:8080/; #server的位址
}
}
C:\Program Files (x86)\Common Files\Microsoft Shared\VSTO\10.0
C:\Program Files\Common Files\Microsoft Shared\VSTO\10.0
靠近小行星的太空郵差 💡 你知道嗎? OSIRIS-REx從Bennu帶回太空沙 標籤:小行星, 樣本返回, OSIRIS-REx 📖 真相大揭密 NASA OSIRIS-REx 於 2020 年進入直徑約 490 米的近地小行星 Bennu...