#$ 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/
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]
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 […]
Upgrading / Installing PHP 7 for Debian
Upgrade PHP 5.6 to PHP 7 on Nginx / Debian Jessie
Cron’s php script pathing issue
Php include/require pathing is related to how you run your script in cron for example you are having a PHP script in /var/www/html/phpscript/project1/index.php , And below is how the scripts include the files <?php include(“../include_1.php”); include(“../include_2.php”); ?> and below is how you run your script in cron. * * * * * php /var/www/html/phpscript/project1/index.php The […]
Vim Folding ( Marker Method )
Hi, today i’ll be talking about folding for vim. Folding is to fold codes from line to line to have a better view on codes. today i will be demonstrating marker fold method for vim. Firstly , you will need to set your foldmethod to marker code and the default for open and close marker […]
EDM – Electronic Direct Mail
Hi i’ve recently start doing some research on EDM. Different platform ( Desktop App , Mobile App, Web Mail ) for different product (Gmail , Yahoo , AOL….) will have different can & can’t do things. To have a clearer view of what i meant , you can check out this link https://www.campaignmonitor.com/css/ Since most […]
Mysql DB allowing old user from different IP with same grants
Firstly, We have to create a new user from different ip , so we have to run the below command. The first “Select” query is to get all column in user table and the thing we wanna replace is the Host ( the ip that client is going to connect from ). #User Table #To […]
Mysql Procedure creation
Procedure Creation Example MariaDB [stress]> DELIMITER ;; MariaDB [stress]> CREATE PROCEDURE ABC() -> BEGIN -> WHILE 1 -> DO -> SELECT COUNT(*) FROM stresstable; -> DO SLEEP(1); -> END WHILE; -> END;; MariaDB [stress]> DELIMITER ; MariaDB [stress]> CALL ABC(); Procedure Listing $ SHOW PROCEDURE STATUS; OR $ SELECT ROUTINE_SCHEMA,ROUTINE_NAME FROM information_schema.routines where routine_type = […]
Color Schemes ( Vim )
$ #ls -l /usr/share/vim*/colors To set it permanently go to ~/.vimrc, set color default