2013年10月26日 星期六

[SA] ProFTPd



因為有人推薦 ProFTPd,所以這次就捨棄 PureFTPd 來用用看 ProFTPd 吧。

先來簡介一下 ProFTPd 。

ProFTPD (short for Pro FTP daemon) is a FTP server. ProFTPD is Free and open-source software, compatible to Unix-like systems and Microsoft Windows (via Cygwin). Along with vsftpd and Pure-FTPd, ProFTPD is among the most popular FTP servers in UNIX-like environments today. Compared to those, which focus e.g. on simplicity, speed or security, ProFTPD's primary design goal is to be a highly feature rich FTP server, exposing a large amount of configuration options to the user.

ProFTPd 在 FreeBSD 裏面的位置是 /usr/ports/ftp/proftpd
cd 到那裡然後 make install clean 之後就能順利安裝了:D


[SA] ZFS

ZFS 概觀

ZFS 是 Sun Microsystems 為 Solaris 作業系統 (Unix 的一支) 開發的檔案系統。
ZFS 具備 logical volume management 的能力 (稱為 Zpool)、也提供快照(snapshots)、copy-on-write 副本與自動修復的功能。

不同於傳統的檔案系統是建立在單一的磁碟分割之上,ZFS 是建立在虛擬的儲存池(pool)之上,稱為 Zpool。Zpool 可以是由多個 volume 所組成,之後檔案系統再透過 zpool 取得使用空間。ZFS的另一項特點就是 128 位元的設計,理論上可以 2 的 48 次方個檔案,每個檔案最大可以有 16EB,最大單一 volume 可達 16EB。

在資料安全與穩定性方面,ZFS 採用 copy- on-write 與 snapshots 計術來進一步維護檔案系統的正確性。所謂 copy-on-write 簡單的說就是每當檔案有變更時,不是直接覆蓋舊 有的資料,而是將使用中的區塊複製出來,而這些變更是在這複製的區塊上。Copy-on-Write 最大的好處就是當資料變更時,舊有的資料依然能夠維持,方便作為復原之用。Snapshot 就是保存著這些就有資料的映像副本的技術。ZFS 有著另一項先進的計術,就是透過刪除重複的資料 (Deduplication) 來節省儲存的空間。


2013年10月22日 星期二

[IOS] Ch1 Introduction note #3


Process Management

  • A process is a program in execution. It is a unit of work within the system. Program is a passive entity, process is an active entity.
  • Process needs resources to accomplish its task
    • CPU, memory, I/O, files
    • Initialization data
  • Process termination requires reclaim of any reusable resources
  • Single-threaded process has one program counter specifying location of next instruction to execute
    • Process executes instructions sequentially, one at a time, until completion
  • Multi-threaded process has one program counter per thread
  • Typically system has many processes, some user, some operating system running concurrently on one or more CPUs
    • Concurrency by multiplexing the CPUs among the processes / threads

2013年10月12日 星期六

[IOS] Ch1 Introduction note #2


Caching

  • Important principle, performed at many levels in a computer (in hardware, operating system, software)
  • Information in use copied from slower to faster storage temporarily
  • Faster storage (cache) checked first to determine if information is there 
    • If it is, information used directly from the cache (fast)
    • If not, data copied to cache and used there
  • Cache smaller than storage being cached
    • Cache management important design problem
    • Cache size and replacement policy

2013年10月11日 星期五

[IOS] Ch1 Introduction note #1


Overview

       An operating system acts as an intermediary between the user of a
computer and the computer hardware. The purpose of an operating
system is to provide an environment in which a user can execute
programs in a convenient and efficient manner.

        An operating system is software that manages the computer hard-
ware. The hardware must provide appropriate mechanisms to ensure the
correct operation of the computer system and to prevent user programs
from interfering with the proper operation of the system.


2013年10月9日 星期三

[C] argc & argv



一般來說 main function 長這樣:

int main(int argc, char *argv[])

其中,argc 代表的是參數個數,argv[argc] 代表的是指向參數,以下就用簡單的小程式來解釋。