Skip to content

Instantly share code, notes, and snippets.

View snow-swallow's full-sized avatar

swallow in the snow snow-swallow

View GitHub Profile
# 適用於【鼠鬚管】0.9.13+
# 位置:~/Library/Rime/squirrel.custom.yaml
# 用法:想要哪項生效,就刪去該行行首的#字符,但注意保留用於縮進的空格
patch:
# us_keyboard_layout: true # 鍵盤選項:應用美式鍵盤佈局
# show_notifications_when: growl_is_running # 狀態通知,默認裝有Growl時顯示,也可設爲全開(always)全關(never)
# style/horizontal: true # 候選窗横向顯示
# style/font_face: "儷黑 Pro" # 我喜歡的字體名稱
# style/font_point: 21 # 字號
@snow-swallow
snow-swallow / killps.sh
Last active December 12, 2015 05:28
It's a shell for killing process by your port in osx. 1) sudo mv killps.sh /usr/local/bin ## enter your local environment. 2) chmod +x killps.shell 3) killps 9001 ## enter the process port you wanna kill.
#! /bin/sh
lsof -n -i4TCP:$1 | grep LISTEN
pid=`lsof -n -i4TCP:$1 | grep LISTEN | awk '{print $2}'`
## when it is ubuntu, just replace '4TCP' to '6TCP' in line3.
if [ $pid ]
then
kill -9 $pid
echo "[`date "+%Y-%m-%d %H:%M:%S"`] Process kill successfull!"
else
echo "[`date "+%Y-%m-%d %H:%M:%S"`] No process exists on port $1."