Skip to content

Instantly share code, notes, and snippets.

View dmoruzzi's full-sized avatar

David Moruzzi dmoruzzi

View GitHub Profile
@dmoruzzi
dmoruzzi / main.py
Created May 12, 2024 19:27
Bulk Add MXRoute Email Forwarding Aliases
import http.client
import json
COOKIE = 'ADU5ABE8TYJ3YBEYQ4FQ9OFDRUPGPXGKASFL4LQ'
HOST = 'safari.mxrouting.net'
DOMAIN = 'example.com'
FORWARDERS = {
'forwarder1': 'dest1@example.com,dest2@example.com,dest3@example.com',
'forwarder2': 'dest4@example.com,dest5@example.com,dest6@example.com',
}
@dmoruzzi
dmoruzzi / README.md
Created April 7, 2024 17:19
Click the Meijer MPerk Coupons

About

This code is a JavaScript snippet that automates the clicking of Meijer MPerk "Clip It" buttons with a specified delay between clicks. It's particularly useful when you have a list of buttons that you want to click one after another with a delay in between.

Warning

Please be advised that this JavaScript snippet provided is offered without any warranty, whether implied or express. The use of this code is at your own risk. The author shall not be held responsible for any damages or issues that may arise from its use.

It is essential to ensure that your use of this code complies with the Terms of Service (TOS) of the platforms or services involved. Any misuse or violation of TOS is solely the responsibility of the user.

@dmoruzzi
dmoruzzi / install_python_2.7.sh
Created June 4, 2023 16:03
Python 2.7 Installation Script
#!/bin/bash
set -euo pipefail
# Check if running as root
if [[ $EUID -eq 0 ]]; then
echo "This script should not be run as root; exiting..."
exit 1
fi

Genesys Cloud Deprecations Monitor

This Perl script is a proof of concept for monitoring the deprecation of Genesys Cloud (formerly Purecloud) features. It fetches the RSS feed of Genesys Cloud's feature deprecations and announcements webpage and compares the results to an internal microservice. If the dates are different, the Perl script will execute a PATCH on the microservice with the lastBuildDate from the vendor and include an authorization token.

This script is not production-ready and is provided as-is without any guarantees or warranty. Use at your own risk. The microservice included in this script is unnecessary and was included only as an idea for maintaining versioning in some enterprise operationals portal. Each enterprise to their own.

The script can be automated with crontab.

Risk

@dmoruzzi
dmoruzzi / convert.py
Created April 5, 2023 03:46
Convert MP4 to PDF
import os
import subprocess
import argparse
import logging
from PIL import Image
from pathlib import Path
# Define command line arguments
parser = argparse.ArgumentParser(description="Convert MP4 to PDF")
parser.add_argument(
@dmoruzzi
dmoruzzi / file_info.py
Created January 29, 2023 05:42
Lists file information from a specified directory
import os
import argparse
from datetime import datetime
def get_file_info(dir_path: str = ".", extensions: tuple = None) -> list:
try:
file_list = []
for entry in os.scandir(dir_path):
if extensions:
if not entry.name.endswith(extensions):
@dmoruzzi
dmoruzzi / main.ipynb
Created September 17, 2022 06:35
Dynamic Terminal Commands
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dmoruzzi
dmoruzzi / unpinApp.ps1
Created June 16, 2022 00:36
This is a sample script to show how to unpin a shortcut from the taskbar via Powershell without modules
# This is a sample script to show how to unpin a shortcut from the taskbar via Powershell without modules.
# The path of the shortcut .lnk file to be unpinned.
$Application = "$Home\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\App.lnk"
if (Test-Path -path "$Application"){
(New-Object -ComObject shell.application).NameSpace($Application.Substring(0, $Application.LastIndexOf("\"))).ParseName($Application.Substring($Application.LastIndexOf("\") + 1)).Verbs() | Where-Object {
$_.Name.replace('&', '') -match 'Unpin from taskbar'
}
| ForEach-Object {
@dmoruzzi
dmoruzzi / mperks.py
Created June 10, 2022 03:00
Download all Meijer mPerks PDF receipts
import requests
import os
import time
# This should be extracted from your browser session.
cookies = {
"digital-token": "",
"user_state": "",
}
@dmoruzzi
dmoruzzi / extract_emails.py
Created May 30, 2022 08:47
Simple script to extract email addresses from a text file
# This script will extract email addresses from a text file
# and print them to the screen; please repurpose this script
# as you see fit.
import re # Import regular expression module
def open_text_file(file_name):
'''Open a text file and return a file handle'''
try: