Skip to content

Instantly share code, notes, and snippets.

View SmugZombie's full-sized avatar

Ron Egli SmugZombie

View GitHub Profile
@SmugZombie
SmugZombie / enableHibernationUbuntu.sh
Created August 2, 2024 20:26
Automatically enables hibernation on Ubuntu 24.04 laptops.
#!/bin/bash
# This script configures suspend mode and prepares for hibernation on Ubuntu 24.04
# It ensures swap space is sufficient and configures GRUB for proper resume settings
# Check if the script is run as root or with sudo
if [ "$(id -u)" -ne 0 ]; then
echo "This script must be run as root or with sudo."
exit 1
fi
@SmugZombie
SmugZombie / goog2ddgredirect.js
Last active July 10, 2024 22:33
Google to DuckDuckGo Redirector
// ==UserScript==
// @name Google/Bing to DuckDuckGo Redirector
// @namespace http://smugzombie.com
// @version 1.1
// @description Redirects Google/Bing searches to DuckDuckGo.
// @author Ron Egli <ron@r-egli.com> (github.com/smugzombie)
// @match *://www.google.com/*
// @match *://www.bing.com/*
// @grant none
// ==/UserScript==
@SmugZombie
SmugZombie / tampermonkey.js
Created July 3, 2024 06:41
Media Download Assist Tampermonkey
// ==UserScript==
// @name Highlight and Download Media on sites
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Highlight and add a download button for images and videos on a webpage
// @author Ron Egli <github.com/smugzombie>
// @match *://*/*
// @grant none
// ==/UserScript==
const crypto = require('crypto');
function stringToMacAddress(input) {
// Create an MD5 hash of the input string
const hash = crypto.createHash('md5').update(input).digest('hex');
// Convert the hash to MAC address format
const macAddress = hash.match(/.{1,2}/g).slice(0, 6).join(':');
return macAddress;
const dns = require('dns');
const tls = require('tls');
const email = process.argv[2];
if (!email) {
console.error('Please provide an email address as an argument');
process.exit(1);
}
@SmugZombie
SmugZombie / validateEmail.js
Created March 23, 2023 16:59
Uses SMTP communication to validate whether the input email address exists or not
const dns = require('dns');
const net = require('net');
const email = process.argv[2];
if (!email) {
console.error('Please provide an email address as an argument');
process.exit(1);
}
// ==UserScript==
// @name Expandrive Sales Killer
// @version 0.1
// @description Auto Closes the new Pop generated by Expandrive
// @author SmugZombie
// @match https://www.expandrive.com/desktop/buy/
// @icon https://www.google.com/s2/favicons?sz=64&domain=expandrive.com
// @grant none
// ==/UserScript==
@SmugZombie
SmugZombie / riskwatch_decoder.js
Last active February 8, 2023 23:43
Riskwatch HAR Decoder
const fs = require('fs');
fs.readFile('path/to/your/har/file.har', 'utf8', (err, data) => {
if (err) throw err;
let har;
try {
har = JSON.parse(data);
} catch (e) {
console.error('Error parsing the input file as JSON:', e.message);
@SmugZombie
SmugZombie / toISO.js
Created December 28, 2022 19:30
Convert Date/TimeStamp to ISO
function toISO(date) {
// If the date is already an ISO string, return it as-is
if (typeof date === 'string' && /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/.test(date)) {
return date;
}
// If the date is a number, assume it's a timestamp and convert it to a Date object
if (typeof date === 'number') {
date = new Date(date);
}