發表文章

目前顯示的是有「Git」標籤的文章

[Bottender] 如何在 Heroku 上部屬 LINE BOT

上一篇文章是 2015 了呢.... 主要是之前已經寫過一個簡單的 LINE BOT, 但最近剛好有點時間(?),所以想要藉此機會全部重寫。 之前寫的機器人原始碼在這邊 https://github.com/Rainsting/TarotLineBot --------------------------------------------------------------------------------------- 這次我選擇由台灣人自己新開發的機器人框架 - Bottender, 在此時的版本是 v0.15.0。 由於這整包在中文圈內的討論似乎不多,大部分都是拿來用在 FB Messenger 上, 對於 LINE BOT & Heroku 的著墨很少,希望藉由這一篇簡單做個記錄。 1. 首先申請個 LINE@ 帳號,並開啟 developer 功能: 網路上其實很多資訊了,這邊就不多說,建議可以參考前人的文章: LINE BOT 實戰 ( 原理篇 ) http://www.oxxostudio.tw/articles/201701/line-bot.html 這邊目的是取得 Channel secret & Channel access token,之後會用到。 2. 申請 Heroku 帳號,並安裝 Heroku CLI: 一開始用免費帳號就足夠了,申請帳號也可參考前人的教學: Heroku安裝使用教學 https://ericjhang.github.io/archives/689940fd.html 3. 將 Heroku 產生的 Domain 連結到 Line Develop Console 的 Webhook URL 內 位置在 Heroku 的 Settings,複製底下 Domains and certificates 的後面那一段, 4. 安裝 bottender (以 Windows 為例) 首先按照官網步驟,使用 npm 安裝 bottender 套件 https://bottender.js.org/docs/GettingStarted npm install -g bottender 先自己取個好聽的名字,之後在過程中 ...

設定 Git 的環境變數 - Git config

這裡記錄一下目前會用到的 git config 設定 # 設定使用者資訊 git config --global user.name "Steven" git config --global user.email "steven@helloworld.com" # 設定顏色顯示 git config --global color.ui auto git config --global color.diff auto git config --global color.status auto git config --global color.branch auto git config --global color.log auto # 設定 alias git config --global alias.st status git config --global alias.co checkout # 如要忽略空白的比對,可增加以下這個 git config --global apply.whitespace nowarn 設定完之後,在個人的家目錄底下去 cat .gitconfig ,即會看到此資訊 [ push ] default = matching [ alias ] st = status # 設定 status 縮寫 co = checkout # 設定 checkout 縮寫 [ color ] ui = auto # 設定 ut 的顏色為 auto diff = auto # diff status = auto # status branch = auto # branch log = auto # log, 以上這幾種都會自動標色 [ user ] name = Steven Wu email = steven@helloworld.com 參考資料: http://gogojimmy.net...

在舊版 Ubuntu 底下安裝新版 git 套件 (以 Ubuntu 8.04 hardy 為例)

最近由於工作需求,需要在舊版的 Ubuntu 上面安裝 git 套件, 但由於舊版的 Ubuntu 版本已不支援「直接」透過 apt-get update 來更新 source list, 於是用了另一種方法來直接安裝 git,方法如下: 下載目前最新版的 git-1.8.4.1 版本,並且解壓縮並安裝 wget http://www.kernel.org/pub/software/scm/git/git-1.8.4.1.tar.gz tar zxvf git-1.8.4.1.tar.gz cd git-1.8.4.1 ./configure make make install 之後就可以開心的建立 Git repository 了! 參考資料: http://serengetisunset.blogspot.tw/2009/02/installing-git-1613-on-ubuntu-804.html