I hereby claim:
- I am wecsam on github.
- I am wecsam (https://keybase.io/wecsam) on keybase.
- I have a public key whose fingerprint is EADF 834A CB9A 4425 BFA7 9286 86A1 72A6 1CB7 6334
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
#!/usr/bin/env python3 | |
# DTMF = Dual Tone Multi-Frequency | |
import itertools, math, pyaudio, random, sys | |
BITRATE = 8000 | |
TONE_DURATION = 0.1 # seconds | |
KEY_FREQUENCIES = { | |
'1': (697, 1209), | |
'2': (697, 1336), | |
'3': (697, 1477), | |
'A': (697, 1633), |
#!/usr/bin/python3 | |
import os, sys | |
# This script takes a string as an argument and outputs the same path with as many | |
# environment variables substituted in as possible. | |
def variable_syntax(variable_name): | |
try: | |
return { | |
"nt": lambda variable_name: "%" + variable_name + "%", | |
"posix": lambda variable_name: "$" + variable_name | |
}[os.name](variable_name) |
import os, requests, threading, time, winreg | |
from selenium import webdriver | |
# Module-wide lock to prevent multiple WebDriver instances from running at the same time | |
_webdriver_lock = threading.Lock() | |
def get_windows_build_number(): | |
key = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r"SOFTWARE\Microsoft\Windows NT\CurrentVersion") | |
try: | |
return int(winreg.QueryValueEx(key, "CurrentBuild")[0]) |
import win32com.client | |
class AttachmentInfo: | |
def __init__(self, file_path, mime_type, attachment_id=None): | |
self.file_path = file_path | |
self.mime_type = mime_type | |
self.id = attachment_id | |
def draft_html( | |
to=(), |
@REM Pull events with IDs 1123, 1124, and 5007 from the last day. | |
@REM Get-WinEvent "Microsoft-Windows-Windows Defender/Operational" | ? { $_.Id -eq 1123 -or $_.Id -eq 1124 -or $_.Id -eq 5007 } | ? { ((Get-Date) - $_.TimeCreated).TotalDays -le 1 } | Format-List | |
@powershell -EncodedCommand RwBlAHQALQBXAGkAbgBFAHYAZQBuAHQAIAAiAE0AaQBjAHIAbwBzAG8AZgB0AC0AVwBpAG4AZABvAHcAcwAtAFcAaQBuAGQAbwB3AHMAIABEAGUAZgBlAG4AZABlAHIALwBPAHAAZQByAGEAdABpAG8AbgBhAGwAIgAgAHwAIAA/ACAAewAgACQAXwAuAEkAZAAgAC0AZQBxACAAMQAxADIAMwAgAC0AbwByACAAJABfAC4ASQBkACAALQBlAHEAIAAxADEAMgA0ACAALQBvAHIAIAAkAF8ALgBJAGQAIAAtAGUAcQAgADUAMAAwADcAIAB9ACAAfAAgAD8AIAB7ACAAKAAoAEcAZQB0AC0ARABhAHQAZQApACAALQAgACQAXwAuAFQAaQBtAGUAQwByAGUAYQB0AGUAZAApAC4AVABvAHQAYQBsAEQAYQB5AHMAIAAtAGwAZQAgADEAIAB9ACAAfAAgAEYAbwByAG0AYQB0AC0ATABpAHMAdAA= | |
@PAUSE |
#!/usr/bin/env python3 | |
import argparse, io, socketserver, sys, threading | |
class StringServer(socketserver.BaseRequestHandler): | |
# These headers will be sent with every HTTP reply. | |
HEADERS = ( | |
b"HTTP/1.1 200 OK\r\n" | |
b"Content-Type: application/octet-stream\r\n" | |
) | |
# If True, then data that is received will be forwarded to STDOUT. |
#!/usr/bin/env python3 | |
import collections, os.path, queue, sys, textwrap, threading, time | |
UNITS = { | |
"char": lambda fin: fin.read(1), | |
"line": lambda fin: fin.readline(), | |
} | |
def producer(backlog, stop, unit_getter, fin): | |
''' | |
Continually does backlog.put(unit_getter(fin)). If KeyboardInterrupt |
' This macro is for Microsoft Outlook. It opens a file picker dialog and then | |
' attaches the selected files to the selected items. | |
' This macro requires the object library for the installed version of Microsoft | |
' Word. In the VBA editor, go to Tools > References... and make sure that it is | |
' checked off. For Word 2016, choose the Microsoft Word 16.0 Object Library. | |
Sub AddAttachmentsToSelection() | |
Dim objMessage As Variant | |
Dim strPath As Variant | |
' Outlook does not have a file picker. Use an instance of Word instead. | |
Dim appWord As Word.Application |
#!/usr/bin/env python3 | |
''' | |
Import this module to ensure that at most one instance of the main script can | |
be running at once. If another instance is detected, sys.exit() will be called. | |
The psutil package is required: pip install psutil | |
''' | |
import atexit, logging, math, os, psutil, socket, sys | |
logger = logging.getLogger("prevent_parallel") | |
PID_FILE = \ |