Skip to content

Instantly share code, notes, and snippets.

Avatar
🦝
Programming

Joshua Pack joshuapack

🦝
Programming
View GitHub Profile
@joshuapack
joshuapack / default-dns
Last active Apr 9, 2021
Pi-hole service script, to correct time if using DNSSEC
View default-dns
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.0.1
View paywallremoval.user.js
// ==UserScript==
// @name Paywall removal
// @namespace https://www.joshuapack.com
// @updateURL https://gist.githubusercontent.com/joshuapack/b13eadb53dee68a4ac40984439e8cc9b/raw/paywallremoval.user.js
// @downloadURL https://gist.githubusercontent.com/joshuapack/b13eadb53dee68a4ac40984439e8cc9b/raw/paywallremoval.user.js
// @version 0.1.16
// @description I hate paywalls
// @author Joshua Pack
// @match https://*.forbes.com/*
// @match https://*.latimes.com/*
View cloudflareUpdate.php
<?php
$zone_identifier = '';
$auth_key = '';
$domain = '';
$public_ip = file_get_contents('https://ipinfo.io');
$public_ip = json_decode($public_ip);
if (!isset($public_ip->ip)) {
echo "unable to get public IP";
View gist:f43b7de4cce2fab33fa6a7c2404a3699
### Keybase proof
I hereby claim:
* I am joshuapack on github.
* I am joshuapack (https://keybase.io/joshuapack) on keybase.
* I have a public key ASDZ1li6vjMDPyxTivNwTTignEg8kRZ5w8twZHC4PD_BRgo
To claim this, I am signing this object:
View Fizz Buzz PHP
<?php
for ($i=1;$i <= 100; $i++) {
if ($i % 3 == 0) echo 'Fizz';
if ($i % 5 == 0) echo 'Buzz';
if ($i % 5 > 0 && $i % 3 > 0) echo $i;
echo '<br/>';
}
@joshuapack
joshuapack / gist:ee54fd4b9418f140f6fa
Created May 14, 2015
PHP killing processes with a name
View gist:ee54fd4b9418f140f6fa
/*
This will kill all cpu processes launched by a certain php file. Can be used to kill other things too.
*/
$killTheseProcesses = "feednew.php";
$allProcesses = shell_exec("pgrep -lf php");
$allProcessesArray = explode("\n", $allProcesses);
array_pop($allProcessesArray);
foreach ($allProcessesArray as $process)
{