This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |