Skip to content

Instantly share code, notes, and snippets.

View SmugZombie's full-sized avatar

Ron Egli SmugZombie

View GitHub Profile
<?php
$conn = mysqli_connect($db_host, $db_user, $db_pwd, $db_name);
function mysql_query($query){
global $conn;
return mysqli_query($conn, $query);
}
function mysql_fetch_assoc($query){
global $conn;
@SmugZombie
SmugZombie / WSL_HostUpdater.sh
Created April 8, 2020 17:47
A simple script used to update WSL Ubuntu with host file entries you may not want Windows to have access to. place a .hosts file in the same working dir as the script it should be formatted like a hosts file as to not break your host resolution
#!/bin/bash
# Ron Egli / github.com/smugzombie
# A simple script used to update WSL Ubuntu with host file entries you may not want Windows to have access to
# place a .hosts file in the same working dir as the script
# - it should be formatted like a hosts file as to not break your host resolution
# Version 1.0
rootcheck () {
# A simple check to force sudo if not already root user. If unable quit.
if [ $(id -u) != "0" ]
@SmugZombie
SmugZombie / SiteGrabber.js
Created March 18, 2020 05:55
Simple script to parse a site name and site domain from a Liquid Web Wordpress Admin Page
// Simple script to parse a site name and site domain from a Liquid Web Wordpress Admin Page
// Ron Egli - github.com/smugzombie
var domainArray = document.getElementsByClassName("domain-details")
var sites = []
for(i=0; i < domainArray.length; i ++){
site_name = document.getElementsByClassName("domain-details")[i].children[0].innerText
site_domain = document.getElementsByClassName("domain-details")[i].children[1].children[0].children[1].innerText
<?php
function sendmailgun($to,$toname,$mailfromname,$mailfrom,$subject,$html,$text,$tag,$replyto,$cc="",$attachments=""){
global $CONFIG;
define('MAILGUN_URL', 'https://api.mailgun.net/v3/'.$CONFIG['mailgun']['domain']);
define('MAILGUN_KEY', $CONFIG['mailgun']['apikey']);
$array_data = array(
'from'=> $mailfromname .'<'.$mailfrom.'>',
'to'=>$toname.'<'.$to.'>',
'subject'=>$subject,
#!/usr/bin/python3
import json
# Ron Egli
# v0.4.1
# Quick and dirty script used to Pull all rules that have a specific IP defined to compare against the rules of another specific IP
# aws ec2 describe-security-groups > SecGroups.json
# View in table: python3 dirtysecgroup.py | column -t -s, | less -S
with open('SecGroups.json', 'r') as reader:
SecGroups = reader.read()
#! /usr/bin/python
# sendmail.py - Utilizes Authenticated SMTP Relay to send mail
# Ron Egli - github.com/smugzombie
# Version 1.0
import smtplib
import argparse
import HTMLParser
import json
#!/bin/bash
# Randomword.sh
# Ron Egli - github.com/smugzombie
WORDFILE=/usr/share/dict/words
WORD=
VALID=0
function randomword {
RANDOM=$(date +%s%N);
# echo $RANDOM
// ==UserScript==
// @name Porkbun PriceScanner
// @namespace Github.com/Smugzombie
// @version 0.1
// @description Scans Porkbun's Domain Page for Best Priced Domains
// @author SmugZombie
// @match https://porkbun.com/checkout/search?q=*&all=1
// @grant none
// ==/UserScript==
#!/bin/bash
# Loops through the current directory looking for .mp3 files, converts them to wav files and cleans up the current directory
# Ron Egli - Github/smugzombie
# Create a place for the Originals
dir1="mp3"
dir2="wav"
if [[ ! -e $dir1 ]]; then
mkdir $dir1
@SmugZombie
SmugZombie / README.md
Created October 11, 2019 17:59 — forked from barneycarroll/README.md
Lock and unlock a page's scroll position.

jquery.scrollLock.js

Useful for when a blocking user experience is needed (in my case, didn't want people unwittingly loosing their place by scrolling while a modal required their attention): $.scrollLock() locks the body in place, preventing scroll until it is unlocked.

// Locks the page if it's currently unlocked
$.scrollLock();

// ...or vice versa