個人在學習Linux過程當中的個人筆記,提供個人及有需要的人查閱,若有錯誤歡迎提供指正,謝謝。 This Blog recorded notes about my learning Linux and provides myself and others reference. If there are any incorrect information, welcome to leave a message to correct me, Thanks.
2011年7月14日 星期四
2011年7月13日 星期三
Disable Apache folder listing for each folder
1. enable .htaccess file override
edit file /etc/httpd/conf/httpd.conf
search "htaccess", changed below setting to
2. go to folder that will disable folder listing
create file .htaccess
add this content:
3. Restart Apache
Reference:
http://www.cyberciti.biz/faq/apache-web-server-prevent-directory-folder-listing/
http://www.cyberciti.biz/faq/apache-htaccess/
edit file /etc/httpd/conf/httpd.conf
search "htaccess", changed below setting to
AllowOverride All2. go to folder that will disable folder listing
create file .htaccess
add this content:
IndexIgnore *3. Restart Apache
service httpd restartReference:
http://www.cyberciti.biz/faq/apache-web-server-prevent-directory-folder-listing/
http://www.cyberciti.biz/faq/apache-htaccess/
2011年7月12日 星期二
IP address與MAC address的regular expression
IP Address
egrep "^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$"
MAC address
egrep "^([[:xdigit:]]{2}:){5}[[:xdigit:]]{2}$"
http://www.regular-expressions.info/examples.html
http://www.perlmonks.org/?node_id=83405
http://en.wikipedia.org/wiki/Regular_expression
egrep "^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$"
MAC address
egrep "^([[:xdigit:]]{2}:){5}[[:xdigit:]]{2}$"
http://www.regular-expressions.info/examples.html
http://www.perlmonks.org/?node_id=83405
http://en.wikipedia.org/wiki/Regular_expression
2011年7月4日 星期一
Manipulating Strings
bash下字串的操作
chars="12345678"
echo ${chars:2:3} #234
format: ${string:position:length}
position index從1開始
echo ${chars:2} #345678
從0開始算
reference:
http://tldp.org/LDP/abs/html/string-manipulation.html
chars="12345678"
echo ${chars:2:3} #234
format: ${string:position:length}
position index從1開始
echo ${chars:2} #345678
從0開始算
reference:
http://tldp.org/LDP/abs/html/string-manipulation.html
2011年6月17日 星期五
2011年5月25日 星期三
add PATH to all user permanently
修改 /etc/profile檔案
pathmunge /usr/local/sbin
參考資料:
http://www.linuxquestions.org/questions/linux-newbie-8/how-to-set-path-how-do-i-set-path-environment-variable-111204/
pathmunge /usr/local/sbin
參考資料:
http://www.linuxquestions.org/questions/linux-newbie-8/how-to-set-path-how-do-i-set-path-environment-variable-111204/
訂閱:
文章 (Atom)