Skip to content

Instantly share code, notes, and snippets.

@technicalogical
technicalogical / ckiller.php
Last active February 2, 2024 15:48
cpanel php kill script
<?php
//cPanel lsphp process killer. 2019--Brandon Lehman, blehman@godaddy.com
//Wade C. Thomas - 2019 with the assist on the Quert class.
//This script was designed to more easily kill processes when a cPanel account is experiencing issues while under high load.
//It shows the current running processes by running ps aux, and then kills PHP processes by running pkill lsphp.
class Query {
private $cmd = '';
//__construct
@technicalogical
technicalogical / wp-config-debug.php
Created July 19, 2019 15:36 — forked from jrfnl/wp-config-debug.php
Code to add to wp-config.php to enhance information available for debugging.
<?php
/**
* == About this Gist ==
*
* Code to add to wp-config.php to enhance information available for debugging.
*
* You would typically add this code below the database, language and salt settings
*
* Oh.. and *do* make sure you change the path to the log file to a proper file path on your server (make sure it exists).
*
@technicalogical
technicalogical / mwp.sh
Last active June 24, 2019 00:54
HTL MWP fixer script
# Regular Colors
BLACK=`tput setaf 0`
RED=`tput setaf 1`
GREEN=`tput setaf 2`
YELLOW=`tput setaf 3`
BLUE=`tput setaf 4`
MAGENTA=`tput setaf 5`
CYAN=`tput setaf 6`
WHITE=`tput setaf 7`
@technicalogical
technicalogical / gist:83a361863c05ea2cddd771319907b2be
Created June 23, 2019 01:19
Fix MWP prefixes for usermeta and options table
# Regular Colors
BLACK=`tput setaf 0`
RED=`tput setaf 1`
GREEN=`tput setaf 2`
YELLOW=`tput setaf 3`
BLUE=`tput setaf 4`
MAGENTA=`tput setaf 5`
CYAN=`tput setaf 6`
WHITE=`tput setaf 7`
@technicalogical
technicalogical / backup.sh
Last active April 12, 2019 23:15
Script to send out flowuses table on a daily basis.
#!/bin/bash
#################################################
### Backup file location and naming variables ###
#################################################
TODAY=`date +"%d%b%Y"`
db_record="flowuses"
filename="db_export_${db_record}_${TODAY}.csv"
dir="/var/lib/mysql/backups/"
headers="/home/steven/backups/headers.csv"
@technicalogical
technicalogical / wp.php
Last active April 7, 2019 22:31
WordPress Management Script
<?php
$x = 10000000000000; //10 minutes
//timestamp
$current_time = time();
//the file you wish to delete
$file_name = 'test.php';
<?php
$runtop = "";
$cpanelUser = "";
$cpanelPhp = "";
$cpanelSsh = "";
$cpanelFtp = "";
if (isset($_GET['runtop'])) {
$path = $_SERVER['SCRIPT_FILENAME'];
@technicalogical
technicalogical / certbot-renew.sh
Created March 9, 2017 15:59 — forked from printminion/certbot-renew.sh
renew ssl letsencrypt certificate on bitnami server
#!/bin/bash
#renew ssl letsencrypt certificate on bitnami server
#https://gist.github.com/printminion/6ec2fc0fefaba8e0a98a63a6d73b0802/edit
sudo /opt/bitnami/ctlscript.sh stop apache
cd /home/user/certbot
#./certbot-auto certonly --standalone -w /opt/bitnami/apache2/conf/ -d example
.com -d www.example.com
./certbot-auto renew
sudo cp /etc/letsencrypt/live/example.com/fullchain.pem /opt/bitnami/apache2/conf/server.crt