Month: June 2018

bash Linux

Linux Grep Command

#$ grep -r –exclude-dir={path1,path2,path3,path4} -i –include=\*.php ‘ keyword ‘ /path/to/dir/ Explaination :- -r : recursive –exclude-dir=PATTERN : Exclude specific directory -i, –ignore-case ignore case distinctions –include=FILE_PATTERN : search only files that match FILE_PATTERN #Extras Grep multiple pattern #$ grep ‘keyword1\|keyword2\|keyword3’ /path/to/dir/

Apache Linux Nginx

Prevent Curl Wget for Web server

Nginx ## # Block User Agent (Jorgee Vulnerability scan) ## if ($http_user_agent ~* (Jorgee|curl|wget) ){ return 403; } Apache RewriteEngine On RewriteCond %{HTTP_USER_AGENT} ^$ [OR] RewriteCond %{HTTP_USER_AGENT} ^.*(|’|%0A|%0D|%27|%3C|%3E|%00).* [NC,OR] RewriteCond %{HTTP_USER_AGENT} ^.*(HTTrack|clshttp|archiver|loader|email|nikto|miner|python).* [NC,OR] RewriteCond %{HTTP_USER_AGENT} ^.*(winhttp|libwww\-perl|curl|wget|harvest|scan|grab|extract).* [NC] RewriteRule ^(.*)$ – [F,L]

javascript

Video Autoplay ( when visible)

https://cdnjs.com/libraries/vissense/tutorials/getting-started My Example of making all video using vissense function $(“.video”).each(function () { var myVideo = document.getElementById(this.id); VisSense.VisMon.Builder(VisSense(myVideo, { fullyvisible: 0.75 })) .on(‘fullyvisible’, function(monitor) { myVideo.play(); }) .on(‘hidden’, function(monitor) { myVideo.pause(); }).build().start(); }); Code Explanation 1. For each class video, get their id and set VisSense function to it 2. Set the fullyvisible to desire […]

Back To Top