瀏覽模式: 普通 | 列表

使用 basename 指令取最後的字串

http://ssorc.tw/rewrite.php/read-485.html

使用 echo 的方式
a=/var/log/messages
echo ${a##/*/}

不過有另一個更簡單的方式,是使用 basename 這指令

只要 basename $0 即可
標籤: 指令

sendmail 可設定將伺服器上「查無此人」的郵件改由特定的用戶接收 http://www.vixual.net/wikka/wikka.php?wakka=Archive2005100801 

而 postfix 有此功能的參數是
luser_relay=cross2

測試了一下

從 cross@ssorc.tw 寄信給 cross3@ssorc.tw,cross3@ssorc.tw 帳號是不存在的

maillog 顯示

Jul  3 20:02:38 ssorc postfix/pickup[16408]: BACA03B00061: uid=48 from=<cross@ssorc.tw>
Jul  3 20:02:38 ssorc dovecot: IMAP(cross): Disconnected: Logged out
Jul  3 20:02:38 ssorc postfix/cleanup[17213]: BACA03B00061: message-id=<djjbfzsh.1215086558.5838920.cross@localhost>
Jul  3 20:02:38 ssorc postfix/qmgr[16407]: BACA03B00061: from=<cross@ssorc.tw>, size=803, nrcpt=1 (queue active)
Jul  3 20:02:38 ssorc postfix/local[17215]: BACA03B00061: to=<cross2@ssorc.tw>, orig_to=<cross3@ssorc.tw>, relay=local, delay=0.14, delays=0.09/0.           03/0/0.03, dsn=2.0.0, status=sent (delivered to command: /usr/bin/procmail -a "$EXTENSION" DEFAULT=/var/spool/mail/maildir/$USER/ MAILDIR=/var/spo           ol/mail/maildir/$USER)
Jul  3 20:02:38 ssorc postfix/qmgr[16407]: BACA03B00061: removed

就在 cross2@ssorc.tw 的信箱收到了原本給 cross3@ssorc.tw 的信

標籤: postfix relay

對於現在硬碟這麼便宜,我突然有個念頭

想當初光碟流行時,每天在想怎樣把東西燒起來備份,久久下來 650MB 或者是 700MB 的光碟可能會多到不行,

再來 4G 光碟的的出現,雖然容量變大了,但久而久之,對於你燒起來的光碟,你可能會不再過問它了,連當初燒什麼東西可能都會忘記,

我也早已認知到這種情況,

所以呢,下列圖可以表達我的理想:

1。四顆 500G 的硬碟作 RAID  0+1,所以你平常用的系統、資料皆是在這 1000G 裡面活動

2。而 160G 的情況是,沒有任何 RAID,只是我這 1000G 的 mirror 而已 (純資料)

3。這可以省下資料要搬來搬去的情況,我也厭煩了吧

[閱讀全文]

標籤: 備份

http://ssorc.tw/rewrite.php/read-823.html

total=0
for x in 1.1 2.3 3.0 0.4 5
do
      total=`echo $total+$x | bc`
done

echo $total



Perl 程式備忘錄


1。=~ # 意思是用來比對相符

2。!~ #意思是用來比對不符

3。print '第一個字串' . "跟這個字串中間多個點,意思是用來將這兩個字串結合起來 ";

4。print "OK " x 4 ; # 會連續列出四行 OK

5。print 1 + 2 . " "; # 顯示出 3 這個值

6。$input=<>; # <> 是標準輸入取值

7。chomp $iput; # 內建的函式,截去變數尾端的 換行字元

8。if (!$input) { print "你輸入的值是空的 "; }

9。$total=undef; # 將變數 $total 變回未定義狀態

[閱讀全文]

如何讓 Windows 排程每五分鐘

這個疑惑我粉久了, 一直以為 Windows 無法以每分鐘作排程,

但是我誤會它了,其實它是可以的,

有圖有真象

在進階的地方設置

1。重覆執行

2。每隔 五分鐘

3。期間 24 小時

attachments/200806/2466759739.jpg

測試結果

[閱讀全文]

標籤: 排程

讓 PHP 開發者使用的 PHPIDS

官網 http://php-ids.org/

On this site you can find a collection of resources relating to PHPIDS including files, documentation, a friendly forum and a cool demo that shows off some of the best features of PHPIDS.

PHPIDS (PHP-Intrusion Detection System) is a simple to use, well structured, fast and state-of-the-art security layer for your PHP based web application. The IDS neither strips, sanitizes nor filters any malicious input, it simply recognizes when an attacker tries to break your site and reacts in exactly the way you want it to. Based on a set of approved and heavily tested filter rules any attack is given a numerical impact rating which makes it easy to decide what kind of action should follow the hacking attempt. This could range from simple logging to sending out an emergency mail to the development team, displaying a warning message for the attacker or even ending the user’s session.

PHPIDS enables you to see who’s attacking your site and how and all without the tedious trawling of logfiles or searching hacker forums for your domain. Last but not least it’s licensed under the LGPL!

Greetings and stay tuned…
The PHPIDS Team

參考http://www.howtoforge.com/intrusion-detection-for-php-applications-with-phpids

引用http://newsletter.ascc.sinica.edu.tw/news/read_news.php?nid=1324

PHPIDS提供一個免費的程式碼,供Web開發人員參考,並可有效地杜絕Web的攻擊手法,同時也提供即時監控的平台,供網站管理者查閱是否受到駭客攻擊。但目前最大的缺點在於,網站下所有的php程式檔都需要加入example.php,才能將攻擊隔絕於外,且每個程式檔加入之後是否會對網站效能有所影響,也是開發人員必須考量的,有興趣的讀者,不妨下載安裝藉以加強Web的安全性。
標籤: 網站測試