Skip to content

Instantly share code, notes, and snippets.

View jordantrizz's full-sized avatar

Jordan jordantrizz

View GitHub Profile
@jordantrizz
jordantrizz / dellosmaproxmox.sh
Last active March 4, 2024 10:50
Dell OSMA on Proxmox/Debian Buster
# Add Dell GPG key to apt
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 1285491434D8786F
echo "deb http://linux.dell.com/repo/community/openmanage/930/bionic bionic main" > /etc/apt/sources.list.d/linux.dell.com.sources.list
wget http://archive.ubuntu.com/ubuntu/pool/universe/o/openwsman/libwsman-curl-client-transport1_2.6.5-0ubuntu3_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/universe/o/openwsman/libwsman-client4_2.6.5-0ubuntu3_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/universe/o/openwsman/libwsman1_2.6.5-0ubuntu3_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/universe/o/openwsman/libwsman-server1_2.6.5-0ubuntu3_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/universe/s/sblim-sfcc/libcimcclient0_2.2.8-0ubuntu2_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/universe/o/openwsman/openwsman_2.6.5-0ubuntu3_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/multiverse/c/cim-schema/cim-schema_2.48.0-0ubuntu1_all.deb
@jordantrizz
jordantrizz / mysql-backup-all-databases.sh
Created November 30, 2022 15:13
Backup all MySQL Databases on a Server
mysql -uroot -N -e 'show databases' | while read dbname; do mysqldump -uroot --complete-insert "$dbname" > "$dbname".sql; done
@jordantrizz
jordantrizz / wp-new.sh
Created April 17, 2023 20:02 — forked from jsonUK/wp-new.sh
Script to create new WordPress setup, using WP-CLI
#!/bin/bash
#
# USE FOR LOCAL DEVELOPMENT ONLY!!!
#
EMAIL='your-email@gmail.com'
MYSQL=`which mysql`
echo -n "DB user/name for project (lowercase) [ENTER]:"
read DB
@jordantrizz
jordantrizz / gist:6cf84aadd3bdc9383dfa04a20b181013
Created September 27, 2018 18:15
Installing Redis PHP 7.2 Module for Litespeed Native on Ubuntu 18
# Pre-req is the Litespeed Ubuntu repository
apt-get install lsphp72-dev
cd /tmp
wget https://github.com/phpredis/phpredis/archive/master.zip -O phpredis.zip
unzip -o /tmp/phpredis.zip
mv /tmp/phpredis-* /tmp/phpredis
cd /tmp/phpredis
/usr/local/lsws/lsphp72/bin/phpize7.2
./configure --with-php-config=/usr/local/lsws/lsphp72/bin/php-config
make
ls -aSd /var/log/nginx/* | grep access | egrep -v '^access.log$|staging|canary|gridpane|.gz' | xargs grep ' 4[0-9][0-9] ' | egrep -v 'xmlrpc.php' | awk '{ print $1" -- "$6" - "$10" - "$7" "$8" "$9}' | sort | uniq -c | sort -n
@jordantrizz
jordantrizz / gist:520da7b14b4bfa26d4d0821dd021f21b
Created December 3, 2021 13:55
Prestashop Default .htaccess
# ~~start~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again
# .htaccess automaticaly generated by PrestaShop e-commerce open-source solution
# http://www.prestashop.com - http://www.prestashop.com/forums
<IfModule mod_rewrite.c>
<IfModule mod_env.c>
SetEnv HTTP_MOD_REWRITE On
</IfModule>
RewriteEngine on
@jordantrizz
jordantrizz / gist:d636803b33d9fa4f2ede0cee5968d73a
Created February 16, 2021 20:34
SQL Truncate on Log Table within cleantalk-spam-protect/lib/Cleantalk/ApbctWP/Firewall/SFW.php
300 /**
301 * Sends and wipe SFW log
302 *
303 * @param $db
304 * @param $log_table
305 * @param string $ct_key API key
306 *
307 * @return array|bool array('error' => STRING)
308 */
309 public static function send_log( $db, $log_table, $ct_key ) {
<?php
// Don't disable on dev
if ( ! defined( 'WP_DEBUG' ) || ! WP_DEBUG ) {
// Disable core update checking
add_filter( 'pre_site_transient_update_core', create_function( '$a', "return null;" ) );
remove_action( 'admin_init', '_maybe_update_core' );
remove_action( 'wp_version_check', 'wp_version_check' );
@jordantrizz
jordantrizz / divi-nginx-helper-cache.php
Last active June 11, 2020 23:21
Divi Purge Cache with nginx-helper plugin
<?php
/*
Plugin Name: Divi Plugin for Nginx Helper
Description: This is a GP helper plugin created for our customers.
Author: GridPane
Network: true
There is another function that you can use and assign it to the save page hook:
et_core_page_resource_auto_clear()
@jordantrizz
jordantrizz / ngix-helper-role-purge-cache.php
Last active June 10, 2020 13:36
Nginx Helper - Role Purge Cache
<?php
/**
* Plugin Name: Nginx Helper - Role Purge Cache
* Plugin URI: https://rtcamp.com/nginx-helper/
* Description: Allows store manager role to purge page and site cache.
* Version: 0.1
* Author: Hubert, Koen Adams, Jordan Trask
* Author URI: https://
* Text Domain: nginx-helper-store-manager