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 […]

Linux Php

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 […]

Linux

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 […]

CSS Email html

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

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 = […]

Back To Top