自由學習的風

幽夢影 張潮 少年讀書,如隙中窺月;中年讀書,如庭中望月;老年讀書,如臺上玩月。皆以閱歷之淺深,為所得之淺深耳。
顯示具有 網管 標籤的文章。 顯示所有文章
顯示具有 網管 標籤的文章。 顯示所有文章

VS Code 直接透過 sftp 同步到遠端伺服器

2024年9月29日 星期日

環境介紹:

  • 正式機:10.x.y.aaa,  Linux Ubuntu + Docker(Nginx + PHP + MySQL)
  • 開發機:10.x.y.bbb, Windows 11 + Laragon + VS Code

之前利用 VS Code 開發之前,總是利用 SSHFS-Win 掛載至本機後,再用比對軟體檢查哪些檔案有修改,是否需要上傳(註:freecommander 很好用)。

不過,有時只是一、二支程式需要上傳,總覺得這樣做的話有點繁瑣,最近發現有支 vscode 的 extension(擴充套件):sftp

可以 ssh 連到遠端伺服器,直接上傳,也支援多個網站,所以可以先上傳到測試伺服器,沒問題後再上傳到正式機。

安裝後要先設定遠端伺器資訊,按【F1】,選擇「SFTP: Config」,會在 .vscode 目錄中產生 sftp.json 設定範本檔,直接依個人需求填入設定值即可。


預設是只會有一組伺服器設定,若有多組伺服器的話,例如有測試機、正式機…等,那就要設定 profiles,把設定檔改成下列即可,連線時,按按【F1】,選擇「SFTP: Set Profile」,選擇要連線的伺服器即可。


這支擴充套件還提供其它蠻方便的功能,也可以去發掘喔!

CentOS 7 如何更新 php 版本

2022年4月23日 星期六

 之前利用 Remi 的 Repo 來安裝 php 7.0,現在想把 7.0 更新到 7.4,又不想裝上每個套件都加上後綴 xxx74 這種醜醜的名稱,這時候可以透過修改 Remi 的 Repo 來達成。

yum-config-manager  --enable remi-php74

# yum update

二行指令,搞定!





常用遠端連線程式列表

2022年4月12日 星期二

做個記錄。

連線後可直接接管螢幕畫面:

  •  VNC
  • TeamViewer
  • Anydesk
  • ShowMyPC
  • AweSun
連線後被控端會登出:
  • 遠端桌面連線 (micrsoft)

[系統]隱藏某個Windows 更新項目

2021年4月7日 星期三

 之前在 Windows 7 時代,可以在更新項目中直接選擇將某些更新隱藏起來不更新,結果到了 Windows 10 就把這項功能移除掉了。

本來也沒啥問題,不過,Windows 最近的更新又出包了,我有一台  20H2 一直會更新 KB5000802 這支更新檔,造成反覆更新、反覆開機,上網查了一下,嘿!原來得自己去官網下載程式才提供。

