筆記

常用指令

網路除錯
# 清除DNS快取
  ipconfig /flushdns
# tracert指令檢查網路停止點
  tracert 8.8.8.8 > C:\tracert.txt

CMD
CMD直接下載檔案
  說明:-t是重試次數1次、-T是逾時時間1秒、-O指定檔名
  wget -t 1 -T 1 -O test.zip https://github.com/download/test.zip
CMD解壓縮
  壓縮一個文件 makecab D:/test.txt D:/test.zip
  解壓一個文件 expand D:\home\test.zip

Linux

# 刪除資料夾↓
  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 --reload

修改網路設定 $ sudo vi /etc/network/interfaces
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet dhcp
# post-up iptables-restore < /etc/iptables.up.rules

auto eth1
iface eth1 inet static
address 192.168.2.184
netmask 255.255.255.0
# geteway 192.168.2.1

網路重啟
sudo /etc/init.d/networking restart
sudo ifdown eth0 && sudo ifup eth0
sudo ifdown eth1 && sudo ifup eth1

Linux Screen
# To create a new screen with the name foo, use
screen -S foo  # Then to reattach it, run
screen -r foo  # or use -x, as in
screen -x foo  # for "Multi display mode" (see the man page)


Windows快捷

  • Win + x  = windows選單
  • Win + r  = 執行
  • Win + CTRL + c = 灰階顯示 (win10)


留言

這個網誌中的熱門文章

儲存碟不要用主機板做RAID,Windows內建即可

透過CMD格式化磁碟或USB

PCMAN自動登入