Linux sort的常用
按照第5個字段進行排序
[root@test2 smartlsData]# ll | sort -t : +5n-rwxrwxrwx 1 root root 178718700 12月22 18:40 Poi.bal-rwxrwxrwx 1 root root 182348152 12月22 18:40 Poi.bas-rwxrwxrwx 1 root root 18441600 12月22 18:40 Poi.ndx-rwxrwxrwx 1 root root 194056 2006-08-29 wordTableEntry.txt-rwxrwxrwx 1 root root 194056 9月15 16:31 GeoWordTableEntry.txt-rwxrwxrwx 1 root root 20580 12月22 18:40 ACode.ndx-rwxrwxrwx 1 root root 338304 2006-08-10 AnTable.txt-rwxrwxrwx 1 root root 43680 2006-08-10 CnTable.txt-rwxrwxrwx 1 root root 4929920 2006-08-29 wordTable.txt-rwxrwxrwx 1 root root 4929920 9月15 16:31 GeoWordTable.txt-rwxrwxrwx 1 root root 6664 9月14 16:25 data.xml-rwxrwxrwx 1 root root 9220800 12月22 18:40 LsID.idx
按照純數字進行排序(否則按照字母方式進行排序)
[root@test2 smartlsData]# ll | sort -n-rwxrwxrwx 1 root root 178718700 12月22 18:40 Poi.bal-rwxrwxrwx 1 root root 182348152 12月22 18:40 Poi.bas-rwxrwxrwx 1 root root 18441600 12月22 18:40 Poi.ndx-rwxrwxrwx 1 root root 194056 2006-08-29 wordTableEntry.txt-rwxrwxrwx 1 root root 194056 9月15 16:31 GeoWordTableEntry.txt-rwxrwxrwx 1 root root 20580 12月22 18:40 ACode.ndx-rwxrwxrwx 1 root root 338304 2006-08-10 AnTable.txt-rwxrwxrwx 1 root root 43680 2006-08-10 CnTable.txt-rwxrwxrwx 1 root root 4929920 2006-08-29 wordTable.txt-rwxrwxrwx 1 root root 4929920 9月15 16:31 GeoWordTable.txt-rwxrwxrwx 1 root root 6664 9月14 16:25 data.xml-rwxrwxrwx 1 root root 9220800 12月22 18:40 LsID.idx總用量 390484
Linux wc 的使用
wc -l 行號
wc -m
wc -w
[root@test2 smartlsData]# ll | wc -l13
替換
[root@test2 smartlsData]# ll | tr -d 'A'總用量 390484-rwxrwxrwx 1 root root 20580 12月22 18:40 Code.ndx-rwxrwxrwx 1 root root 338304 2006-08-10 nTable.txt-rwxrwxrwx 1 root root 43680 2006-08-10 CnTable.txt-rwxrwxrwx 1 root root 6664 9月14 16:25 data.xml-rwxrwxrwx 1 root root 194056 9月15 16:31 GeoWordTableEntry.txt-rwxrwxrwx 1 root root 4929920 9月15 16:31 GeoWordTable.txt-rwxrwxrwx 1 root root 9220800 12月22 18:40 LsID.idx-rwxrwxrwx 1 root root 178718700 12月22 18:40 Poi.bal-rwxrwxrwx 1 root root 182348152 12月22 18:40 Poi.bas-rwxrwxrwx 1 root root 18441600 12月22 18:40 Poi.ndx-rwxrwxrwx 1 root root 194056 2006-08-29 wordTableEntry.txt-rwxrwxrwx 1 root root 4929920 2006-08-29 wordTable.txt
[root@test2 smartlsData]# ll | cut -d " " -f 4
rootrootrootrootrootrootrootrootrootrootrootroot
拆分 按照大小 和 行 來拆分
split -b 1m detailWebsite.htm detailWebsite.htm_split -l 5 detailWebsite.htm detailWebsite.htm_
2011年11月15日 星期二
yum 收藏的php pear庫
yum list |grep php-pear|cut -d " " -f 1
php-pear.noarch
php-pear-Auth.noarch
php-pear-Auth-OpenID.noarch
php-pear-Auth-RADIUS.noarch
php-pear-Auth-SASL.noarch
php-pear-Auth-Yubico.noarch
php-pear-Auth-radius.noarch
php-pear-Auth-samba.noarch
php-pear-Auth_HTTP.noarch
php-pear-Benchmark.noarch
php-pear-CAS.noarch
php-pear-Cache.noarch
php-pear-Cache-Lite.noarch
php-pear-CodeGen.noarch
php-pear-CodeGen-PECL.noarch
php-pear-Console-Color.noarch
php-pear-Console-CommandLine.noarch
php-pear-Console-Getargs.noarch
php-pear-Console-ProgressBar.noarch
php-pear-Console-Table.noarch
php-pear-Crypt-Blowfish.noarch
php-pear-Crypt-CHAP.noarch
php-pear-DB.noarch
php-pear-DB-DataObject.noarch
php-pear-DB-DataObject-FormBuilder.noarch
php-pear-DB-QueryTool.noarch
php-pear-Date.noarch
php-pear-Date-Holidays.noarch
php-pear-Date-Holidays-USA.noarch
php-pear-Event-Dispatcher.noarch
php-pear-File.noarch
php-pear-File-Bittorrent2.noarch
php-pear-File-Find.noarch
php-pear-File-Passwd.noarch
php-pear-File-SMBPasswd.noarch
php-pear-HTML-Common.noarch
php-pear-HTML-QuickForm.noarch
php-pear-HTML-QuickForm-ElementGrid.noarch
php-pear-HTML-QuickForm-advmultiselect.noarch
php-pear-HTML-Table.noarch
php-pear-HTML-Template-IT.noarch
php-pear-HTML_Javascript.noarch
php-pear-HTML_Template_PHPLIB.noarch
php-pear-HTTP.noarch
php-pear-HTTP-Client.noarch
php-pear-HTTP-OAuth.noarch
php-pear-HTTP-Request.noarch
php-pear-HTTP-Request2.noarch
php-pear-HTTP-Upload.noarch
php-pear-Image-Canvas.noarch
php-pear-Image-Color.noarch
php-pear-Image-Graph.noarch
php-pear-Image-GraphViz.noarch
php-pear-Log.noarch
php-pear-MDB2.noarch
php-pear-MDB2-Driver-mysql.noarch
php-pear-MDB2-Driver-mysqli.noarch
php-pear-MDB2-Driver-pgsql.noarch
php-pear-MDB2-Schema.noarch
php-pear-Mail.noarch
php-pear-Mail-Mime.noarch
php-pear-Mail-mimeDecode.noarch
php-pear-Math-Stats.noarch
php-pear-Net-Curl.noarch
php-pear-Net-DIME.noarch
php-pear-Net-DNS.noarch
php-pear-Net-FTP.noarch
php-pear-Net-IDNA2.noarch
php-pear-Net-IPv4.noarch
php-pear-Net-POP3.noarch
php-pear-Net-Ping.noarch
php-pear-Net-SMTP.noarch
php-pear-Net-Sieve.noarch
php-pear-Net-Socket.noarch
php-pear-Net-Traceroute.noarch
php-pear-Net-URL.noarch
php-pear-Net-URL-Mapper.noarch
php-pear-Net-URL2.noarch
php-pear-Net-UserAgent-Detect.noarch
php-pear-Numbers-Roman.noarch
php-pear-Numbers-Words.noarch
php-pear-OLE.noarch
php-pear-PEAR-Command-Packaging.noarch
php-pear-PHP-CodeSniffer.noarch
php-pear-PHP-Compat.noarch
php-pear-PHP-CompatInfo.noarch
php-pear-Pager.noarch
php-pear-Payment-Process.noarch
php-pear-PhpDocumentor.noarch
php-pear-PhpDocumentor-docs.noarch
php-pear-SOAP.noarch
php-pear-Services-Twitter.noarch
php-pear-Services-Weather.noarch
php-pear-Spreadsheet-Excel-Writer.noarch
php-pear-Structures-DataGrid.noarch
php-pear-Structures-DataGrid-DataSource-Array.noarch
php-pear-Structures-DataGrid-DataSource-DataObject.noarch
php-pear-Structures-DataGrid-DataSource-MDB2.noarch
php-pear-Structures-DataGrid-DataSource-RSS.noarch
php-pear-Structures-DataGrid-Renderer-Pager.noarch
php-pear-Structures-DataGrid-Renderer-Smarty.noarch
php-pear-Text-Diff.noarch
php-pear-Validate.noarch
php-pear-Validate-Finance-CreditCard.noarch
php-pear-Var-Dump.noarch
php-pear-XML-Beautifier.noarch
php-pear-XML-Parser.noarch
php-pear-XML-RPC2.noarch
php-pear-XML-RSS.noarch
php-pear-XML-Serializer.noarch
php-pear-phing.noarch
php-pear.noarch
php-pear-Auth.noarch
php-pear-Auth-OpenID.noarch
php-pear-Auth-RADIUS.noarch
php-pear-Auth-SASL.noarch
php-pear-Auth-Yubico.noarch
php-pear-Auth-radius.noarch
php-pear-Auth-samba.noarch
php-pear-Auth_HTTP.noarch
php-pear-Benchmark.noarch
php-pear-CAS.noarch
php-pear-Cache.noarch
php-pear-Cache-Lite.noarch
php-pear-CodeGen.noarch
php-pear-CodeGen-PECL.noarch
php-pear-Console-Color.noarch
php-pear-Console-CommandLine.noarch
php-pear-Console-Getargs.noarch
php-pear-Console-ProgressBar.noarch
php-pear-Console-Table.noarch
php-pear-Crypt-Blowfish.noarch
php-pear-Crypt-CHAP.noarch
php-pear-DB.noarch
php-pear-DB-DataObject.noarch
php-pear-DB-DataObject-FormBuilder.noarch
php-pear-DB-QueryTool.noarch
php-pear-Date.noarch
php-pear-Date-Holidays.noarch
php-pear-Date-Holidays-USA.noarch
php-pear-Event-Dispatcher.noarch
php-pear-File.noarch
php-pear-File-Bittorrent2.noarch
php-pear-File-Find.noarch
php-pear-File-Passwd.noarch
php-pear-File-SMBPasswd.noarch
php-pear-HTML-Common.noarch
php-pear-HTML-QuickForm.noarch
php-pear-HTML-QuickForm-ElementGrid.noarch
php-pear-HTML-QuickForm-advmultiselect.noarch
php-pear-HTML-Table.noarch
php-pear-HTML-Template-IT.noarch
php-pear-HTML_Javascript.noarch
php-pear-HTML_Template_PHPLIB.noarch
php-pear-HTTP.noarch
php-pear-HTTP-Client.noarch
php-pear-HTTP-OAuth.noarch
php-pear-HTTP-Request.noarch
php-pear-HTTP-Request2.noarch
php-pear-HTTP-Upload.noarch
php-pear-Image-Canvas.noarch
php-pear-Image-Color.noarch
php-pear-Image-Graph.noarch
php-pear-Image-GraphViz.noarch
php-pear-Log.noarch
php-pear-MDB2.noarch
php-pear-MDB2-Driver-mysql.noarch
php-pear-MDB2-Driver-mysqli.noarch
php-pear-MDB2-Driver-pgsql.noarch
php-pear-MDB2-Schema.noarch
php-pear-Mail.noarch
php-pear-Mail-Mime.noarch
php-pear-Mail-mimeDecode.noarch
php-pear-Math-Stats.noarch
php-pear-Net-Curl.noarch
php-pear-Net-DIME.noarch
php-pear-Net-DNS.noarch
php-pear-Net-FTP.noarch
php-pear-Net-IDNA2.noarch
php-pear-Net-IPv4.noarch
php-pear-Net-POP3.noarch
php-pear-Net-Ping.noarch
php-pear-Net-SMTP.noarch
php-pear-Net-Sieve.noarch
php-pear-Net-Socket.noarch
php-pear-Net-Traceroute.noarch
php-pear-Net-URL.noarch
php-pear-Net-URL-Mapper.noarch
php-pear-Net-URL2.noarch
php-pear-Net-UserAgent-Detect.noarch
php-pear-Numbers-Roman.noarch
php-pear-Numbers-Words.noarch
php-pear-OLE.noarch
php-pear-PEAR-Command-Packaging.noarch
php-pear-PHP-CodeSniffer.noarch
php-pear-PHP-Compat.noarch
php-pear-PHP-CompatInfo.noarch
php-pear-Pager.noarch
php-pear-Payment-Process.noarch
php-pear-PhpDocumentor.noarch
php-pear-PhpDocumentor-docs.noarch
php-pear-SOAP.noarch
php-pear-Services-Twitter.noarch
php-pear-Services-Weather.noarch
php-pear-Spreadsheet-Excel-Writer.noarch
php-pear-Structures-DataGrid.noarch
php-pear-Structures-DataGrid-DataSource-Array.noarch
php-pear-Structures-DataGrid-DataSource-DataObject.noarch
php-pear-Structures-DataGrid-DataSource-MDB2.noarch
php-pear-Structures-DataGrid-DataSource-RSS.noarch
php-pear-Structures-DataGrid-Renderer-Pager.noarch
php-pear-Structures-DataGrid-Renderer-Smarty.noarch
php-pear-Text-Diff.noarch
php-pear-Validate.noarch
php-pear-Validate-Finance-CreditCard.noarch
php-pear-Var-Dump.noarch
php-pear-XML-Beautifier.noarch
php-pear-XML-Parser.noarch
php-pear-XML-RPC2.noarch
php-pear-XML-RSS.noarch
php-pear-XML-Serializer.noarch
php-pear-phing.noarch
Additional PEAR Library
PHPUnit (for Unit Testing)
- URL: http://pear.php.net/package/PHPUnit2/
- Home URL: http://www.phpunit.de/
- Stable version: 2.3.6
- Download URL: http://pear.php.net/package/PHPUnit2/download
- Installed Servers: vm1, vm2
- Path: /opt/php/lib/php/PHPUnit/
PHPMailer
- Home URL: http://phpmailer.codeworxtech.com/
- Latest version: 2.2.1
- Download URL: http://phpmailer.codeworxtech.com/index.php?pg=sf&p=dl
- Installed Servers: vm1, vm2
- Path: /opt/php/lib/php/PHPMailer/
Zend Framework
- Home URL: http://framework.zend.com/
- Latest version: 1.6.1
- Download URL: http://framework.zend.com/download/latest
- Installed Server: vm2 (for admin system development)
- Path: /opt/php/lib/php/Zend/
PEAR Package - Excel and Spreadsheet (Reference Only)
- Spreadsheet_Excel_Writer: http://pear.php.net/package/Spreadsheet_Excel_Writer
- Structures_DataGrid_DataSource_Excel: http://pear.php.net/package/Structures_DataGrid_DataSource_Excel
- Structures_DataGrid: http://pear.php.net/package/Structures_DataGrid
- Structures_DataGrid_DataSource_Array: http://pear.php.net/package/Structures_DataGrid_DataSource_Array
- Structures_DataGrid_Renderer_XLS: http://pear.php.net/package/Structures_DataGrid_Renderer_XLS/
Reference
PHP - Email
- PHP Mail Library Presentation: http://www.phplondon.org/conference/2008/media/docs/marcus_bointon_mail_presentation.pdf
- PHPMailer Tips and Tools: http://phpmailer.codeworxtech.com/index.php?pg=tips
- Sending Email with Zend Framework: http://www.talkphp.com/vbarticles.php?do=article&articleid=51&title=sending-emails-with-the-zend-framework
Bounce Email Tracking
- URL: http://forums.devshed.com/php-development-5/bounce-e-mail-tracking-522635.html
- Steps to detect bounce emails: http://www.php.net/manual/sk/ref.mail.php#24963
- PHP class for tracking bounce emails: http://www.phpclasses.org/browse/package/2691.html
- Article on Incoming mails and php: http://www.evolt.org/article/Incoming_Mail_and_PHP/18/27914/
PHP Bulk Email - Best Practice
phplist Features
Wiki
- Bounce Message: http://en.wikipedia.org/wiki/Bounce_message
- Bounce Address Tag Validation (BATV): http://en.wikipedia.org/wiki/Bounce_Address_Tag_Validation
- Sender Policy Framework (SPF): http://en.wikipedia.org/wiki/Sender_Policy_Framework
- Simple Mail Transfer Protocol (SMTP): http://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol
- Variable Envelope Return Path (VERP): http://en.wikipedia.org/wiki/Variable_envelope_return_path
Software
- Email Marketing Software (Mach5 Mailer): http://www.mach5.com/products/mailer/index.php
- Email Bounce Handling Solution: http://www.boogietools.com/
2011年11月14日 星期一
Zend Framework 輸出xml的幾種方法
Zend Framework 輸出xml的幾種方法。
見代碼:1.
class TestController extends Zend_Controller_Action {
/**
* The default action - show the home page
*/
public function indexAction() {
$content = "bar ";
header('Content-Type: text/xml');
echo $content;
exit;
}
}
加一句exit;這樣可以不用關閉view.
2.
class TestController extends Zend_Controller_Action {
/**
* The default action - show the home page
*/
public function indexAction() {
// XML-related routine
$xml = new DOMDocument('1.0', 'utf-8');
$xml->appendChild($xml->createElement('foo', 'bar'));
$output = $xml->saveXML();
// Both layout and view renderer should be disabled
Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer')->setNoRender(true);
Zend_Layout::getMvcInstance()->disableLayout();
// Setting up headers and body
$this->_response->setHeader('Content-Type', 'text/xml; charset=utf-8')
->setBody($output);
}
}
第二種方法可以調用DOMDocument對象來創建更豐富的xml.
本文出自“Bob” 博客,請務必保留此出處http://phpbob.blog.51cto.com/636017/631102
見代碼:1.
class TestController extends Zend_Controller_Action {
/**
* The default action - show the home page
*/
public function indexAction() {
$content = "
header('Content-Type: text/xml');
echo $content;
exit;
}
}
加一句exit;這樣可以不用關閉view.
2.
class TestController extends Zend_Controller_Action {
/**
* The default action - show the home page
*/
public function indexAction() {
// XML-related routine
$xml = new DOMDocument('1.0', 'utf-8');
$xml->appendChild($xml->createElement('foo', 'bar'));
$output = $xml->saveXML();
// Both layout and view renderer should be disabled
Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer')->setNoRender(true);
Zend_Layout::getMvcInstance()->disableLayout();
// Setting up headers and body
$this->_response->setHeader('Content-Type', 'text/xml; charset=utf-8')
->setBody($output);
}
}
第二種方法可以調用DOMDocument對象來創建更豐富的xml.
本文出自“Bob” 博客,請務必保留此出處http://phpbob.blog.51cto.com/636017/631102
訂閱:
文章 (Atom)