Skip to content

Instantly share code, notes, and snippets.

View stacksjb's full-sized avatar

Jesse stacksjb

View GitHub Profile
@coffeejoshua
coffeejoshua / pylogging.py
Last active December 21, 2022 02:51
An example logger for Python3
#!/usr/bin/env python3
# Adapted from https://docs.python.org/2/howto/logging-cookbook.html
'''
pylogging.py - Template to add logging to something in Python3
Logging level accepts strings or a numeral value:
CRITICAL 50
ERROR 40
@gdamjan
gdamjan / ssl-check.py
Last active April 14, 2024 07:16
Python script to check on SSL certificates
# -*- encoding: utf-8 -*-
# requires a recent enough python with idna support in socket
# pyopenssl, cryptography and idna
from OpenSSL import SSL
from cryptography import x509
from cryptography.x509.oid import NameOID
import idna
from socket import socket
@luelista
luelista / change_wallpaper
Last active November 24, 2019 05:02
Use the recent "Astronomy Picture of the Day" by NASA as your desktop wallpaper (Python script for Mac OS X, should be easy do adapt for Linux or Windows)
#!/usr/bin/python
# Downloads the current "Astronomy Picture of the Day" from nasa.gov and sets as wallpaper
#
# Installation steps:
# - store this file somewhere and take note of the path
# - change WALLPAPER_DIR to some folder in your home directory
# and create the folder
# - make it executable:
# chmod a+x /path/to/change_wallpaper
# - follow instructions given in the .plist file to make it run daily