Skip to content

Instantly share code, notes, and snippets.

Avatar
🙏
Saving WordPress from itself...

Jesse Nickles jessuppi

🙏
Saving WordPress from itself...
View GitHub Profile
View gist:d6ae9421a690c79dc6bb04d0847b5997
<?php
# Database Configuration
define( 'DB_NAME', 'XXX' );
define( 'DB_USER', 'XXX' );
define( 'DB_PASSWORD', 'XXX' );
define( 'DB_HOST', '127.0.0.1' );
define( 'DB_HOST_SLAVE', '127.0.0.1' );
define('DB_CHARSET', 'utf8');
define('DB_COLLATE', 'utf8_unicode_ci');
$table_prefix = 'wp_';
@jessuppi
jessuppi / gist:3356c3031281872eb85120020fca4daa
Last active Sep 10, 2020
SlickStack Bash Functions (Aliases) + Environment Variables
View gist:3356c3031281872eb85120020fca4daa
#!/bin/bash
####################################################################################################
#### SlickStack: Critical Bash Functions (Aliases) + Script Variables ##############################
####################################################################################################
## the below functions are hardcoded into every SlickStack script to ensure reliability ##
## this also speeds up processing times by avoiding repeated inline commands ##
## add-apt-repository alias flags ##
View gist:53880a878b4615e4353a60adf7d58ca9
## fix hyperlinks (but not media src as they are shared with production uploads folder) ##
# sed 's#href="https://$SITE_DOMAIN#href="https://$SITE_DOMAIN/staging#g' /tmp/staging.sql
# sed 's#href="http://$SITE_DOMAIN#href="https://$SITE_DOMAIN/staging#g' /tmp/staging.sql
# sed 's#href="//$SITE_DOMAIN#href="https://$SITE_DOMAIN/staging#g' /tmp/staging.sql
# sed "s#href='https://$SITE_DOMAIN#href='https://$SITE_DOMAIN/staging#g" /tmp/staging.sql
# sed "s#href='http://$SITE_DOMAIN#href='https://$SITE_DOMAIN/staging#g" /tmp/staging.sql
# sed "s#href='//$SITE_DOMAIN#href='https://$SITE_DOMAIN/staging#g" /tmp/staging.sql
## fix sources (mirrors to production uploads folder using Nginx alias so this is just for cleaner source code) ##
# sed 's#src="https://$SITE_DOMAIN#src="https://$SITE_DOMAIN/staging#g' /tmp/staging.sql
@jessuppi
jessuppi / gist:ab5517aa50b3bc83ac37abb8267e005b
Created Aug 3, 2020
Debconf prepare MySQL root password (variations)
View gist:ab5517aa50b3bc83ac37abb8267e005b
## prepare root password for apt (PSA: sudo the shit out of these or it will fail) ##
#####sudo echo "mysql-community-server mysql-community-server/root-pass password ${DB_PASSWORD_ROOT}" | sudo debconf-set-selections
#####sudo echo "mysql-community-server mysql-community-server/re-root-pass password ${DB_PASSWORD_ROOT}" | sudo debconf-set-selections
#####sudo echo "mysql-community-server mysql-server/default-auth-override select Use Legacy Authentication Method (Retain MySQL 5.x Compatibility)" | sudo debconf-set-selections
# echo "mysql-community-server mysql-community-server/root-pass password ${DB_PASSWORD_ROOT}" | debconf-set-selections
# echo "mysql-community-server mysql-community-server/re-root-pass password ${DB_PASSWORD_ROOT}" | debconf-set-selections
# sudo debconf-set-selections <<< "mysql-community-server mysql-community-server/root-pass password ${DB_PASSWORD_ROOT}"
# sudo debconf-set-selections <<< "mysql-community-server mysql-community-server/re-root-pass password ${DB_PASSWORD_ROOT}"
# sudo
@jessuppi
jessuppi / keybase.md
Created Apr 17, 2020
Keybase Verification
View keybase.md

Keybase proof

I hereby claim:

  • I am jessuppi on github.
  • I am jessuppi (https://keybase.io/jessuppi) on keybase.
  • I have a public key ASBM8UruRpHyciuqdbFZ4e-MSobAfGRdujAbFLkXHCl_zAo

To claim this, I am signing this object:

View empty
## empty file ##
@jessuppi
jessuppi / gist:6bc3452fba512389637671d55d01a759
Created Jan 11, 2020
SSH Authorization (Boot Script Example From Vultr)
View gist:6bc3452fba512389637671d55d01a759
#!/bin/sh
# NOTE: This is an example that sets up SSH authorization. To use it, you'd need to replace "ssh-rsa AA... youremail@example.com" with your SSH public.
# You can replace this entire script with anything you'd like, there is no need to keep it
mkdir -p /root/.ssh
chmod 600 /root/.ssh
echo ssh-rsa AA... youremail@example.com > /root/.ssh/authorized_keys
@jessuppi
jessuppi / gist:04fbdc74b20cbe57f627f4611715c041
Last active Sep 15, 2020
SEO Referral Spam Domains (List)
View gist:04fbdc74b20cbe57f627f4611715c041
## block these spam domains from your referrer analytics and/or using firewall rules ##
## the majority of these abusive bots are from China (but not all of them) ##
adelachrist.top
anti-crisis-seo.com
barbarahome.top
briankatrine.top
blogking.top
cardiacarrestbook.com
celestepage.xyz
@jessuppi
jessuppi / functions
Created Nov 21, 2019
Useful Bash Script Functions (Command Aliases)
View functions
## critical functions (aliases) for this script to function ##
apt () { command DEBIAN_FRONTEND=noninteractive DEBIAN_PRIORITY=critical PATH='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin' /usr/bin/apt -q --yes -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" "$@"; }
wget () { command wget --no-check-certificate --no-cache --no-cookies --tries=3 --timeout=15 "$@"; }
cp () { command cp -R -f -d --no-preserve=mode,ownership "$@"; }
rm () { command rm -R -f "$@"; }
mkdir () { command mkdir -p "$@"; }
unzip () { command unzip -o "$@"; }
@jessuppi
jessuppi / gist:510398e634efa36e55e9af46025d0d1f
Created Oct 22, 2019
Embed recent video from YouTube channel
View gist:510398e634efa36e55e9af46025d0d1f
https://stackoverflow.com/questions/39301196/embedding-most-recent-youtube-video-with-channel-id
You can’t perform that action at this time.