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
@Nav-Appaiya
Nav-Appaiya / with wp cli
Created July 16, 2021 15:16
Backup / Restore full wordpress site
wp db export
zip -r my_export_file_name.zip *
rm (name of sql file you exported)
Using WP CLI with UpdraftPlus:
UpdraftPlus provides WP CLI commands to take backups and manage backups. It is not mandatory to login to the admin dashboard to use UpdraftPlus. Here are some commands you could use with UpdraftPlus’ WP-CLI.
To install the plugin (free version): wp plugin install updraftplus
To install and activate the plugin: wp plugin install updraftplus --activate
<?php
/**
* WooCommerce Extra Feature
* --------------------------
*
* Add custom fee to cart automatically
*
*/
function woo_add_cart_fee() {
@Nav-Appaiya
Nav-Appaiya / index.html
Created July 2, 2021 13:30
Text-mask background moving on MouseMove - v2
<!-- If you don't see it u probably are using a browser not based on webkit, so leave IE and grab anything else (Y) -->
<!-- UPDATE: works in Chrome & Safari, not Firefox. To solve that you could use an SVG insted of pure text. -->
<div class="container">
<div class="title">
FLEKTO WEB<br>
DEVELOPMENT
</div>
<div class="subtitle"> Programmer + Backend + Techcurious + PHP + Nerd + Software = ME </div>
</div>
@Nav-Appaiya
Nav-Appaiya / .readme.md
Created July 2, 2021 09:34 — forked from morganestes/.readme.md
Create multiple sites with wp-cli in WordPress multisite for testing.

These commands will install multiple dummy sites in a WordPress Multisite environment.

I wrote this to easily create an environment to work on https://core.trac.wordpress.org/ticket/15317.

Usage

Shell

In the terminal, inside your WordPress directory: simply copy, paste, and run the one-line command.

You can also add it to a location available in your $PATH and invoke the script from the shell.

@Nav-Appaiya
Nav-Appaiya / index.html
Created July 1, 2021 13:45
Text-mask background moving on MouseMove - v2
<!-- If you don't see it u probably are using a browser not based on webkit, so leave IE and grab anything else (Y) -->
<!-- UPDATE: works in Chrome & Safari, not Firefox. To solve that you could use an SVG insted of pure text. -->
<div class="container">
<div class="title">ROBERT DEVELOPER</div>
<div class="subtitle"> geek + smart + curious + nerd + ingenious + cunning = ME </div>
</div>
@Nav-Appaiya
Nav-Appaiya / index.php
Created June 23, 2021 14:19
pass password protection php
<?php
function require_auth() {
$AUTH_USER = 'admin';
$AUTH_PASS = 'password';
header('Cache-Control: no-cache, must-revalidate, max-age=0');
$has_supplied_credentials = !(empty($_SERVER['PHP_AUTH_USER']) && empty($_SERVER['PHP_AUTH_PW']));
$is_not_authenticated = (
!$has_supplied_credentials ||
$_SERVER['PHP_AUTH_USER'] != $AUTH_USER ||
$_SERVER['PHP_AUTH_PW'] != $AUTH_PASS
@Nav-Appaiya
Nav-Appaiya / mirror.md
Created March 4, 2021 14:41 — forked from fer-ri/mirror.md
Mirror Website Using Httrack Command Line
mkdir ~/Mirror

cd ~/Mirror

httrack --connection-per-second=8 --sockets=8 --keep-alive --display --verbose --advanced-progressinfo --disable-security-limits -i -s0 -m -F 'Mozilla/5.0 (X11;U; Linux i686; en-GB; rv:1.9.1) Gecko/20090624 Ubuntu/9.04 (jaunty) Firefox/3.5' -#L999999 http://domain.com
@Nav-Appaiya
Nav-Appaiya / e54d007bab4f5b73da46c93895ac2329
Created November 23, 2020 01:02
e54d007bab4f5b73da46c93895ac2329
e54d007bab4f5b73da46c93895ac2329
@Nav-Appaiya
Nav-Appaiya / delete all draft products from wc
Created November 5, 2020 20:05
delete all draft products from wc on the wp cli
wp post delete $(wp post list --post_type=product --post_status=draft --format=ids)
# from: https://www.basvanbeek.nl/linux/migrate-mail-from-outlook-pst-file-to-remote-imap-server/
sudo yum install libpst
wget "https://raw.githubusercontent.com/rgladwell/imap-upload/master/imap_upload.py"
mkdir mailbox
readpst -o mailbox -r yourLocalFile.pst
# Upload Inbox
python imap_upload.py --host mail.domain.com --port 993 --ssl --user='[email protected]' --password='YourPassword!' \
-r 'mailbox/[email protected]/Postvak IN';