發表文章

lsync - 簡單操作的Linux同步服務

lsync - 簡單操作的Linux同步服務 lsync是一個可以基於rsync傳輸的同步服務,他的好處是可以透過一個簡單的設定檔,即可完成自動化同步作業,讓管理上非常簡單。這邊簡單的以AWS與Google Cloud的兩台雲端主機進行同步作業: Remote: 54.172.25.83 (AWS US-East/N.Virginia) Local: 130.211.248.60 (GCE asia-east1-c) 安裝lsync Debian系列: apt -get update apt -get install git -y apt -get install cmake -y apt -get install build -essential -y apt -get install lua5 .2 apt -get install liblua5 .2 -dev -y git clone https: //github.com/axkibe/lsyncd.git cd lsyncd cmake -DCMAKE_INSTALL_PREFIX = /usr/ local /lsyncd - 2.1 .5 make && make install CentOS系列需要自行下載rpm安裝,可以參考附錄的文件: 執行範例 範例設定檔,在這邊是使用rsync的方式作為傳輸方法~ settings { logfile = "/usr/local/lsyncd-2.1.5/var/lsyncd.log" , statusFile = "/usr/local/lsyncd-2.1.5/var/lsyncd.status" , inotifyMode = "CloseWrite" , maxProcesses = 8 , } sync { default.rsync, source = "/var/www/html" , target = "ec2-user@54.172.25.83:/home/ec2-user/ba...

Test upload常用的兩個方法

常常忘記,還是寫下來好了... Step1: Configure your upload Reference: https://github.com/expressjs/multer Step2: Make a route for receive upload router.post('/uploadtest', function(req, res, next) {   res.end('done...'); }); Step3: Testing Upload using curl: curl -F "image=@/Users/peihsinsu/Pictures/pic2.png" http://localhost:3000/uploadtest -X POST Upload using upload form: <form method="post" action="/uploadtest" name="submit" enctype="multipart/form-data">   <input type="file" name="fileField"><br /><br />   <input type="submit" name="submit" value="Submit"> </form>

電子郵件夾錢~這是什麼概念啊!!

圖片
偶然中發現,Gmail可以夾錢給收件人唷!這概念還真不賴... 哪時候有人夾錢給我呢@@

You've been added as a contact on Cotap

圖片
Cotap is a secure texting app for teams. View the Blogger directory. Get Started ...

CloudFlare改頭換面!

圖片
最近流行換新裝?! Cloudflare改頭換面啦 :D

docker mysql image encoding change to utf8

最近在使用docker的mysql image掛載mysql db時候 發現server的語系都是在latin1的狀態 而mysql image又不允許直接把my.cnf換掉... 但是可以overwrite /etc/mysql/conf.d這個資料匣 來重寫mysqld的語系設定... 這是原始資料庫啟動後透過"\s"來查看server狀態 # mysql -h123.123.123.123 -uroot -p Enter password: Welcome to the MySQL monitor.  Commands end with ; or \g. Your MySQL connection id is 3 Server version: 5.5.42 MySQL Community Server (GPL) Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> \s -------------- mysql  Ver 14.14 Distrib 5.5.41, for debian-linux-gnu (x86_64) using readline 6.2 Connection id: 3 Current database: Current user: root@123.123.123.123 SSL: Not in use Current pager: stdout Using outfile: '' Using delimiter: ; Server version: 5.5.42...

簡單的SSHFS mount...

圖片
前陣子看到nixCcraft所PO的 SSHFS文章 ,一直想找機會試試看 今天有機會來玩一下 :D Debian上還滿簡單,只要直接安裝即可: sudo apt-get install sshfs -y CentOS上,如果安裝時找不到套件,可以先安裝epel-release後再進行安裝 sudo yum install epel-release -y sudo yum install fuse-sshfs -y 接著,就可以操作mount的動作 實際測試一下速度 - sshfs建立100M檔案: 與自己本身建立100M檔案: 與iscsi比較一下 上述測試是在Google Cloud上主機上進行 100M的檔案在2s左右完成傳輸,實際上效能還不錯 但跟local比契還來是慢了近20倍 以方便性而言sshfs的確方便 但是考慮效能的應用程式,還是需要好好考慮一下唷~ 補充一下大家最常用的NFS