Skip to main content

· 2 min read
From Dubai Airport (The image is dragable to change view 可以拖曳照片來改變視角喔)

之前寫過一篇使用手機上傳 360 圖片到 Facebook,但其實要分享 360 照片1的話,我們也可以用aframe自己弄個網頁來分享。

將照片放在自己空間的缺點是所有工作得自己來。我用yeoman寫了個的 360 照片網頁產生器generator-360-photo,可以用來產生如上的 360 照片網頁 (照片與照片網頁都放在 github page,透過 iframe 嵌入),簡化了自己弄網頁來分享 360 照片的難度。

generator-360-photo在產生展示 360 照片網頁的同時,也對照片做優化。由於嵌入到 600x400 空間的圖檔解析度不需要太大,原本圖檔大小 5.6MB,解析度 5660x2830,優化為解析度 2048x1024 的圖檔後,大小只剩下 481KB。下載時間只需要原來的 1/11。

使用前需要使用 npm 安裝 yeoman 和 generator-360-photo

npm install -g yo
npm install -g generator-360-photo

generator-360-photo 用到sharp來最佳化照片,如果在 Ubuntu linux 或 windows bash 環境下,需要使用

apt install build-essential

命令安裝必要的編譯工具。

安裝後切換到放照片的資料夾,就可以使用

yo 360-photo

命令來建立 360 照片網頁啦。

如果使用上有遇到什麼問題或建議,可以前往專案網頁回報。

· 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.