Skip to content

Instantly share code, notes, and snippets.

View Nav-Appaiya's full-sized avatar
🏠
Available

Nav Appaiya Nav-Appaiya

🏠
Available
View GitHub Profile
# Spin up a docker mysql server with remote access
docker run --name mysql-server \
-p 3306:3306 -p 33060:33060 \
-e MYSQL_ROOT_HOST='%' -e MYSQL_ROOT_PASSWORD='root' \
-d mysql/mysql-server:latest
# login into the machine and create a nav user with nav password
# connect
mysql -u root -p -h 0.0.0.0
@Nav-Appaiya
Nav-Appaiya / gist:f949e6ccd2b96b0e5a162ecf82e9cbda
Created January 15, 2020 21:47
ignore those large files for github.com limit of 100MB
Easiest way I've found to ignore those large files is the following:
In the shell:
Change to your Git repo directory
find ./* -size +100M | cat >> .gitignore
--- or use Git LFS:
Git Large File Storage (LFS) replaces large files
@Nav-Appaiya
Nav-Appaiya / run.sh
Created January 15, 2020 14:13
CURL FOR REDIRECTS WITH FORMATTED HEADERS
# Best for checking redirects and inspect headers:
$ curl -sSLIXGET 'https://n4v.nl'
# Fetch Multiple Files at a time
$ curl -O URL1 -O URL2
$ curl -O http://n4v.nl -O http://nav.co.nl -O http://navappaiya.nl -O http://nirojan.nl
#Send Mail with curl using the SMTP Protocol
@Nav-Appaiya
Nav-Appaiya / xdebug.txt
Created January 14, 2020 13:58 — forked from cozingo/php-cli.sh
xdebug
sudo apt-get install php-xdebug
zend_extension="/usr/lib/php/20151012/xdebug.so"
php.ini:
zend_extension="/opt/lampp/lib/php/extensions/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.idekey=PHPSTORM
@Nav-Appaiya
Nav-Appaiya / gist:2e21394974914ccc665cd230d400e664
Created January 7, 2020 14:37
Mac OSX – What program is using port 80
sudo lsof -i :80
docker run -p 8080:80 -v $(pwd):/var/www/html --name lemp -d adhocore/lemp:7.4
@Nav-Appaiya
Nav-Appaiya / functions.php
Created December 22, 2019 18:34
register custom sidebar widget
function my_custom_widgets_init() {
register_sidebar( array(
'name' => __( 'Header Sidebar', 'custom widget' ),
'id' => 'header-sidebar',
'before_widget' => '<div>',
'after_widget' => '</div>',
'before_title' => '<h1>',
'after_title' => '</h1>',
) );
}
@Nav-Appaiya
Nav-Appaiya / .htaccess
Created December 22, 2019 15:20
Common Redirct Rules for in your .htaccess files (not mine, mirrored from gist.github.com/ScottPhillips/1721489)
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@Nav-Appaiya
Nav-Appaiya / gist:c8578cc17e4b7164442c6fa5eb022430
Created December 19, 2019 15:59
Authentication plugin 'caching_sha2_password' cannot be loaded
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';
https://stackoverflow.com/questions/49194719/authentication-plugin-caching-sha2-password-cannot-be-loaded
@Nav-Appaiya
Nav-Appaiya / wp-cli.txt
Created November 28, 2019 11:13
Handy wp cli packages and commands
# wp package install (no mem limit)
php -dmemory_limit=-1 /usr/local/bin/wp package install pixline/wp-cli-php-devtools
# Handy wp cli packages to install and use
# Migration, Remotes & Deployments
foogile/wp-cli-mig
c10b10/wp-cli-deploy
humanmade/wp-remote-cli