PS: 不過,很奇怪的是…官網搜尋到的下載網址顯示 File Not Found...只能找其它資訊站台 :(



參考文章:Show or Hide Updates Tool will block unwanted Windows Updates in Windows 10
下載網站:Downloading Microsoft Show or Hide Updates Troubleshooter

[Ubuntu] 清除 broken 和 residual package

2021年1月31日 星期日

在 debian/ubuntu/mint  安裝或移除套件時,幾乎都是利用 apt 這支程式來處理。

但是有時候安裝失敗時、或是未完全移除時(--purge),就會有套件變得不完全。

residual package 用  dpkg -l 列出來時,會在開頭出現 rc 的字符,而 broken package  則會在開頭出現 iU 的字符,我們可以用下列的指令來篩選出來:

dpkg -l |grep "^rc" 

dpkg -l |grep "^iU"








我們可以下達 apt purge [package name] 的指令來徹底移除它,不過,如果類似的套件很多,就是件折磨人的事了,不過,linux 的好處就可以自己隨意組合指令來符合自己的需求,搭配 awk 把套件名稱撈出來,再丟給 apt 來移除,方便又省事!

sudo apt purge $(dpkg -l |grep "^rc" | awk '{print $2}')

[Ubuntu] 單網卡綁多個網段的IP

2021年1月19日 星期二

Ubuntu Server 20.04 安裝在 ESXi 伺服器之後的問題

2020年12月21日 星期一

問題1: themald error:




無法載入 thermal-conf.xml,網路上的解法,可照下列步驟處理:
1. 開啟 vSphere Client。
2. 找到虛擬機/編輯虛擬機器設定。
3. 選項/進階/一般 ,點擊【組態參數】

4. 點擊【新增列】,名稱輸入「disk.EnableUUID」,值為「TRUE」。


5. 點擊【確定】後,啟動虛擬機即可。

Ubuntu Server 18.04 更新到 20.04.1 後,Xshell4 無法連線(no matching key exchange)

2020年8月29日 星期六

 前兩天把 Ubuntu Server 18.04 升級成 20.04.1,結果,發生用 Xshell 4 無法連線,出現「no matching key exchange 」,用 putty 連線也一樣。

查了 putty 的版本,是0.6x 的版本,重新下載新版 (0.74)後,putty 就可以正常連線了。不過, 我用另一台電腦上的 Xshell 6 其實也可以連線,所以,但是因為某個原因,我並不想把 Xshell4 升級,所以又努力查原因…

看了一下 log 檔:

no matching key exchange method found. Their offer: diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1

看來應該是某個(些)運算法不支援了,若要強制支援的話,得另外在 「/etc/ssh/sshd_config」加上參數:

KexAlgorithms diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group-exchange-sha256,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group1-sha1,curve25519-sha256@libssh.org

把 sshd 重新啟動後,Bingo!!! 連線正常。


Ref: xshell4連接ubuntu,報錯No matching outgoing encryption


[校園網路]校園無線網路無法連網 除錯步驟

2020年7月22日 星期三

早上低年級老師到校備課,打電話回報教室內電腦可以上網,但是手機連無線網路有問題。
首先,❶先請她走到附近的教室,再連一次無線看看是否正常;❷拿手機到辦公室測試手機是否正常(辦公室無線OK)。

結果,❶仍是無法上網,但是❷可以上網;嗯!看起來有點像是設備有點狀況,所以我就❸連上 Siraya 平台(nms.ntpc.edu.tw)檢查,點開 網路設備/基地台設備 後,發現所有教室內的  Cisco 無線 AP 都處理離線狀態,鑒於對第一大廠而言,發生大規模故障的機率實在微乎其微,其中還有一台是 AP Controller,❹就拿起電話打給駐點工程師,工程師做了簡單的測試確認有點問題後,留下我的聯絡電話,並說明待會兒會有人與我聯絡。


沒多久,另一位工程師打電話聯絡,請我到機房看看 AP Controller 目前的燈號情況,我拿著手機到機房後,發現機櫃上的 Cisco AP Controller 未過電,走到機櫃後一看,電源延長線壞了,先臨時接到另一個正常的插孔上後,通電,正常!

再打電話到教室給報修的老師,手機上網也正常了,結案!!

喔…忘了說,掛電話之後,就趕緊上網購買多孔插座回來更換,多孔插座也是有壽命的!!

下面這篇文章有介紹多孔插座,我覺得蠻詳細的,很有用!我買了蓋世特,不過不是該文中所列的機架式款式。



[網管] 用指令設定 IP、啟用檔案共用

2020年7月13日 星期一

  1. 防火牆 啟用 遠端桌面
    netsh advfirewall firewall set rule group="remote desktop" new enable=Yes
  2. 修改註冊機碼啟用 遠端桌面
    reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f
  3. 防火牆 啟用 檔案及印表機共用
    netsh advfirewall firewall set rule group="File and Printer Sharing" new profile=private
    netsh advfirewall firewall set rule name="檔案及印表機共用 (SMB-In)" dir=in profile=private new enable=Yes
  4. To see a list of interfaces
    netsh interface show interface
  5. To set/change an address:
    netsh interface ip set address "Ethernet" static 10.0.0.100 255.255.0.0 10.0.0.1 1
  6. To see a list of NICs with their configured network settings
    netsh interface ip show config
  7. To set a static IP
    netsh interface ip set address "Local Area Connection 3" static 10.0.0.100 255.255.0.0 10.0.0.1 1
  8. If you are setting a static IP for the first time, you will also need to configure a DNS server:
    netsh interface ipv4 add dnsserver "Local Area Connection 3" address=8.8.8.8 index=1
  9. To change the connection back to DHCP 
    netsh interface ip set address "Local Area Connection 3" dhcp

[Windows] 磁碟分割工具 - diskpart

2020年6月18日 星期四

fdisk 就讓它成為過去吧!
diskpart 似乎能處理的比較完整…

截錄----------------------------------------------

使用 diskpart /s 來執行腳本,以自動執行磁片相關工作,例如建立磁片區或將磁片轉換成動態磁碟。 如果您正使用自動安裝或 Sysprep 工具 (這不支援建立非開機磁碟區的磁碟區) 來部署 Windows,那麼以指令執行這些工作非常有用。

若要建立 diskpart 腳本,請建立一個文字檔,其中包含您想要執行的 Diskpart 命令,每行一個命令,而不是空白行。 您可以從開始一行, rem 讓這一行成為批註。 例如,以下腳本會抹除磁片,然後為 Windows 修復環境建立 300 MB 磁碟分割:

```
select disk 0
clean
convert gpt
create partition primary size=300
format quick fs=ntfs label=Windows RE tools
assign letter=T
```

範例

  • 若要執行 diskpart 腳本,請在命令提示字元中輸入下列命令,其中scriptname是包含腳本的文字檔名稱:

    diskpart /s scriptname.txt
    
  • 若要將 diskpart 的腳本輸出重新導向至檔案,請輸入下列命令,其中logfile是 diskpart 寫入其輸出的文字檔名稱:

    diskpart /s scriptname.txt > logfile.txt

SSHFS - 在 Windows 10 底下透過 SSH 將遠端目錄掛載為磁碟

2020年6月15日 星期一

Github專案: https://github.com/billziss-gh/sshfs-win

安裝步驟:
  1. WinFsp
  2. SSHFS-Win
基本用法:
net use {磁碟代號:}  \\sshfs\REMOTE_USER@HOST[\PATH]

範例:
net use  X:  \\sshfs\username@myhost.local
net use  X:  \\sshfs\username@myhost.local\..\..\var\www\html

注意:使用者帳號一定要加上,不然會無法登入 

[MySQL] 升級 8 之後…

2020年4月22日 星期三

原本 mysql 8 之前,我都會用  'GRANT' 指令來新增使用者管理某個資料庫權限,升級後,這個動作失敗了,因為得先有 user,才能賦予權限。

dbname
username
MYPASSWORD

GRANT ALL PRIVILEGES on dbname.* TO username@localhost IDENTIFIED BY 'MYPASSWORD';

change to:

CREATE USER username@localhost IDENTIFIED BY 'MYPASSWORD';
GRANT ALL PRIVILEGES on dbname.* TO username@localhost ;

[轉貼] YAML -- 想要愛你很容易

2019年10月6日 星期日

yaml 文件格式似乎也逐漸走入我的日常工作裡,還是需要瞭解一下好讓工作更順利!
-----------------------------------------------------------

轉貼連結: YAML -- 想要愛你很容易

重點截錄:

YAML 的定義是:“YAML Ain ’ t a Markup Language”,即:YAML 不是一種標記語言的遞歸縮寫。
YAML 的數據組織主要依靠的是空白,縮進,分行等結構。











轉: How to enable and start services on Alpine Linux

2019年5月4日 星期六

Alpine Linux 是個小巧輕量的 Linux系統,非常值得試試

原文:https://www.cyberciti.biz/faq/how-to-enable-and-start-services-on-alpine-linux/


How do I add or delete service at boot time on an Alpine Linux? How do I enable service such as Nginx/Apache at boot time on an Alpine Linux? How do I start/stop/restart services on an Alpine Linux?
Alpine Linux comes with OpenRC init system. This tutorial shows how to use the various command on OpenRC to manage services.View status of all services
Type the following command:# rc-status

systemd 和 upstart 啟用和停用

2018年8月13日 星期一

參考: https://askubuntu.com/questions/19320/how-to-enable-or-disable-services
-----------------------------------------------------------------------------------------------------------------------

Temporary enabling/disabling services

To stop and start services temporarily (Does not enable / disable them for future boots), you can type service SERVICE_NAME. For example:
  • sudo service apache2 stop (Will STOP the Apache service until Reboot or until you start it again).
  • sudo service apache2 start (Will START the Apache service assuming it was stopped before.).
  • service apache2 status (Will tell you the STATUS of the service, if it is either enabled/running of disabled/NOT running.).
  • sudo service apache2 restart (Will RESTART the service. This is most commonly used when you have changed, a config file. In this case, if you changed either a PHP configuration or an Apache configuration. Restart will save you from having to stop/start with 2 command lines)
  • service apache2 (In this case, since you did not mention the ACTION to execute for the service, it will show you all options available for that specific service.) This aspect varies depending on the service, for example, with MySQL it would only mention that it is missing a parameter. For other services like networking service it would mention the small list of all options available.

SYSTEMD

Starting with Ubuntu 15.04, Upstart will be deprecated in favor of Systemd. With Systemd to manage the services we can do the following:
systemctl start SERVICE - Use it to start a service. Does not persist after reboot
systemctl stop SERVICE - Use it to stop a service. Does not persist after reboot
systemctl restart SERVICE - Use it to restart a service
systemctl reload SERVICE - If the service supports it, it will reload the config files related to it without interrupting any process that is using the service.
systemctl status SERVICE - Shows the status of a service. Tells whether a service is currently running.
systemctl enable SERVICE - Turns the service on, on the next reboot or on the next start event. It persists after reboot.
systemctl disable SERVICE - Turns the service off on the next reboot or on the next stop event. It persists after reboot.
systemctl is-enabled SERVICE - Check if a service is currently configured to start or not on the next reboot.
systemctl is-active SERVICE - Check if a service is currently active.
systemctl show SERVICE - Show all the information about the service.
sudo systemctl mask SERVICE - Completely disable a service by linking it to /dev/null; you cannot start the service manually or enable the service.
sudo systemctl unmask SERVICE - Removes the link to /dev/null and restores the ability to enable and or manually start the service.

UPSTART (Deprecated Since 15.04)

If we want to use the official Upstart way (Note that, for the moment, not all services have been converted to Upstart), we could use the following commands:
status SERVICE - This will tell us if a converted service is running or not. Note that this is deprecated in favor of startstopstatus & restart. It will also tell us if a service has not yet been converted to upstart:
A converted service would typically output the current status (Starting, Running, Stopping...) and process ID. A non converted service would give an error about an unknown job.
Some shortcuts may only work with the service command above but not with the commands below unless they are 100% converted to upstart services:
  • START - sudo start mysql
  • STOP - sudo stop mysql
  • RESTART - sudo restart mysql
  • STATUS - sudo status smbd

Enabling / Disabling a service

To toggle a service from starting or stopping permanently you would need to:
echo manual | sudo tee /etc/init/SERVICE.override
where the stanza manual will stop Upstart from automatically loading the service on next boot. Any service with the .override ending will take precedence over the original service file. You will only be able to start the service manually afterwards. If you do not want this then simply delete the .override. For example:
echo manual | sudo tee /etc/init/mysql.override
Will put the MySQL service into manual mode. If you do not want this, afterwards you can simply do
sudo rm /etc/init/mysql.override
and Reboot for the service to start automatically again. Of course to enable a service, the most common way is by installing it. If you install Apache, Nginx, MySQL or others, they automatically start upon finishing installation and will start every time the computer boots. Disabling, as mentioned above, will make use of the service manual.

[Windows] 設定系統分頁檔

顯示目前分頁檔設定

wmic pagefile
wmic pagefile list /format:list 

設定固定分頁檔大小

wmic computersystem where name="%computername%" set AutomaticManagedPagefile=False
wmic pagefileset where name="C:\\pagefile.sys" set InitialSize=2048,MaximumSize=2048

設定分頁檔後,檢查的方式

wmic pagefileset 
wmic pagefileset list /format:list

嗯!莫名踩雷了 mariadb-server

2018年5月31日 星期四

利用 MariaDb 架 nextcloud 平台,收集校務評鑑資料,一開始裝好了之後,用起來都很正常。
但是安全更新後把伺服器重新開機,就發現nextcloud 掛了,遠端登入後才發現是資料庫沒啟動,立馬手動執行
sudo systemctl restart mysqld.server
結果等了許多,跳出了另一個錯誤訊息
2018-05-29 13:46:04 139927905056960 [Note] Using unique option prefix 'myisam-recover' is error-prone and can break in the future. Please use the full name 'myisam-recover-options' instead.
2018-05-29 13:46:04 139927905056960 [Note] Using unique option prefix 'myisam-recover' is error-prone and can break in the future. Please use the full name 'myisam-recover-options' instead.
2018-05-29 13:46:04 139927905056960 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2018-05-29 13:46:04 139927905056960 [Note] InnoDB: Uses event mutexes
2018-05-29 13:46:04 139927905056960 [Note] InnoDB: Compressed tables use zlib 1.2.8
2018-05-29 13:46:04 139927905056960 [Note] InnoDB: Using Linux native AIO
2018-05-29 13:46:04 139927905056960 [Note] InnoDB: Number of pools: 1
2018-05-29 13:46:04 139927905056960 [Note] InnoDB: Using SSE2 crc32 instructions
2018-05-29 13:46:04 139927905056960 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2018-05-29 13:46:04 139927905056960 [Note] InnoDB: Completed initialization of buffer pool
2018-05-29 13:46:04 139927257839360 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2018-05-29 13:46:04 139927905056960 [Note] InnoDB: The first innodb_system data file 'ibdata1' did not exist. A new tablespace will be created!
2018-05-29 13:46:04 139927905056960 [Note] InnoDB: Setting file './ibdata1' size to 12 MB. Physically writing the file full; Please wait ...
2018-05-29 13:46:04 139927905056960 [Note] InnoDB: File './ibdata1' size is now 12 MB.
2018-05-29 13:46:04 139927905056960 [Note] InnoDB: Setting log file ./ib_logfile101 size to 50331648 bytes
2018-05-29 13:46:04 139927905056960 [Note] InnoDB: Setting log file ./ib_logfile1 size to 50331648 bytes
2018-05-29 13:46:04 139927905056960 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2018-05-29 13:46:04 139927905056960 [Note] InnoDB: New log files created, LSN=45790
2018-05-29 13:46:04 139927905056960 [Note] InnoDB: Doublewrite buffer not found: creating new
2018-05-29 13:46:04 139927905056960 [Note] InnoDB: Doublewrite buffer created
2018-05-29 13:46:04 139927905056960 [Note] InnoDB: 128 out of 128 rollback segments are active.
2018-05-29 13:46:04 139927905056960 [Note] InnoDB: Creating foreign key constraint system tables.
2018-05-29 13:46:04 139927905056960 [Note] InnoDB: Creating tablespace and datafile system tables.
2018-05-29 13:46:04 139927905056960 [Note] InnoDB: Creating sys_virtual system tables.
2018-05-29 13:46:04 139927905056960 [Note] InnoDB: Creating shared tablespace for temporary tables
2018-05-29 13:46:04 139927905056960 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2018-05-29 13:46:04 139927905056960 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2018-05-29 13:46:04 139927905056960 [Note] InnoDB: Waiting for purge to start
2018-05-29 13:46:04 139927905056960 [Note] InnoDB: 5.7.22 started; log sequence number 0
2018-05-29 13:46:04 139927905056960 [Note] Plugin 'FEEDBACK' is disabled.
2018-05-29 13:46:04 139927905056960 [ERROR] Could not open mysql.plugin table. Some plugins may be not loaded
2018-05-29 13:46:04 139927905056960 [ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist
2018-05-29 13:46:04 139927905056960 [Note] Server socket created on IP: '127.0.0.1'.
2018-05-29 13:46:04 139927905056960 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
本來以為是資料庫故障了,結果切換到 /var/lib/mysql 後,發現資料庫、資料表似乎都在,疑問之下,開啟  /var/log/syslog ,發現又一串錯誤訊息…
May 30 20:15:45 ubuntu systemd[1]: Starting MariaDB 10.2.15 database server...
May 30 20:15:46 ubuntu kernel: [97757.266462] audit: type=1400 audit(1527682546.054:13): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/12073/status" pid=12073 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=106 ouid=106
May 30 20:15:46 ubuntu kernel: [97757.266776] audit: type=1400 audit(1527682546.054:14): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/" pid=12073 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=106 ouid=0
May 30 20:15:46 ubuntu kernel: [97757.267025] audit: type=1400 audit(1527682546.054:15): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/12073/status" pid=12073 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=106 ouid=106
May 30 20:15:46 ubuntu kernel: [97757.357815] audit: type=1400 audit(1527682546.142:16): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/etc/mysql/mariadb.conf.d/" pid=12073 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=106 ouid=0
May 30 20:15:46 ubuntu mysqld[12073]: #007/usr/sbin/mysqld: Can't read dir of '/etc/mysql/mariadb.conf.d/' (Errcode: 13 "Permission denied")
May 30 20:15:46 ubuntu mysqld[12073]: #007/usr/sbin/mysqld: Can't read dir of '/etc/mysql/mariadb.conf.d/' (Errcode: 13 "Permission denied")
May 30 20:15:46 ubuntu mysqld[12073]: Fatal error in defaults handling. Program aborted

May 30 20:15:46 ubuntu kernel: [97757.360216] audit: type=1400 audit(1527682546.146:17): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/etc/mysql/mariadb.conf.d/" pid=12073 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=106 ouid=0
May 30 20:15:46 ubuntu systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE

May 30 20:15:46 ubuntu systemd[1]: Failed to start MariaDB 10.2.15 database server.
May 30 20:15:46 ubuntu systemd[1]: mariadb.service: Unit entered failed state.
May 30 20:15:46 ubuntu systemd[1]: mariadb.service: Failed with result 'exit-code'.
本來以為是 DB 設定檔出了問題,也懷疑過 mariadb-common 和 mysql-common 這 2 個系統自己裝進來的套件,混在一起後有衝突,調整了許久還是無法啟動。
後來再仔細看了一下 log 內容,似乎是被 denied ,permission 不夠,苦搜了許久,終於把這雷也掃了,結論:
編輯   /etc/apparmor.d/usr.sbin.mysqld,增加下列內容,重新啟動服務後,正常!呼!
/etc/mysql/*.cnf r,
/{,var/}run/mysqld/mysqld.pid w,
/{,var/}run/mysqld/mysqld.sock w,
/usr/lib/mysql/plugin/ r,
/proc/*/status r,
/sys/devices/system/node/ r,
/sys/devices/system/node/node0/meminfo r,
/run/systemd/notify w,


lftp 下載/上傳整個目錄

2018年4月23日 星期一

lftp 比 ftp 方便多了,特別當需要上傳或下載整個目錄時,特別方便。
下載整個目錄   mirror  <dir_name>
上傳整個目錄   mirror  -R  <local_dir_name>