Skip to main content

· 2 min read

隨著 Firefox OS1,黑莓 BlackBerry 102,與 Windows Phone3三種行動裝置 OS 都陸續傳出退出消費市場或停產的消息,表明現在行動裝置 OS 已大勢底定,由 Android 與 iOS 二分天下。

最近甚囂塵上的傳言4是 Google 將在下周發表 Android 與 Chrome OS 合併的作業系統 Andromeda (英文中是 "仙女座" 的意思。有人跟我一樣感覺這唸起來尾音頗像韓國話嗎?)。這讓我想起 2008 年的時候,我寫過一篇Androbian?短評關於 Android 與 Symbian 將合併的傳言。裡面引用了一段話:

How they will merge two platforms that have so many things different about them is beyond us. One is chocolate, the other is peanut butter. Two completely different things. However, we know how good they taste together!

一邊是巧克力,另一邊是花生醬,兩者是完全不同的東西。但是,我們都知道巧克力花生醬嚐起來是多麼地美味!

這樣相對樂觀的期待,仍然可以套用在新的傳言上。

· 3 min read

Imgur

承上一篇,我工作用的桌機通常灌的是 Ubuntu(Linux)系統。筆電則是在 Windows 10 上灌 Ubuntu VM 解決。

但上個月我的桌機從 16.04LTS 升級到 16.04.1 時,竟然升級失敗無法開機,這讓我很火。 於是利用這個機會,我嘗試安裝了 MintElementary OS1。 Mint 和 Elementary OS 都是 Ubuntu 的衍生版本,所以在套件和命令行使用上與 Ubuntu 一致,在重新設定開發環境時比較不會遇到困難。

兩者嘗試後,最終是 Elementary OS 的高顏值與類似 Mac OS 的使用經驗,讓我決定繼續用下去。 當時安裝的版本是基於 Ubuntu 14.04LTS 的 Elementary OS 0.3 版 (Freya)。至目前使用上相當滿意,終於可以擺脫不甚順手的 Unity 桌面了。

就在前幾周,基於 Ubuntu 16.04LTS 的 Elementary OS 0.4 版 (Loki)終於釋出了。 但是新版本竟然不支援直接從舊版升級,於是我依然錯過在第一時間試用新版本的機會。

今天心血來潮再次搜尋了一下 vagrant 上是否有提供 Elementary OS 的 Box,很幸運找到了

步驟:

  1. 在 Windows 10 上按視窗鍵,搜尋 cmd 並開啟
  2. 在命令行工具中輸入以下 2 行命令,以啟動一個 Elementary OS VM
vagrant init TimWSpence/elementaryos
vagrant up

第一次啟動後要開啟 VirtualBox 並選擇「顯示」,之後就不需再用到 vagrant 命令了。 vagrant box 所使用的登入的密碼是 "vagrant"。

啟動後我照著11 things to do after install Elementary OS Loki 文章的建議,安裝了一些工具。 同時因為我的 Dell XPS 13 (9495) 筆電解析度較高,預設的解析度之下每個字都超級小,我透過 gsettings 命令多設定了 text scaling:

gsettings get org.gnome.desktop.interface scaling-factor
gsettings set org.gnome.desktop.interface scaling-factor 2

在做了這個修改之後,才得到對眼睛比較友善的使用界面。(如題圖)

· 2 min read

幾周前透過 Ubuntu 升級筆電的 Firmware 後,Ubuntu 竟然就再也無法正確抓到無線網卡了!

我想說那就趁這機會重灌 OS 吧!然而在嘗試灌各種 Linux 套件(Elementary OS Loki (Beta), Ubuntu 16.04, Ubuntu 14.04)都抓不到網卡驅動程式後,只好乖乖灌回 Windows 10。

由於在筆電上依然需要一個 Linux 工作環境,我就之前的經驗繼續使用 vagrant 來建立工作環境 VM。安裝好VirtualBoxVagrant後,只需要 2 行命令即可安裝完成,而且之後隨時可以砍掉重新開一個全新的 VM。

