Skip to content

Instantly share code, notes, and snippets.

View TheLastCicada's full-sized avatar

Zachary Brown TheLastCicada

View GitHub Profile
#!/bin/bash
# (c) Wolfgang Ziegler // fago
# Modified by Zachary Brown, Chia Networks Inc
#
# Original Script: https://gist.github.com/fago/9608238
#
# Inotify script to trigger a command on file changes.
#
# The script triggers the command as soon as a file event occurs. Events
# occurring during command execution are aggregated and trigger a single command
@TheLastCicada
TheLastCicada / gist:66ac0c7d2e99881bf9c76e3a8e645fd3
Last active April 30, 2022 14:54
Preparing Hard Drives for Chia
Maybe this is a good way to do it, maybe it isn't - this is my current method.
### List all drives and partitions
`fdisk -l`
### Delete partitions
`gdisk /dev/sdX`
`d`
`1`
`d` (do d until all partitions are deleted)
@TheLastCicada
TheLastCicada / keybase.md
Created January 21, 2022 19:20
keybase.md

Keybase proof

I hereby claim:

  • I am thelastcicada on github.
  • I am zacharybrown (https://keybase.io/zacharybrown) on keybase.
  • I have a public key ASAVzIviFOmQPvGTef6KVx_vF9juKbInE6zfjIqrHMfx8wo

To claim this, I am signing this object:

@TheLastCicada
TheLastCicada / Nginx_Codex
Created June 29, 2014 19:31
Codex Nginx Page
{{Stub}}
While the LAMP stack is very popular (Linux + Apache + MySQL + PHP) for powering WordPress, a lot of people have started using Nginx in place of Apache. This page aims to help those looking to configure WordPress with Nginx.
Before you consider using Nginx, be aware that PHP APC or a similar opcode cache with a WordPress caching plugin is going to offer significant performance improvements over just switching from Apache to nginx. If you aren't already using a PHP opcode cache and WordPress caching plugin, Nginx will do little for your WordPress-based website's performance. WordPress development is intertwined with the Apache world, and as a result, support for Nginx-based setups is limited; but it is growing. Factor these things into your decision to use Nginx.
This is '''not going to cover''' how to install and configure Nginx, so this assumes that you have already installed Nginx and have a basic understanding of how to work with it.
'''Note''': This has been tested on and known to work with
@TheLastCicada
TheLastCicada / fixpw.php
Created September 7, 2018 20:34
Enhanced OneLogin Password Fix
<?php
/**
* This script search user with @@@nopass@@@ passwords and replace them by random passwords
*/
add_filter( 'send_password_change_email', '__return_false' );
$users = get_users();
foreach ($users as $user) {
A little explanation for those who have no idea what NOBLOGREDIRECT is.
The define(‘NOBLOGREDIRECT’, ‘%siteurl%’); inside of the wp-config.php makes it so that when someone enters a subdomain that does not exist on your site to redirect to whatever url you wish it to. You can use this to have it either go to a specific FAQ page or directly back to the main root installation, anywhere you want to direct it. the %siteurl% can be replaced for example define(‘NOBLOGREDIRECT’, ‘http://frumph.net/FAQ/site-create’);
When someone in their browser tries to go to (for example) http://badsubdomain.frumph.net/ a subomain which doesn’t exist, it will go to what is defined in NOBLOGREDIRECT.
Without using NOBLOGREDIRECT the (for example) http://badsubdomain.frumph.net/ – which is a subdomain that doesn’t exist would direct to the signup page asking which reports whether or not the user can create the bad subdomain in question. This is fine, there’s nothing wrong with it redirecting to the signup page if someone put
@TheLastCicada
TheLastCicada / my-sites-search.php
Created July 31, 2014 02:31
@trepmal's My Sites Search plugin for wordpress multisite menus with too many sites
<?php
/*
* Plugin Name: My Sites Search
* Plugin URI: trepmal.com
* Description: https://twitter.com/trepmal/status/443189183478132736
* Version:
* Author: Kailey Lampert
* Author URI: kaileylampert.com
* License: GPLv2 or later
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
# netstat -an | grep 80 | grep FIN_WAIT
tcp 0 0 ::ffff:10.10.8.32:80 ::ffff:198.143.37.113:37979 FIN_WAIT2
tcp 0 1 ::ffff:10.10.8.32:80 ::ffff:149.126.78.17:38165 FIN_WAIT1
tcp 0 1 ::ffff:10.10.8.32:80 ::ffff:198.143.33.81:47742 FIN_WAIT1
tcp 0 1 ::ffff:10.10.8.32:80 ::ffff:198.143.37.113:37981 FIN_WAIT1
tcp 0 1 ::ffff:10.10.8.32:80 ::ffff:198.143.33.89:40644 FIN_WAIT1
tcp 0 0 ::ffff:10.10.8.32:80 ::ffff:198.143.57.33:33563 FIN_WAIT2
tcp 0 17876 ::ffff:10.10.8.32:80 ::ffff:198.143.37.49:22712 FIN_WAIT1
tcp 0 17876 ::ffff:10.10.8.32:80 ::ffff:198.143.37.57:34413 FIN_WAIT1
tcp 0 1 ::ffff:10.10.8.32:80 ::ffff:198.143.37.57:34415 FIN_WAIT1
# netstat -an | grep 80
tcp 0 0 10.10.8.32:80 198.143.57.17:42857 SYN_RECV
tcp 0 0 10.10.8.32:80 198.143.57.17:42854 SYN_RECV
tcp 0 0 10.10.8.32:80 10.10.8.120:40116 SYN_RECV
tcp 0 0 10.10.8.32:80 198.143.57.17:42858 SYN_RECV
tcp 0 0 10.10.8.32:80 198.143.39.9:23772 SYN_RECV
tcp 0 0 10.10.8.32:80 198.143.46.1:42896 SYN_RECV
tcp 0 0 10.10.8.32:80 198.143.39.9:23782 SYN_RECV
tcp 0 0 10.10.8.32:80 198.143.39.9:23780 SYN_RECV
tcp 0 0 10.10.8.32:80 192.230.72.49:10645 SYN_RECV
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCvLhhCloYWHPdhArtOD80WguUeJTIlXOQ9/VjMgD5TfV3IYK29cyKiD7LtvDcwHavGZX+RLijxR9CuRfbswoKgyuWZz6Ls7RVGtMRzaNrTbol1zmwhmVswPKRoqaT2BBHKlG6bbUlFonP7YxYHBVo8vH2WJGoS4aniq0kn7ekW9uOwCM7EbplnZXE7kJAwLKF4p0PcmxARwzbvNvgz6LvANDbeROiWxii2IBoFGfL1Ov3/4xFrWGp37OlmCIKVc67hGjz8Zoj3qqt7Kiqk26Jn4anw0dRiqoad7gA+DrTbqhmV+iCpvJNWu7AF4gxX6tTOYENFjZhp4+eqBG9iiOgn thott@thorstens-pro.fritz.box