Skip to content

Instantly share code, notes, and snippets.

View JoelLisenby's full-sized avatar
🐳
sploosh

Joel Lisenby JoelLisenby

🐳
sploosh
View GitHub Profile
@JoelLisenby
JoelLisenby / PasswordHash.php
Created October 28, 2025 05:05
Updated Portable PHP password hashing framework with backwards compatible CheckPassword, while HashPassword uses modern PHP 7.3.0+ hashing algorithms
<?php
//
// Portable PHP password hashing framework.
//
// Version 0.6 / secure.
//
// Original written by Solar Designer <solar at openwall.com> in 2004-2006 and placed in
// the public domain. Revised in subsequent years, still public domain.
//
// Updated in 2025 to support Argon2id using PHP's password_hash for enhanced security,
@JoelLisenby
JoelLisenby / ffmpeg.sh
Last active October 8, 2025 18:46
ffmpeg video encoding for web (chrome, firefox, safari, etc)
# h265
ffmpeg -i input.mp4 -c:v libx265 -vf scale=1280:720 -pix_fmt yuv420p output.mp4
# h265 with colorspace specified
ffmpeg -i input.mp4 -c:v libx265 -vf scale=1280:720 -pix_fmt yuv420p -color_primaries bt709 -color_trc bt709 -colorspace bt709 output.mp4
# h265 with colorspace specified and no audio
ffmpeg -i input.mp4 -c:v libx265 -vf scale=1280:720 -pix_fmt yuv420p -color_primaries bt709 -color_trc bt709 -colorspace bt709 -an output.mp4
# webm
<?php
// get_wpengine_installs.php
// v1.3.0
// Example run:
// php -f get_wpengine_installs.php
//
// acquire your username and password from https://my.wpengine.com/profile/api_access
//
// Required: save public_suffix_list.dat alongside the script.
// https://publicsuffix.org/list/public_suffix_list.dat
@JoelLisenby
JoelLisenby / wpe_proxy.php
Last active September 26, 2024 17:02
WordPress vs WPengine Proxy Function for Plugin Updates
<?php
// Add to functions.php or your own plugin
add_filter('http_request_args', 'apply_proxy_for_updates', 10, 2);
function apply_proxy_for_updates($http_args, $url) {
// Check if the URL is for an update check or download
if (strpos($url, 'wordpress.org') !== false) {
$http_args['proxy'] = array(
'host' => 'your.proxy.server',
'port' => 'proxy_port_number',
@JoelLisenby
JoelLisenby / reset_wf_2fa_grace_period.md
Last active April 29, 2024 23:07
Reset 2FA Grace Period in WordFence from the database/phpmyadmin

If you find yourself locked out due to no 2FA, but you have access to your WordPress database you can increase your WordFence 2FA grace period by following the instructions below.

Needed items:

  • Your user ID (find in the wp_users table)
  1. Go to phpmyadmin, view the wp_usermeta table.
  2. Do a search for meta_key = wfls-grace-period-reset and user_id = [your user id]
  3. Update the value of this row to a future unix timestamp like now + 3600 seconds to give you a 1 hour grace period.
@JoelLisenby
JoelLisenby / linode_32G_setup.md
Last active February 20, 2024 17:48
linode_32G_setup

A Linode 32GB VPS configuration

Utilizing memcached (with php8.2-memcached) over localhost. We found a 5X improvement in speed from (15s to 3s) when viewing the events default view while logged in after enabling memcached in this way for The Events Ticktes/Calendar plugin when paired with WooCommerce.

Drop in object-cache.php to /wp-content/object-cache.php from: https://github.com/Automattic/wp-memcached

  • This script uses php8.2-memcache, not php8.2-memcached, but having both installed does not harm anything. They can both be installed safely.

/etc/mysql/mariadb.conf.d/50-server.cnf

@JoelLisenby
JoelLisenby / gcode.md
Last active January 17, 2024 17:40
TEVO Tarantula i3 - Start and End GCODE with bed leveling and low preheat to prevent oozing before print

Start GCODE

G21 ;metric values
G90 ;absolute positioning
M82 ;set extruder to absolute mode
M107 ;start with the fan off
M109 S160 ; Preheat nozzle lower temp
G28 X0 Y0 ;move X/Y to min endstops
G28 Z0 ;move Z to min endstops
@JoelLisenby
JoelLisenby / vt_resize.php
Last active December 23, 2023 04:33 — forked from seedprod/vt_resize.php
Resize WordPress images on the fly vt_resize w/ multisite support
<?php
/*
* Resize images dynamically using wp built in functions.
* Update: Use WP_Image_Editor class instead of deprecated image_resize.
* Updated by Joel Lisenby (original function by Victor Teixeira)
*
* php 5.2+
*
* Example use:
*
@JoelLisenby
JoelLisenby / wordpress_disable_comments_pingbacks.php
Last active May 4, 2023 16:58
Disable comments and pingbacks settings for all WordPress network sites
<?php
// Disables comments and pingbacks settings for all existing sites in a WordPress network
$sites = get_sites();
foreach ( $sites as $site ) {
switch_to_blog( $site->blog_id );
update_option( 'default_comment_status', 'closed' );
update_option( 'default_ping_status', 'closed' );
restore_current_blog();
}
@JoelLisenby
JoelLisenby / archlinux.md
Last active October 31, 2022 06:51
Arch Linux Install