重有巴士阿叔
- 轉貼節錄:欠缺「可能」的土炮網絡 + 巴士判官 判了什麼? Quote: 這裏想強調的是,網絡對事件的態度和反應,並沒有和已高度市場化娛樂化的本地傳統媒體有多大的分別
- 〈巴士大叔〉現象啟示 Quote: 這時候影像必侵襲
I know of three command-line programs that will fiddle with theX selection (and/or the cut buffers) in a way that's usefulfor shell scripts: xsnarf from Smarasderagd's collectionof X things , xcb , and xclip .
I use xsnarf for a variety of reasons, I think partly historical (inthat I had it around well before I found the others); I'm jotting downthe other two here partly so that I have the information handy the nexttime someone asks me
In the spirit of my little shell scripts, here's a simple way to get auseful summary of disk space usage on a Unix system:
du | sort -nr | less
(substitute the pager of your choice for less , and use ' du -x ' asnecessary.)
This is less pretty than the various graphical disk space visualizationprograms that float around, but I find it gives me pretty much theinformation I need. It's pretty easy to narrow down what areas of thefilesystem,
This is one of those Bourne shell idioms where I show the code firstand explain the effect later:
#!/bin/shdef=$1; shiftcase "$#" in 0) if test -t 0; then cat -- $def else cat fi;; *) cat -- "$@";;esac
Call this selfile . You use it in things like log scanning scripts,invoking it as:
selfile /var/log/something "$@" | .
重有巴士阿叔
Every so often in my Python programs I need to initialize adictionary with a whole bunch of values (and then pass it offsomewhere). For a long time, my usual approach to this was:
d = {}d['a'] = b.whatd['c'] = foo(d)....Recently I stumbled over the better way to do this, which isembarrassingly obvious in retrospect:
d = { 'a': b.what, 'c有學校為怕學生駁嘴,竟然禁止學生講「有壓力」、「未解決」,其實巴士阿叔事件,是很好的通識課內容,何不借此機會,讓學生思考一下事件背後反映了什麼?
好了,各位同學,請試答以下問題:
(一) 阿叔篇