This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 線上測試網址:https://nginx.viraptor.info/ | |
# 設定檔案 .git | |
location ~* \.(log|ini|real|cfg|env|env_sample|bak|bk|old|save|swp|svn|git|DS_Store|gitignore|disable|sample|lock|sh|bat) { deny all; } | |
# 設定檔案 e.g. user.ini | |
location ~ .*\.(log|ini|real|cfg|env|env_sample|bak|bk|old|save|swp|svn|git|DS_Store|gitignore|disable|sample|lock|sh|bat) { deny all; } | |
# Git 等版本控制 \ cache | |
location ~* \.(git|svn|cache|bin|logs|backup|tests)/.*$ { deny all; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
listen [::]:80; | |
server_name {{Server 名稱}}; | |
access_log {{Log 路徑}}access.log; | |
error_log {{Log 路徑}}error.log; | |
root {{Server 路徑}}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$timezones = array( | |
'Pacific/Midway' => "(GMT-11:00) Midway Island", | |
'US/Samoa' => "(GMT-11:00) Samoa", | |
'US/Hawaii' => "(GMT-10:00) Hawaii", | |
'US/Alaska' => "(GMT-09:00) Alaska", | |
'US/Pacific' => "(GMT-08:00) Pacific Time (US & Canada)", | |
'America/Tijuana' => "(GMT-08:00) Tijuana", | |
'US/Arizona' => "(GMT-07:00) Arizona", | |
'US/Mountain' => "(GMT-07:00) Mountain Time (US & Canada)", | |
'America/Chihuahua' => "(GMT-07:00) Chihuahua", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Portable PHP password hashing framework. | |
* @package phpass | |
* @since 2.5.0 | |
* @version 0.3 / WordPress | |
* @link http://www.openwall.com/phpass/ | |
*/ | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo yum -y update | |
cd /tmp | |
sudo curl -sS https://getcomposer.org/installer | php | |
mv composer.phar /usr/local/bin/composer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
查詢: | |
php -v | |
通常安裝列表: | |
apt-get install php7.1 php7.1-cli php7.1-common libapache2-mod-php7.1 php7.1-mysql php7.1-fpm php7.1-curl php7.1-gd php7.1-bz2 php7.1-mcrypt php7.1-json php7.1-tidy php7.1-mbstring php-redis php-memcached | |
yum install php70w-xml php70w-soap php70w-xmlrpc php70w-mbstring php70w-json php70w-gd php70w-mcrypt php70w-redis php-memcached php70w-mbstring php70w-tidy php70w-json php70w-bz2 php70w-curl php70w-fpm php70w-mysql php70w-common php70w-cli |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
停用防火牆 | |
# systemctl mask firewalld | |
# systemctl stop firewalld | |
安裝 | |
# yum install iptables-services | |
啟動及設定開機執行 iptables | |
# systemctl enable iptables |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#取得前十名 access 最多的 IP 位址 | |
cat access_log|awk '{print $1}'|sort|uniq -c|sort -nr|head -10 | |
#取得前十名 access 最多的網頁 | |
cat access_log|awk '{print $11}'|sort|uniq -c|sort -nr|head -10 | |
#取得前十名下載流量最大的 zip 檔案 | |
cat access.log |awk '($7~/\.zip/){print $10 " " $1 " " $4 " " $7}'|sort -nr|head -10 | |
#取得前十名 Loading 最大的頁面 (大於60秒的 php 頁面) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find -name breakfast.txt 在工作目錄下,含裡面所有目錄,尋找 breakfast.txt | |
find /home/whale -name "*.txt" 在/home/whale目錄下找所有副檔名為txt的檔案名稱 | |
find -type f -name "v*" 在工作目錄下,找開頭是v的一般檔案(不是目錄,不是link...) | |
find -type f -size +100k 在工作目錄下,找大於100k的檔案. | |
find -type f -ctime +2 在工作目錄下,找48小時前(2*48)建立(create)的檔案 | |
find -type f -ctime 2 在工作目錄下,找介於前72小時到前48小時之間建立的檔案 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$special_word_arr = ["☀", "☁", "☂", "☃", "☄", "☇", "☈", "☉", "☊", "☋", "☌", "☍", "☎", "☏", "☐", "☑", "☒", "☓", "✓", "✔", "✕", "✖", "✗", "✘", "☠", "☡", "☢", "☣", "☤", "☥", "☦", "☧", "☨", "☩", "☪", "☫", "☬", "☭", "☮", "☯", "☸", "☰", "☱", "☲", "☳", "☴", "☵", "☶", "☷", "۩", "", "۞", "♔", "♕", "♖", "♗", "♘", "♙", "♚", "♛", "♜", "♝", "♞", "♟", "☹", "☺", "☻", "☼", "☽", "☾", "☿", "♀", "♁", "♂", "♠", "♥", "♦", "♣", "♤", "♡", "♢", "♧", "♨", "〒", "♃", "♄", "♅", "♆", "♇", "♈", "♉", "♊", "♋", "♌", "♍", "♎", "♏", "♐", "♑", "♒", "♓", "✁", "✂", "✃", "✄", "✆", "✇", "✈", "✉", "✌", "✍", "✎", "✏", "✐", "✑", "✒", "✙", "✚", "✛", "✜", "✝", "✞", "✟", "✠", "✡", "✢", "✣", "✤", "✥", "✦", "✧", "★", "☆", "✩", "✪", "✫", "✬", "✭", "✮", "✯", "✰", "✱", "✲", "✳", "✴", "✵", "✶", "✷", "✸", "✹", "✺", "✻", "✼", "✽", "✾", "✿", "❀", "❁", "❂", "❃", "❄", "❅", "❆", "❇", "❈", "❉", "❊", "❋", "❍", "❏", "❐", "❑", "❒", "❖", "❘", "❙", "❚", "❛", "❜", "❝", "❞", "❡", "❢", "❣", "❤", "❥", "❦", "❧", "!", "!", "¡", "‼", "‽", "?", "?", "¿", "#", "%", "&", "*", "~" |
OlderNewer