Skip to content

Instantly share code, notes, and snippets.


Zachary Brown TheLastCicada

View GitHub Profile
View gist:66ac0c7d2e99881bf9c76e3a8e645fd3
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` (do d until all partitions are deleted)

Keybase proof

I hereby claim:

  • I am thelastcicada on github.
  • I am zacharybrown ( on keybase.
  • I have a public key ASAVzIviFOmQPvGTef6KVx_vF9juKbInE6zfjIqrHMfx8wo

To claim this, I am signing this object:

TheLastCicada / fixpw.php
Created Sep 7, 2018
Enhanced OneLogin Password Fix
View fixpw.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) {
View NOBLOGREDIRECT explained and fix
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’, ‘’);
When someone in their browser tries to go to (for example) a subomain which doesn’t exist, it will go to what is defined in NOBLOGREDIRECT.
Without using NOBLOGREDIRECT the (for example) – 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
View gist:e1afd2cc108c5b29eb6c5fcf23b80e04
# netstat -an | grep 80 | grep FIN_WAIT
tcp 0 0 ::ffff: ::ffff: FIN_WAIT2
tcp 0 1 ::ffff: ::ffff: FIN_WAIT1
tcp 0 1 ::ffff: ::ffff: FIN_WAIT1
tcp 0 1 ::ffff: ::ffff: FIN_WAIT1
tcp 0 1 ::ffff: ::ffff: FIN_WAIT1
tcp 0 0 ::ffff: ::ffff: FIN_WAIT2
tcp 0 17876 ::ffff: ::ffff: FIN_WAIT1
tcp 0 17876 ::ffff: ::ffff: FIN_WAIT1
tcp 0 1 ::ffff: ::ffff: FIN_WAIT1
View gist:90ba461d06a09488bb01c53edcaf82af
# netstat -an | grep 80
tcp 0 0 SYN_RECV
tcp 0 0 SYN_RECV
tcp 0 0 SYN_RECV
tcp 0 0 SYN_RECV
tcp 0 0 SYN_RECV
tcp 0 0 SYN_RECV
tcp 0 0 SYN_RECV
tcp 0 0 SYN_RECV
tcp 0 0 SYN_RECV
View gist:dce3ac8ffb730648b5577edc08721c00
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCvLhhCloYWHPdhArtOD80WguUeJTIlXOQ9/VjMgD5TfV3IYK29cyKiD7LtvDcwHavGZX+RLijxR9CuRfbswoKgyuWZz6Ls7RVGtMRzaNrTbol1zmwhmVswPKRoqaT2BBHKlG6bbUlFonP7YxYHBVo8vH2WJGoS4aniq0kn7ekW9uOwCM7EbplnZXE7kJAwLKF4p0PcmxARwzbvNvgz6LvANDbeROiWxii2IBoFGfL1Ov3/4xFrWGp37OlmCIKVc67hGjz8Zoj3qqt7Kiqk26Jn4anw0dRiqoad7gA+DrTbqhmV+iCpvJNWu7AF4gxX6tTOYENFjZhp4+eqBG9iiOgn
TheLastCicada / headers.php
Last active Jan 10, 2017
Print Request HTTP Headers with PHP
View headers.php
foreach($_SERVER as $h=>$v)
echo "<li>$h = $v</li>\n";
header('Content-type: text/html');
echo "<br> The current directory is: " . getcwd() . "\n";
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDTke3Au0dR/gnl+QEBhhWQ6SMgHaPJ3a3Q0FcRw3qIHuF8BH6auUCSv9FU0D77kiGkjThmWAHDMVuVjX9AhbS8Sq8wfk2oqQYhiDggvMAQkKkGblixbmIzYgrwdetuGThnHVA/pUNGeWaCK1V2/FHLVdrp5lUd0f1FzYank/6GGYuGJCa0K59aYdhcZCyvKLOREFF3fokLZLwXBLNkhkZZ/FPNLORBe1Xg5bv3FVKwUtH3dZ2jio+PmsdNENTN+QbCyifHPMrTYt6I4zUOG7mk5hEr091uTguWpLB4BPvNQ/KsTtOwl2HlfUnXyp2xI7fQiANTUKNal2ATL7A90gEf zacharybrown@zacharys-air
TheLastCicada / print_headers.php
Last active May 20, 2016
Print http headers in PHP
View print_headers.php
header('Cache-Control: private, max-age=0, no-cache'); // no caching on the php page
echo '<pre>';