Skip to content

Instantly share code, notes, and snippets.

View jessuppi's full-sized avatar
❤️
let the bodies hit the floor

Jesse Nickles jessuppi

❤️
let the bodies hit the floor
View GitHub Profile
@jessuppi
jessuppi / install-monit
Last active October 15, 2017 09:27
Install Monit 5.23 (Ubuntu 16.04)
#!/bin/bash
###########################################
#### Install Monit 5.23 (Ubuntu 16.04) ####
###########################################
#### binaries list: https://mmonit.com/monit/dist/binary/
#### downloads: https://bitbucket.org/tildeslash/monit/downloads/
## install outdated repo version ##
@jessuppi
jessuppi / mysql_secure.sh
Created September 18, 2017 07:17 — forked from Mins/mysql_secure.sh
Automating mysql_secure_installation
#!/bin/bash
aptitude -y install expect
// Not required in actual script
MYSQL_ROOT_PASSWORD=abcd1234
SECURE_MYSQL=$(expect -c "
set timeout 10
@jessuppi
jessuppi / nginx-extras
Last active November 15, 2017 04:51
Replace Nginx with Nginx-Extras (Ubuntu 16.04)
#!/bin/bash
## remove nginx install (purge not needed) ##
DEBIAN_FRONTEND=noninteractive DEBIAN_PRIORITY=critical PATH='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin' /usr/bin/apt-get -q --yes -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" remove nginx
## update repo cache ##
DEBIAN_FRONTEND=noninteractive DEBIAN_PRIORITY=critical PATH='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin' /usr/bin/apt-get -q --yes -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" update
## ensure nginx mainline (dev) branch is default ##
DEBIAN_FRONTEND=noninteractive DEBIAN_PRIORITY=critical PATH='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin' /usr/bin/apt-get -q --yes -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" add-apt-repository ppa:nginx/development
@jessuppi
jessuppi / emergency.php
Last active February 19, 2018 17:36
WordPress Password Recovery Script
<?php
/*
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@dcooney
dcooney / gist:7793554
Created December 4, 2013 19:09
Remove 'Customize' menu item from WordPress admin.
//Remove Customize.php
function remove_sub_menus () {
remove_submenu_page('themes.php', 'customize.php'); //Customize
}
add_action('admin_menu', 'remove_sub_menus');
@jessuppi
jessuppi / install-redis
Created May 21, 2018 08:54
Install Redis
## install redis-server ##
DEBIAN_FRONTEND=noninteractive DEBIAN_PRIORITY=critical PATH='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin' /usr/bin/apt-get -q --yes -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install redis-server
## install php-redis ##
DEBIAN_FRONTEND=noninteractive DEBIAN_PRIORITY=critical PATH='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin' /usr/bin/apt-get -q --yes -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install php-redis
## delete tmp files ##
rm -R -f /tmp/redis-conf.txt /tmp/redis.conf
## download latest versions ##
<?php
// full path to customer log file
$log_file = __DIR__.'/../__admin_ajax.log';
// if it's not a POST request, just move along
if($_SERVER['REQUEST_METHOD'] != "POST") {
return(0);
}
// if you only want specific files like admin-ajax or xmlrpc, uncomment the next line
@jessuppi
jessuppi / admin-notices.php
Last active June 4, 2018 20:54
Recommended Plugins Notice (Dismissable + Recurring)
<?php
// Subpackage namespace
namespace LittleBizzy\HeaderCleanup;
/**
* Admin Notices class
*
* @package WordPress
* @subpackage Admin Notices
@mikejolley
mikejolley / gist:3709371
Created September 12, 2012 19:41
Remove WooCommerce Generator Tag
function my_woocommerce_loaded_function() {
global $woocommerce;
// remove WC generator tag from <head>
remove_action( 'wp_head', array( $woocommerce, 'generator' ) );
}
// called only after woocommerce has finished loading
add_action( 'woocommerce_init', 'my_woocommerce_loaded_function' );
@jessuppi
jessuppi / gist:a7ae4243e677eaef336c8587b6186e9e
Created July 13, 2018 18:54
Sed search/replace examples
## replace entire line containing string with new line content ##
sed -i '/error_log/c\error_log = /var/www/logs/error.log' /etc/php/7.2/fpm/php-fpm.conf