2013年4月19日 星期五

dd : convert and copy a file 檔案備份


dd主要是用來讀取裝置的內容然後製作成檔案,所以它可以用來"備份"東西。


dd  if=<INPUT-FILE>  of=<OUTPUT-FILE>


if=FILE
     read from FILE instead of stdin

of=FILE
     write to FILE instead of stdout

bs, bytes
      代表一次讀寫多少個bytes

count=BLOCKS
       copy only BLOCKS input blocks


Quantum Server with plugins








Open vSwitch plugins vs Linux Bridge plugins




Provider Networks


Provider networks



Provider networks就是讓cloud admin可以在datacenter中建立直接與實體網路(Physical Networks)對應的Quantum網路(Quantum Networks)。


Provider Network的用途

  • 讓tenant可以直接存取Public Network:
    This is commonly used to give tenants direct access to a "public" network that can be used to reach the Internet.  
  • 與VLAN做整合:
    It may also be used to integrate with VLANs in the network that already have a defined meaning 

      (e.g., allow a VM from the "marketing" department to be placed 
       on the same VLAN as bare-metal marketing hosts in the same data   center).



    The provider extension allows administrators to explicitly manage the relationship between Quantum virtual networks and underlying physical mechanisms such as VLANs and tunnels.

    When this extension is supported, Quantum client users with administrative privileges see additional provider attributes on all virtual networks, and are able to specify these attributes in order to create provider networks.


As of the Folsom release, the provider extension is supported by the openvswitch and linuxbridge plugins. 

PS: Configuration of these plugins requires familiarity with this extension.

XFF: X-Forwarded-For



The X-Forwarded-For (XFFHTTP header field is a de facto standard for identifying the originating IP address of a client connecting to a web server through an HTTP proxy or load balancer.

PS: 
   de facto standard簡單來說就是不成文的規定,已被大眾所接受的事實。其中de facto源自於拉丁語。

This is an HTTP request header which was introduced by the Squid caching proxy server's developers. An effort has been started at IETF for standardizing the Forwarded HTTP header.[1]


Reference
http://en.wikipedia.org/wiki/X-Forwarded-For

2013年4月18日 星期四

SQL Catalog Driver / Template Catalog Driver




1. SQL Catalog Driver


2. Template Catalog Driver

10 lsof Command Examples in Linux



10 lsof Command Examples in Linux

lsof meaning ‘LiSt Open Files’ is used to find out which files are open by which process. As we all know Linux/Unix considers everything as a files (pipes, sockets, directories, devices etc). One of the reason to use lsof command is when a disk cannot be unmounted as it says the files are being used. With the help of this command we can easily identify the files which are in use.

http://www.tecmint.com/10-lsof-command-examples-in-linux/

在社群上開發新Features



傳統在社群上要開發新Feature必須經過以下流程:
  • 在Maillist 宣布,讓大家都能知道,是否能接受
  • 公開Function Spec & Design
  • JIRA ticket for feature
  • Setup a Dev Environment
  • Branch on github use your own (publich) branch
  • Submit changes to Review board
  • Post-reviw for large package of changes
  • Decide on the wiki you want

Reference:

2013年4月16日 星期二

word目錄頁碼對齊

可利用"定位點"來做目錄頁碼
將游標停在章節字的後面(虛線的前面)
從:格式/定位點→設定定位點停駐位置
(若不確定位置,可直接在尺規上面點一下滑鼠左鍵,會出現└,這個符號就是定位點,出現定位點後,在定位點上點2下滑鼠,也可以出現定位點的設定內容)

再設定前置字元型式(大部分都選用(2)或(3)的型式)
按確定後,按一下鍵盤的"Tab鍵"
這樣就會直接出現虛線了
再把頁碼打在虛線後面
第一行設定OK後
在頁碼後面按enter
下一行就可以沿用前面的設定

2013年4月14日 星期日

如何強制關閉TIME_WAIT狀態的socket








Reference
http://serverfault.com/questions/329845/how-to-forcibly-close-a-socket-in-time-wait

Ubuntu更改語系(中文->英文)



1. vim /var/lib/locales/supported.d/local
修改or新增放置在第一行
en_US.UTF-8 UTF-8

2.
vim /etc/default/locale
LANG="en_US.UTF-8"
LANGUAGE="en_US:en"

3. reboot


PS: 若有出現以下的錯誤訊息,則用
warning: setlocale: LC_CTYPE: cannot change locale


1. locale-gen en_US.UTF-8
2. update-locale LANG=en_US.UTF-8
3. reboot

來修正

nmap fingerprint

http://nmap.org/nmap-fingerprinting-article.txt

Sqoop的連線方式


Sqoop提供兩種連線方式 (Connection vs Job meta):
  • Connection (distinct per database)
  • Job (distinct per table)


運作原理如下:

  1. Connectors register metadata
  2. Metadata enables creation of connections and jobs
  3. Connections and jobs stored in metadata repository
  4. Operator runs jobs that use appropriate connections
  5. Admin set policy for connection use

Reference

2013年4月13日 星期六

apache的遊覽權限設定


# 蠻重要的基礎心法

  • deny,allow:以 deny 優先處理,但沒有寫入規則的則預設為 allow 喔。
  • allow,deny:以 allow 為優先處理,但沒有寫入規則的則預設為 deny 喔。

如何在phpmyadmin限制來源ip存取


在 /etc/phpmyadmin/apache.conf中做以下修改:

alias /phpmyadmin "/usr/share/phpmyadmin"

<Directory "/usr/share/phpmyadmin">
        #加入以下規則
        order deny,allow # 處理規則以deny為優先
        deny from all # 先禁止所有的來源ip
        allow from 140.115.0.0/16 # 限制只能中央校園網段進入,非該網段的則會出現403 forbidden
</Directory>

再重新啟動apache2

Reference:
[1] http://note.drx.tw/2012/08/phpmyadmin-limit-ip-debian-6.html