Skip to content

Instantly share code, notes, and snippets.

View yolabingo's full-sized avatar

Todd Jacobsen yolabingo

  • New Mexico, USA
View GitHub Profile
@jackcarter
jackcarter / slack_delete.py
Last active November 29, 2023 07:03
Delete Slack files older than 30 days. Rewrite of https://gist.github.com/jamescmartinez/909401b19c0f779fc9c1
import requests
import time
import json
token = ''
#Delete files older than this:
ts_to = int(time.time()) - 30 * 24 * 60 * 60
def list_files():
@ygotthilf
ygotthilf / jwtRS256.sh
Last active May 6, 2024 08:48
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
@carcinocron
carcinocron / debugger pause beforeunload
Last active April 25, 2024 16:48
Chrome: pause before redirect
// Run this in the F12 javascript console in chrome
// if a redirect happens, the page will pause
// this helps because chrome's network tab's
// "preserve log" seems to technically preserve the log
// but you can't actually LOOK at it...
// also the "replay xhr" feature does not work after reload
// even if you "preserve log".
window.addEventListener("beforeunload", function() { debugger; }, false)
@lukasgraf
lukasgraf / logging_sslsocket.py
Created October 24, 2014 20:54
LoggingSSLSocket
from http.server import BaseHTTPRequestHandler, HTTPServer
from socket import socket
from socketserver import ThreadingMixIn
from threading import Thread
import logging
import ssl
class LoggingSSLSocket(ssl.SSLSocket):
@boardstretcher
boardstretcher / docker.sh
Last active October 1, 2021 21:02
docker bash completion
# INSTALL BASH_COMPLETION PACKAGE FIRST!!!
# yum install bash-completion
#!bash
#
# bash completion file for core docker commands
#
@gkhays
gkhays / Java-Mail.md
Last active January 5, 2022 19:31
How to use JavaMail to send email via an SMTP server. I was recently working with a server component that allowed for scheduling reports, which included email notification. I wanted to isolate the email notification portion. Check. :)

JavaMail

SMTP test driver using JavaMail version 1.5.2.

# SSL/TLS port: 465
# Otherwise: 587
smtp.host=smtp.mail.yahoo.com
smtp.port=465
smtp.useSsl=true
@poolski
poolski / postfix.grok
Last active April 16, 2022 03:54
Usefuk Logstash GROK patterns
# Syslog stuff
COMPONENT ([\w._\/%-]+)
COMPID postfix\/%{COMPONENT:component}(?:\[%{POSINT:pid}\])?
POSTFIX %{SYSLOGTIMESTAMP:timestamp} %{SYSLOGHOST:hostname} %{COMPID}: %{QUEUEID:queueid}
# Milter
HELO (?:\[%{IP:helo}\]|%{HOST:helo}|%{DATA:helo})
MILTERCONNECT %{QUEUEID:qid}: milter-reject: CONNECT from %{RELAY:relay}: %{GREEDYDATA:milter_reason}; proto=%{WORD:proto}
MILTERUNKNOWN %{QUEUEID:qid}: milter-reject: UNKNOWN from %{RELAY:relay}: %{GREEDYDATA:milter_reason}; proto=%{WORD:proto}
@jtdp
jtdp / gist:5443297
Last active March 13, 2024 12:58
See changes before pulling from remote git repository
# fetch the changes from the remote
git fetch origin
# show commit logs of changes
git log master..origin/master
# show diffs of changes
git diff master..origin/master
# apply the changes by merge..
@jiffyclub
jiffyclub / markdown_doc
Last active August 1, 2023 11:16
This script turns Markdown into HTML using the Python markdown library and wraps the result in a complete HTML document with default Bootstrap styling so that it's immediately printable. Requires the python libraries jinja2, markdown, and mdx_smartypants.
#!/usr/bin/env python
import argparse
import sys
import jinja2
import markdown
TEMPLATE = """<!DOCTYPE html>
<html>
@adamloving
adamloving / temporary-email-address-domains
Last active April 24, 2024 14:20
A list of domains for disposable and temporary email addresses. Useful for filtering your email list to increase open rates (sending email to these domains likely will not be opened).
0-mail.com
0815.ru
0clickemail.com
0wnd.net
0wnd.org
10minutemail.com
20minutemail.com
2prong.com
30minutemail.com
3d-painting.com