Skip to content

Instantly share code, notes, and snippets.

@JosephGregg
JosephGregg / hulksmashemailfilter.py
Last active April 14, 2023 21:19
hulk smash email filtering
import sys
import lxml.etree as etree
from urllib import request
import dns.resolver
def main(domain):
get_expensive_solution(domain)
get_federation_info(domain)
def get_expensive_solution(domain):
@JosephGregg
JosephGregg / azure_enum.py
Created February 9, 2023 18:13
azure_enum
#!/usr/bin/env python3
import csv
import base64
import logging
import argparse
import traceback
import lxml.etree as etree
import sys
from io import StringIO
from urllib import request
import ldap3
import sys
def get_domain_admin_usernames(server_name, domain_name):
domain_parts = domain_name.split(".")
if len(domain_parts) < 2:
print("Error: Invalid domain name")
sys.exit(1)
tld = ".".join(domain_parts[1:])
base_dn = "DC={},DC={}".format(domain_parts[0], tld)
@JosephGregg
JosephGregg / VPN_Killswitch.scpt
Last active December 29, 2018 19:31
VPN Killswitch to quit apps when VPN connection drops / Applescript
set apps to {"Transmission", "Keybase", "Signal"}
set notificationBox to "Your apps have been killed as the VPN connection was terminated at " & (current date) & "."
repeat with targetApp in apps
tell application targetApp to quit
end repeat
display dialog notificationBox

Keybase proof

I hereby claim:

  • I am josephgregg on github.
  • I am josephgregg (https://keybase.io/josephgregg) on keybase.
  • I have a public key ASDRAes4Xb-Rkvyh0Gt8CprfN9W9t0jNIajusZa0K1X0_wo

To claim this, I am signing this object:

@JosephGregg
JosephGregg / mike's ssh ninja shiz
Created April 24, 2018 02:16
ssh brute ...nah, son
-A SSH-IN -i enp4s0 -p tcp -m hashlimit --hashlimit-upto 2/min --hashlimit-burst 5 --hashlimit-mode srcip,dstport --hashlimit-name SSH_IN -m state --state NEW -m tcp --dport 22 -m comment --comment "Allow 2 new SSH connections per minute based on SRC IP and DST PORT" -j ACCEPT
-A SSH-IN -p tcp -m state --state NEW -m tcp --dport 22 -j LOG --log-prefix "IPTABLES SSH:"
-A SSH-IN -p tcp -m state --state NEW -m tcp --dport 22 -j DROP
@JosephGregg
JosephGregg / pan_tilt_center.ino
Created February 10, 2018 19:20
unique pan/tilt settings for new robot -- nodemcu
#include <Arduino.h>
#include <Servo.h>
Servo tilt, pan;
void setup ()
{
tilt.attach(14); //D5
pan.attach(4); //D2
}
#!/bin/bash
sleep 10
echo "V18" >>/dev/tts
echo "S TTS HAS BEEN CONFIGURED " >>/dev/tts
import time
from roboclaw import Roboclaw
rc = Roboclaw("/dev/ttyACM0",115200)
rc.Open()
voltage = rc.ReadMainBatteryVoltage(0x80)
if voltage[0]==False:
import time
from roboclaw import Roboclaw
rc = Roboclaw("/dev/ttyACM0",115200)
rc.Open()
voltage = rc.ReadMainBatteryVoltage(0x80)
if voltage[0]==False: