Let’s take a look how the most commonly used value, User-Agent, works. It tells our Dynamic caching: “Hey, you should store different caches for different OS and browsers”. This is done in order to avoid serving a cached desktop version to a mobile visitor for example. Note, however, that nowadays most of the sites don’t actually serve different HTML for their mobile versions. It’s the responsive CSS that does all the heavy lifting and shows your site in a different way on mobile and on desktop. So, unless you’re using a plugin like WP Touch for example, or you know for sure you have a difference in the HTML output of your site, based on visitors browsers, your site should not be sending the Vary: User-Agent header.
This file contains hidden or 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 /PATH/ -type f -printf "%T@ %p\n" | sort -n | cut -d' ' -f 2 | tail -n 1 | xargs gunzip ; | |
| find /PATH/ -type f -printf "%T@ %p\n" | sort -n | cut -d' ' -f 2 | tail -n 1 | perl -pe 'chomp' | xargs cat | mysql -u DB_USER DB_NAME ; |
This file contains hidden or 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 /PATH/ -type f -printf "%T@ %p\n" | sort -n | cut -d' ' -f 2 | tail -n 1 | xargs gunzip ; | |
| find /PATH/ -type f -printf "%T@ %p\n" | sort -n | cut -d' ' -f 2 | tail -n 1 | perl -pe 'chomp' | xargs cat | mysql -u DB_USER DB_NAME ; |
This file contains hidden or 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
| [Definition] | |
| badbotscustom = EmailCollector|WebEMailExtrac|TrackBack/1\.02|sogou music spider | |
| badbots = atSpider/1\.0|autoemailspider|China Local Browse 2\.6|ContentSmartz|DataCha0s/2\.0|DBrowse 1\.4b|DBrowse 1\.4d|Demo Bot DOT 16b|Demo Bot Z 16b|DSurf15a 01|DSurf15a 71|DSurf15a 81|DSurf15a VA|EBrowse 1\.4b|Educate Search VxB|EmailSiphon|EmailWolf 1\.00|ESurf15a 15|ExtractorPro|Franklin Locator 1\.8|FSurf15a 01|Full Web Bot 0416B|Full Web Bot 0516B|Full Web Bot 2816B|Industry Program 1\.0\.x|ISC Systems iRc Search 2\.1|IUPUI Research Bot v 1\.9a|LARBIN-EXPERIMENTAL \(efp@gmx\.net\)|LetsCrawl\.com/1\.0 +http\://letscrawl\.com/|Lincoln State Web Browser|LWP\:\:Simple/5\.803|Mac Finder 1\.0\.xx|MFC Foundation Class Library 4\.0|Microsoft URL Control - 6\.00\.8xxx|Missauga Locate 1\.0\.0|Missigua Locator 1\.9|Missouri College Browse|Mizzu Labs 2\.2|Mo College 1\.9|Mozilla/2\.0 \(compatible; NEWT ActiveX; Win32\)|Mozilla/3\.0 \(compatible; Indy Library\)|Mozilla/4\.0 \(compatible; Advanced Email Extractor v2\.xx\ |
This file contains hidden or 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 DIR_NAME -type f | wc -l |
This file contains hidden or 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
| 0 * * * * cp /etc/nginx/nginx.conf "/backup/nginx/config/nginx.`date +\%Y-\%m-\%d_\%H-\%M`.conf" |
This file contains hidden or 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 | |
| fputs($fp, $bom =( chr(0xEF) . chr(0xBB) . chr(0xBF) )); |
This file contains hidden or 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 | |
| class ChildThread extends Thread { | |
| function test() { | |
| $curl = curl_init(); | |
| curl_setopt_array($curl, array( | |
| CURLOPT_PORT => "443", | |
| CURLOPT_URL => "https://IP:443/", |
This file contains hidden or 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://serverfault.com/questions/545441/nginx-geo-location-module-configuration-using-geo-database | |
| # http://nginx.org/en/docs/http/ngx_http_geo_module.html#directives | |
| # https://www.howtoforge.com/nginx-how-to-block-visitors-by-country-with-the-geoip-module-debian-ubuntu | |
| # https://dev.maxmind.com/geoip/legacy/geolite/ | |
| geoip_country /usr/share/GeoIP/GeoIP.dat; | |
| map $geoip_country_code $backend { | |
| default US; | |
| US US; | |
| CN DE; |
This file contains hidden or 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 | |
| $code = [ | |
| [ 'name' => 'Afghanistan', 'code' => 'AFG'], | |
| [ 'name' => 'Albania', 'code' => 'ALB'], | |
| [ 'name' => 'Algeria', 'code' => 'DZA'], | |
| [ 'name' => 'American Samoa', 'code' => 'AS'], | |
| [ 'name' => 'Andorra', 'code' => 'AND'], | |
| [ 'name' => 'Angola', 'code' => 'AGO'], | |
| [ 'name' => 'Anguilla', 'code' => 'AI'], | |
| [ 'name' => 'Antarctica', 'code' => 'ATA'], |