Skip to content

Instantly share code, notes, and snippets.

jasonrush / class.spiceworks.php
Last active Jun 3, 2021
A quick PHP class to get information about open tickets on Spiceworks Cloud HelpDesk.
View class.spiceworks.php
class spiceworks {
// Information used to log in and get ticket info.
private $loginURL = '';
private $dataURLOpen = '';
private $dataURLWaiting = '';
private $cookiePath = '';
private $authToken = '';
private $isLoggedIn = false;
jasonrush / Jasons Upwork Stuff.user.js
Last active Mar 8, 2021
Jason's GreaseMonkey script for highlighting client info on job pages I often miss
View Jasons Upwork Stuff.user.js
// ==UserScript==
// @name Jason's Upwork Stuff
// @namespace
// @version 0.1
// @description Highlight important information about clients on job pages I often miss
// @author Jason Rush (
// @match*
// @grant none
// @require
// ==/UserScript==
jasonrush / Get-Diff.ps1
Created Jan 9, 2021
PowerShell Diff implementation
View Get-Diff.ps1
Diff implementation based off of
Written by Jason Rush (
Returns an arraylist of hashtables. Each hashtable has two properties.
The "Action" property will have a value of "Keep", "Insert", or "Remove".
The "Line" property will have the value originally passed via $a_lines or $b_lines.
While I haven't tested it, technically $a_lines and $b_lines should just be arrays
and the values should be able to be anything, not just strings from files as you would
jasonrush / Create-WordPressAdmin.sql
Created Sep 17, 2020
Create WordPress Administrator account
View Create-WordPressAdmin.sql
/* Get a list of possible prefixes */
SELECT TRIM( TRAILING "usermeta" FROM TABLE_NAME) as PrefixesFound FROM information_schema.TABLES WHERE TABLE_NAME LIKE "%usermeta%";
This will autodetect the first table prefix.
SET @TablePrefix = (SELECT TRIM( TRAILING "usermeta" FROM TABLE_NAME) as PrefixesFound FROM information_schema.TABLES WHERE TABLE_NAME LIKE "%usermeta%" LIMIT 1);
SELECT @TablePrefix;
jasonrush / InstallOrUpgradePester.ps1
Last active May 14, 2020
Install or upgrade Pester (including PowerShell 2.0 on Windows 7 and Server 2008 r2)
View InstallOrUpgradePester.ps1
Write-Output "=== Checking if Pester module is installed ==="
if ( (get-module -ListAvailable pester).count -gt 0 ) {
write-Output "`tPester is installed. Checking version(s)..."
if ( (get-module -ListAvailable pester | where-object { $_.version.Major -ge 4} ).count -eq 0 ) {
write-Output "`tReinstalling latest version of Pester"
$module = "C:\Program Files\WindowsPowerShell\Modules\Pester"
takeown /F $module /A /R
icacls $module /reset
icacls $module /grant "*S-1-5-32-544:F" /inheritance:d /T
Remove-Item -Path $module -Recurse -Force -Confirm:$false
jasonrush / TestLocalCredential.ps1
Created Jan 24, 2020
Test credentials for local computer (update arg 2 on line 40 from $null to domain name for domain auth). Slightly modified from Ansible.
View TestLocalCredential.ps1
Function Test-Credential {
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingUserNameAndPassWordParams", "", Justification="We need to use the plaintext pass in the Win32 call, also the source isn't a secure string to using that is just a waste of time/code")]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingPlainTextForPassword", "", Justification="See above")]
param([String]$Username, [String]$Password)
$platform_util = @'
using System;
using System.Runtime.InteropServices;
namespace TempNamespace

Keybase proof

I hereby claim:

  • I am jasonrush on github.
  • I am jasonrush ( on keybase.
  • I have a public key ASBM8nnkxSIOP_7xKxCgO1lcVqH4CYcxIQPzwf6D4AphSQo

To claim this, I am signing this object: