Skip to content

Instantly share code, notes, and snippets.

View shankar-bavan's full-sized avatar

Shankar S Bavan shankar-bavan

View GitHub Profile
@shankar-bavan
shankar-bavan / XDebug.md
Created March 12, 2023 14:36
Enable XDebug in php.ini

Search for XDebug in the PHP file, if you find the lines below commented uncomment them if you don’t add them.

extension=php_xdebug.dll[XDebug]
xdebug.remote_autostart = 1 
xdebug.remote_enable = 1
@shankar-bavan
shankar-bavan / change-laravel-public-folder.md
Created December 25, 2022 14:35
Change Laravel public folder to public_html
  • Change your public folder name to public_html
  • Open server.php and change the public name to public_html in the same way as shown below.
<?php

/**
 * Laravel - A PHP Framework For Web Artisans
 *
 * @package  Laravel
@shankar-bavan
shankar-bavan / import-mysql-database-windows.md
Last active December 25, 2022 14:30
import a mysql database using cmd prompt in XAMPP for Windows
  • Locate the mysql executable (C:\Programs\xampp\mysql\bin\mysql.exe )
  • Copy the path in the clipboard as you will need it in the next step.
  • To import a database we just need to execute the following command with the following arguments:
mysql -u {DATABASE_USERNAME} -p {DATABASE_NAME} < "path/to/file/database-to-import.sql"
@shankar-bavan
shankar-bavan / DKIM-SPF-DMARC-check-via-command-line.md
Created December 25, 2022 14:26
DKIM, SPF, and DMARC check via command line

SPF record check

  • Open the command line (Start > Run > cmd).
  • Enter nslookup -type=txt followed by a space and a domain or hostname, for example, nslookup -type=txt google.com.
  • If an SPF record exists, the result will be something like this: v=spf1 include:_spf.google.com ~all.
  • If there are no results or no v=spf1, then there is a problem getting the record for the domain, or it doesn’t exist.

DKIM record check

@shankar-bavan
shankar-bavan / laravel-htaccess-optimization.md
Created December 25, 2022 14:17
Laravel htaccess optimization

Laravel htaccess optimization can be helped for increasing your website page speed by image caching, HTML compression, Gzip Compression, Enable Browser Caching, Expires headers to leverage browser caching. Open your htaccess file and add the code snippet given below at the end of your site.

## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
@shankar-bavan
shankar-bavan / laravel-html-minify.md
Created December 25, 2022 14:15
Laravel HTML minification

Run the command to make HTML minify middleware and do the code in the middleware for unifying the HTML on-page request.

php artisan make:middleware HtmlMinifier
<?php

namespace App\Http\Middleware;
@shankar-bavan
shankar-bavan / jitsi-installation.md
Last active May 18, 2021 12:55
How To Install Jitsi Meet on Ubuntu 20 and Configure Load Balance

JITSI + JVB LOAD BALANCE WITH AWS + METRICS MONITOR

Update all package lists and packages. To do so run the following commands.

apt update && apt upgrade -y

Set up the Fully Qualified Domain Name (FQDN) (optional)

If the machine used to host the Jitsi Meet instance has a FQDN (for example meet.example.org) already set up in DNS, you can set it with the following command:

@shankar-bavan
shankar-bavan / How To Synchronize Local And Remote Directories In Linux
Last active April 7, 2022 14:03
How To Synchronize Local And Remote Directories In Linux
https://www.atlantic.net/vps-hosting/how-to-use-rsync-copy-sync-files-servers/
sudo yum install rsync
Transfer Contents of a Directory with Rsync
There are a few options when syncing directory contents with rsync over SSH.
To transfer all files from a source directory to target on a remote host, enter:
rsync -at /var/www/directory/* [email protected]:/var/www/directory
Use -a instead of -r. -a means to reproduce file hierarchies, including special files and permissions. -r only means to recurse on directories. For a backup, you want -a.
@shankar-bavan
shankar-bavan / convert-ppk-to-pem
Last active June 13, 2022 05:23
Convert id_rsa to pem file
openssl rsa -in ~/.ssh/id_rsa -outform pem > id_rsa.pem
chmod 600 id_rsa.pem
if below erro comes:
unable to load Private Key
140506636608832:error:0909006C:PEM routines:get_name:no start line:../crypto/pem/pem_lib.c:745:Expecting: ANY PRIVATE KEY
run this
@shankar-bavan
shankar-bavan / install-ffmpeg.md
Last active October 31, 2020 15:20
How to install FFmpeg

FFmpeg is a free and open-source command-line tool for transcoding multimedia files. It contains a set of shared audio and video libraries such as libavcodec, libavformat, and libavutil. With FFmpeg, you can convert between various video and audio formats, set sample rates, and resize videos.

Start by updating the packages list:

sudo apt update