2013年4月9日 星期二
列出CitrixXenserver 所有的VLAN tag (以遞增的方式排序)
xe vlan-list params=tag --minimal | awk 'BEGIN{FS=","} {for(i=1;i<NF;i++) print $i}' | sort -n | uniq
awk的BEGIN與END區塊
BEGIN
A
BEGIN rule is executed, once, before the first input record has been readPS:
If an
awk program only has a BEGIN rule, and no other rules, then the program exits after the BEGIN rule has been run. (Older versions of awk used to keep reading and ignoring input until end of file was seen.)END
An
END rule is executed, once, after all the input has been readBEGIN and END rules must have actions; there is no default action for these rules since there is no current record when they run.Reference
[1] awk的BEGIN與END區塊, http://lalakiwe.myweb.hinet.net/Documents/awk/awk_appendix.html
[2] http://www.staff.science.uu.nl/~oostr102/docs/nawk/nawk_52.html
2013年4月8日 星期一
2013年4月5日 星期五
Object Storage Device
An Object-based Storage Device (OSD) is a computer storage device, similar to disk storage but working at a higher level. Instead of providing a block-oriented interface that reads and writes fixed sized blocks of data, an OSD organizes data into flexible-sized data containers, called objects. Each object has both data (an uninterpreted sequence of bytes) and metadata (an extensible set of attributes describing the object).
Reference:
[1] http://en.wikipedia.org/wiki/Object_storage_device
[2] http://lab.howie.tw/2013/04/
[3] https://researchweb.watson.ibm.com/haifa/projects/storage/objectstore/papers/PositionOSD.pdf
[4] http://www.ascc.sinica.edu.tw/sysinfo/storage/conference/object-sun.pdf
2013年4月3日 星期三
keystone endpoint系列api
endpoint-create Create a new endpoint associated with a service
endpoint-delete Delete a service endpoint
endpoint-get Find endpoint filtered by a specific attribute or service type
endpoint-list List configured service endpoints
endpoint-create
keystone endpoint-create [--region <endpoint-region>] \
--service-id <service-id> \
[--publicurl <public-url>] \
[--adminurl <admin-url>] \
[--internalurl <internal-url>]
endpoint-delete
endpoint-get
endpoint-list
2013年4月2日 星期二
sed進階應用
sed 's/被取代的字串/要取代的字串/'
sed -r 's/^(admin_token) = (.*)/\1 = '要代換的token'/g'
\1: 代表暫存,然後在要取代的字串中取回
-r , regular expression
# sed的examples
http://www.theunixschool.com/2012/06/sed-25-examples-to-delete-line-or.html
http://www.grymoire.com/Unix/Sed.html
2013年4月1日 星期一
SSH Tunneling(a.k.a SSH Port Forwarding)
Port forwarding, or tunneling, is a way to forward otherwise insecure TCP traffic through SSH Secure Shell. You can secure for example POP3, SMTP and HTTP connections that would otherwise be insecure.
Local Tunneling
Remote Tunneling
訂閱:
文章 (Atom)