Somewhere I Belong

All about geek's life


  • 首頁

  • 歸檔

  • 關於

  • 標籤

  • 開源專案

Raspberry Pi 樹莓派編譯新核心

發表於 4月 27 2015 | 0 Comments

前陣子在家門口踢到一個…

Raspberry Pi 二代目 Model B,然後就 過著開開心心的生活 開始想把一堆東西裝上去然後不知道要幹嘛!?書房的 Hub 滿了,所以我就要拿出之前買的 小米隨身WiFi 拿出來插上…

就會發現,什麼事都沒有發生。因為…Driver 沒有進 Kernel 根據非官方 Github 上的 Repo 顯示:

This repository is based on the original driver released by MediaTek which was rejected from Linux kernel because of the poor code quality.

嗯!所以展開自編之路…

閱讀全文 »

架設 NFS Server 共享檔案 (Debian/Ubuntu)

發表於 12月 22 2014 | 0 Comments

Server

sudo apt-get install nfs-kernel-server

設定檔簡單設定一下

# /etc/exports: the access control list for filesystems which may be exported
# to NFS clients. See exports(5).
#
# Example for NFSv2 and NFSv3:
# /srv/homes hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check)
#
# Example for NFSv4:
# /srv/nfs4 gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)
# /srv/nfs4/homes gss/krb5i(rw,sync,no_subtree_check)

/home/zack/Dropbox/project 192.168.1.69(rw,sync,no_subtree_check)

Client

安裝 nfs-common
apt-get install nfs-common

檢查 host 有開放那些掛載點
showmount -e 192.168.1.222

把 222 的 project 掛到本機來
mount -t nfs 192.168.1.222:/home/zack/project /home/zack/project

以上基本就搞定囉!

Mosquitto 如何訂閱 bridge 連線狀態?

發表於 12月 19 2014 | 0 Comments

一般來說如果要得知 mqtt client 是不是離線了,可以透過 will message 來設定。但是 mosquitto 的貼心功能 bridge 要怎麼實現這個功能呢?

本來看使用說明 /$SYS 這部分沒找到,原來藏在 mosquitto.conf 的說明文檔中…

notifications [ true | false ]

If set to true, publish notification messages to the local and remote brokers giving information about the state of the bridge connection. Retained messages are published to the topic $SYS/broker/connection/<clientid>/state unless otherwise set with notification_topics. If the message is 1 then the connection is active, or 0 if the connection has failed. Defaults to true.

notification_topic topic

Choose the topic on which notifications will be published for this bridge. If not set the messages will be sent on the topic $SYS/broker/connection/<clientid>/state.

很明顯可以看出只要訂閱 $SYS/broker/connection/<clientid>/state 即可,上線會傳 0 反之就是 1

如此一來就不用自己做 keepalive 功能啦!

詳細說明:http://mosquitto.org/man/mosquitto-conf-5.html
$SYS/broker 詳細說明:http://mosquitto.org/man/mosquitto-8.html

Docker 運行在 ARMv7 (MOXA UC8100)

發表於 12月 19 2014 | 0 Comments

暨上週參加完 Container Summit 後,這天下班前忽然手癢把之前還沒搞定的 Docker on ARMv7 (Debian 7.7 Wheezy) 再玩一遍…

閱讀全文 »

2014 Container Summit 技術高峰會

發表於 12月 12 2014 | 0 Comments

早在幾個月前就陸續有小玩 Docker,也在公司內架了…

  • Gitlab
  • PostgreSQL
  • Elasticsearch
  • Logstash
  • Kibana

主要是剛好想玩玩上面幾個服務又不想要弄髒開發環境也不想要開新的 VM …Docker 之旅就此展開…

閱讀全文 »

由 Dropbox 產生 "衝突的複本" 造成 Git 錯誤

發表於 12月 12 2014 | 1 Comment

是說今天參加 Container Summit 回家想要更新網誌推個 code 結果發現悲劇,故事就此展開…

因為我把整個 Project 放在 Dropbox 裡面,然後之前好像是因為網路不穩沒同步導致後來出現一堆 衝突的副本檔案!原先不以為意看到一個才砍一個…

結果今天要 Push 的時候就爆炸惹…

On branch master
nothing to commit, working directory clean
fatal: Reference has invalid format: 'refs/heads/master (與 YuLun的MacBook Air 衝突的複本 2014-12-07)'

一氣之下趕緊把所有這些衝突的檔案給他砍光光

cd YOUR_DIR
find . -type f -name "* conflicted copy*" -exec rm -f {} \;

若還需要刪除 packed-refs file 的內容再執行下面指令

awk '!/conflicted/' .git/packed-refs > temp && mv temp .git/packed-refs

打完收工結束這個回合。

PS. conflicted copy 是英文版產生的檔案,對應到中文就是 衝突的副本

參考資料:Git fatal: Reference has invalid format: ‘refs/heads/master

開發 Pebble WatchApp 的一些心得

發表於 12月 7 2014 | 0 Comments

這週六跟幾個朋友一起分享最近的所見與所得,當然啦~藉這個機會宣傳一下我之前寫的 Uber Now

投影片連結:http://slides.com/yulunshih/pebble

Rsync 更改預設 SSH Port

發表於 12月 1 2014 | 0 Comments

一般 Rsync 指令如下

rsync -av /home/zack username@host

若要更改 SSH PORT (default 22) 的話則可下

rsync -av -e 'ssh -p 2222' /home/zack username@host

常常會忘記…紀錄一下

Python Queue.get(timeout) 消耗異常 CPU Usage

發表於 12月 1 2014 | 0 Comments

之前在開發 Sanji Framework 的時候發現,Python 當中提供的 Queue — A synchronized queue class 如果使用 Queue.get(timeout=X) 會吃很多 CPU。

這…很奇怪呀!理論上如果 Queue 是空的應該不會占用很多 CPU …

閱讀全文 »

修改 Git commits 的作者資訊

發表於 11月 29 2014 | 0 Comments

昨天晚上在家改公司的專案,一時不察就直接 git commit -am "回家寫扣真辛苦",赫然發現…啊啊啊啊 Git 作者 是我平常在外面闖蕩用的 name + email

這下該怎辦呢?好在找到這篇 StackOverflow 上的文章,一步一步教你改…

閱讀全文 »
1234…7

YuLun Shih

70 文章
6 分類
127 標籤
RSS
GitHub E-Mail Twitter
© 2017 YuLun Shih