Linux: March 2010 Archives

Pure-FTP uploadscript

Vote 0 Votes

Pure-FTPd 在 configure 時加 --with-uploadscript 參數可以 enable uploadscript 的功能,
就是上傳檔案後可以呼叫外部程式或 script.

pure-ftpd 啟動參數加 -o, 有設定檔(pure-ftpd.conf)的系統就設 CallUploadScript yes

必需先啟動 pure-ftpd 後再啟動 pure-uploadscript, 不然無法運作.
pure-uploadscript -Br /usr/local/bin/

上傳檔案的絕對路徑會帶到第一個參數 $1
$UPLOAD_SIZE : the size of the file, in bytes.
$UPLOAD_PERMS : the permissions, as an octal value.
$UPLOAD_UID : the uid of the owner.
$UPLOAD_GID : the group the file belongs to.
$UPLOAD_USER : the name of the owner.
$UPLOAD_GROUP : the group name the file belongs to.
$UPLOAD_VUSER : the full user name, or the virtual user name. (127 chars max)

uploadscript 範例, 上傳的檔會移到 /tmp/日期 目錄下, 並記錄一筆 Log 到 /var/log/uploadscript.log
DIR=/tmp/`date +%Y%m%d`
[ -d $DIR ] || mkdir $DIR
mv "$1" $DIR
echo `date` size $UPLOAD_SIZE by $UPLOAD_USER >> /var/log/uploadscript.log

Pure-FTPd 1.0.29 released on 2010-03-15, 最近改版還滿勤的.

另一套 ProFTPD 在 1.3.3 版(2010-02-24 Released)也加入了 mod_exec,
比起 Pure-FTPd uploadscript 更為強大, 各種 FTP 的 event 都能呼叫外部程式或 script.

Enable syslog server

Vote 0 Votes

Edit /etc/sysconfig/syslog (for Linux)
# -r enables logging from remote machines
# -x disables DNS lookups on messages recieved with -r

SYSLOGD_OPTIONS="-m 0 -r -x"

Boot ISO from USB Flash Drive

Vote 0 Votes

Boot ISO from USB Flash Drive 是一個可以把隨身碟做可開機的工具, 使用 Syslinux + GRUB4DOS
它還可以 Boot ISO, 把 ISO 檔放進去, 改一下 menu.lst 就行了, 非常方便
測了幾個類型的開機 ISO
一般 DOS, 正常
Windows XP 安裝光碟, 可開機, 到分割硬碟畫面會出現藍屏, 0x0000007b
Windows XP Live CD (XPE), 正常, 可開到桌面
CentOS Linux 安裝光碟, 可開機, 過程中要選 Hard drive, /dev/sda1 即可正安裝
Symantec Ghost 15 Recovery Disk, 正常, 可到軟體畫面 網站另一個好用工具是 Universal USB Installer, 可以把各式 Linux 裝到隨身碟.

Mandriva Taiwan Mirror

Vote 0 Votes

台灣的 Mandriva Mirror FTP 好像只剩兩家了

About this Archive

This page is an archive of entries in the Linux category from March 2010.

Linux: February 2010 is the previous archive.

Linux: April 2010 is the next archive.

Find recent content on the main index or look in the archives to find all content.

Monthly Archives