Skip to content

Instantly share code, notes, and snippets.

View chiehwen's full-sized avatar

Chuck Yang chiehwen

View GitHub Profile
cat /etc/lsb-release; uname -a
DISTRIB_ID="elementary OS"
DISTRIB_RELEASE=0.2.1
DISTRIB_CODENAME=luna
DISTRIB_DESCRIPTION="elementary OS Luna"
Linux laptop 3.11.0-13-generic #20~precise2-Ubuntu SMP Thu Oct 24 21:04:34 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
lsmod| grep ath
  • pflua
  • pflua is a high-performance network packet filtering library written in Lua. It supports filters written in pflang, the filter language of the popular tcpdump tool.
grub rescue>

使用 diskutil 工具來查看 Mac 系統下的硬碟使用狀況

% diskutil list
/dev/disk0
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *1.0 TB     disk0
   1:                        EFI EFI                     209.7 MB   disk0s1
   2:                  Apple_HFS Macintosh HD            999.7 GB   disk0s2
   3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3
/dev/disk2
% /usr/local/Cellar/qt5/5.3.1/bin/qmlscene ~/projects/opensource-work/HanGee/OwaNEXT/content/launcher/Launcher.qml

Node.js 模組介紹

  • http 模組封裝了 HTTP 的處理細節。
  • request 模組是一個簡單的 HTTP(S) 客戶端,它簡化使用 httphttpsnetstream 等模組的複雜度。
% sudo lsof -i -P | grep -i "listen" | grep 27017
vmnet-nat 57253           root   12u  IPv4 0x81ede726c1d62961      0t0    TCP *:27017 (LISTEN)
% lsof -n -i | awk '{ print $1,$9; }' | sort -u

註:Formula 就是套件名稱,你在官方文件或 help 上會經常看到 FORMULA... 這個英文字彙,在 Homebrew 中,它即是套件名稱。

  • 查看有哪些指令可以使用
% brew help
  • 查詢有無 MongoDB 的套件
% brew search mongodb

使用 CoffeeScript 開發 JavaScript

Ruby on Rails 從 3.1 版開始,將 CoffeeScript 納入其框架中,預設內建就支援 CoffeeScript。

安裝 CoffeeScript 與基本用法

  • 使用 NPM 安裝 CoffeeScript
% npm install -g coffee-script