Forwarding Visitor’s Real-IP + Nginx Proxy/Fastcgi backend correctly
Vim Writing in Visual Block
Move the cursor to the n in name. Enter visual block mode (ctrlv). Press j three times (or 3j). Press I (capital i). Type in vendor_. Press esc.
SSH Trick
How To SSH run command without key-in password again echo < password > | ssh username@host ‘sudo -S < command >’ Running Two SSH Command line for sqldump ssh -t username@host ‘mysqldump -u {DB_USER} -p”{DB_PASS}” {DB_NAME}’ > dump.sql | ssh -t username@host ‘cat dump.sql’ > local.sql
Building your own SMTP server
https://www.linode.com/docs/email/postfix/email-with-postfix-dovecot-and-mysql/#dovecot
Nmap Scan ( Port Scanning )
nmap is aport scanning tool that is useful to detect which port is up and its usage. #$ nmap -O -p1-65535 thedomain Explaination: -O: Enable OS detection -p : Only scan specified ports
How to install laravel & php 7.2
There are few things we need for this tutorial. PHP 7.2+ REF : https://www.chris-shaw.com/blog/installing-php-7.2-on-debian-8-jessie-and-debian-9-stretch Composer REF : https://getcomposer.org/doc/00-intro.md#downloading-the-composer-executable laravel Okay , so we will start intall for php 7.2 ++ and below are the steps :- #Adding Repo $ sudo apt-get install apt-transport-https lsb-release ca-certificates $ sudo wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg $ echo “deb https://packages.sury.org/php/ […]
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/
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]
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 […]