步驟:

  1. 在 Windows 10 上按視窗鍵,搜尋 cmd 並開啟
  2. 在命令行工具中輸入以下 2 行命令,以啟動一個 Ubuntu VM
vagrant init boxcutter/ubuntu1604-desktop
vagrant up

第一次啟動後要開啟 VirtualBox 並選擇「顯示」,之後就不需再用到 vagrant 命令了。 vagrant box 所使用的登入的密碼是 "vagrant"。

由於 Vagrant 使用最小化地配置 VM 可使用的 CPU 和記憶體,對於桌面開發環境來說有些不夠用。我會到 VirtualBox 中修改「配置」,去適量增加可用的記憶體數值。 目前這方式在 Windows 上運作地相當順利。

· 2 min read

Imgur

I just migrated my blog from Blogger to Github (via Hexo)! Because I'd like to use Markdown to write things efficiently (format, syntax highlight...), and think if I can finally integrate blog as part of my homepage (which soon or later will be hosted on github).

Migrate from blogger

To migrate from blogger, I use these instructions:

npm install -g hexo-cli
mkdir blog && cd blog
npm install --save hexo-migrator-rss
hexo migrate rss https://www.blogger.com/feeds/xxxxxxx/posts/default?max-results=600

xxxxxxx is your blog id which can be found from url bar of blogger's admin panel.

To test render result locally, run

hexo s --debug

To generate static file then update to github, run

hexo generate --deploy --debug

If you have amount of articles like me (about 500 articles), make sure you have allocate enough memory if you run the command in VM.

The template comes from hexo-theme-next with great document.

Make sure you've follow "Setting up a custom subdomain" , and install hexo-generator-cname to generate CNAME file for your static web site.

npm install --save hexo-generator-cname

Add cname property in _config.yml:

cname: blog.gasolin.idv.tw

You can check _config.yml and themes/ for my site configurations.

The theme customization is done via npm scripts. You can check package.json::scripts for detail.

deploy automatically via travis CI

Read

for step by step instructions. Or you can check My version of .travis.yml with hexo-theme-next gitsubmodule

SEO enhancements

Read 如何向 google 提交 sitemap (in chinese) to send sitemap.xml to google for better indexing.

Update theme

Use command

git submodule foreach git pull origin master

to update your theme. Read Update Git submodule to latest commit on origin for more detail.

· 2 min read

「聊天機器人一份,不加咖啡」是今年在 Coscup 2016 分享的講題,投影片在此。 內容包含介紹聊天機器人與 Hubot,轉換 Coffeescript 到 ES6,與移植經驗總結。

Webbybot 是我們將 Hubot 完全移植到 ES6 的成果。在準備這場演講時,有鑑於 Server Side 聊天機器人設定上還是稍嫌複雜,於是我參考 Hubot 架構,做了原始版本只有 80 行的網頁端聊天機器人。除了支援聊天機器人基本功能外,同時也支援擴充腳本 (plugin) 與擴充功能 (addon)。由於參考了 Hubot 架構,於是命名時就取了Saihubot 這個既包含 Hubot,又有濃濃台味的名稱(SaiHu 即台語的「師傅」)。

這次活動官方有提供 LINE 版的聊天機器人。我在活動早上花幾小時基於 Saihubot 做了 Coscup 2016 網頁版機器人,可以上去玩玩。

要做一個自己的網頁聊天機器人,只須在 github 上 fork 專案,然後就可以直接在 Github 上編輯,修改後的結果直接反應到 https://[your name].github.io/saihubot 網站上。修改極端容易,畢竟核心只有不到 100 行,對聊天機器人有點興趣的人可以照著上述說明試試,看看原始碼,當然若能送個 Issue 或 Pull Request,這場「扎根」議程達到的效果就最好了。