Skip to content

Instantly share code, notes, and snippets.

Dylan Grafmyre thorsummoner

View GitHub Profile
View vmstat-prettyblocks-braille
#!/usr/bin/env python3
import argparse
import logging
import psutil
import random
import sys
import time
import shutil
import os
View doomsday-clock
python3 <(printf "import pyfiglet, re, sys, pytz, datetime, time\nwhile True:\n\tprint('\\033[1;1H{}'.format(pyfiglet.Figlet(font=sys.argv[1], width=float('inf')).renderText(' '.join(str(pytz.timezone('utc').localize(datetime.datetime(year=2018, month=10, day=31, hour=23, minute=59, second=59)) - pytz.timezone('America/Los_Angeles').localize(datetime.datetime.now()))))))\n\ttime.sleep(0.02)\n") univers
@thorsummoner
thorsummoner / mcad
Created Apr 22, 2018
Minecraft Server Advertizements
View mcad
#!/usr/bin/env python3
import time
import socket
servers = [
["MOTD", 25565],
]
BROADCAST_IP = "255.255.255.255"
@thorsummoner
thorsummoner / nettest.py
Created Jul 6, 2017
Serve file of size N over facecgi.
View nettest.py
#!/usr/bin/python3
import os
import subprocess
import re
import humanfriendly
SIZE_RE = re.compile("^\d{,4}([KMG])$")
def main():
file_size = (
@thorsummoner
thorsummoner / nettest.cgi.py
Created Mar 16, 2017
Dispatch zero-fill file of user request size over the network.
View nettest.cgi.py
#!/usr/bin/python3
import os
import subprocess
import re
import humanfriendly
SIZE_RE = re.compile("^\d{,4}([KMG])$")
def main():
file_size = (
View js-bind.js
my_hello = 'Hello!'
my_world = {
'antartica': 'cold',
}
anonymous_callback = function (injected1, injected2, param1, param2) {
param1 = param1 ? param1 : 'One';
param2 = param2 ? param2 : 'Two';
View __main__.py
#!/usr/bin/env python3
""" Example argparser based python file
"""
import argparse
ARGP = argparse.ArgumentParser(
description=__doc__,
formatter_class=argparse.RawTextHelpFormatter,
@thorsummoner
thorsummoner / userlogs
Created Jan 18, 2017
logrotate user logs
View userlogs
# /etc/logrotate.d/userlogs
/var/run/user/*/log/*.log
/var/run/user/*/log/**/*.log
{
daily
missingok
rotate 7
compress
notifempty
@thorsummoner
thorsummoner / pythonic.md
Created Oct 21, 2016
How to be pythonic
View pythonic.md

To answer "getting a better understanding of python", I feel strongly that

View get_website_aal_dns_aliases.sh
#!/bin/sh
true | openssl s_client -connect outlook.com:443 | openssl x509 -noout -text | grep -B1 DNS:
You can’t perform that action at this time.