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
#!/bin/bash | |
DLFILE=/path/to/file.zip | |
while [ ! -f $DLFILE ]; | |
do | |
echo "`date --rfc-3339=seconds`: Not here yet" | |
sleep 60 | |
done | |
echo "`date --rfc-3339=seconds`: It's here! Moving..." |
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
# This was the only way I could get TensorFlow to recognize the CUDA DLLs without installing Conda. | |
# Adapted from https://keras.io/api/keras_cv/models/stable_diffusion/ | |
# Set up paths as noted in https://www.youtube.com/watch?v=-Q6SM_usn84 (although ctypes is basically overriding this since the paths didn't seem get properly detected) | |
# ctypes workaround taken from https://stackoverflow.com/questions/57528027/importerror-could-not-find-cudart64-100-dll | |
# TensorFlow memory workaround taken from https://stackoverflow.com/questions/65493824/tensorflow-gpu-memory-allocation | |
# Needed to download zlib for Windows as posted on this page: http://www.winimage.com/zLibDll/zlib123dllx64.zip | |
import ctypes | |
cudart64dll = ctypes.WinDLL(r"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\bin\cudart64_110.dll") |
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 bash | |
# Download a YouTube playlist but extract audio only from the movies. | |
yt-dlp --extract-audio -ciw -o "%(title)s.%(ext)s" -v https://www.youtube.com/playlist?list=XXXXXXX_XXXXXX #Replace X's with the playlist characters |
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 | |
# How to do Basic authentication with the many_requests library, should work for Digest auth, | |
# or any other authentication method supported by the asks library. | |
# many_requests: https://github.com/joshlk/many_requests | |
# asks library authentication docs: https://asks.readthedocs.io/en/latest/overview-of-funcs-and-args.html#authing | |
from many_requests import ManyRequests | |
from asks import BasicAuth |
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 bash | |
# Taken from https://ilovesymposia.com/2013/04/11/automatically-resume-interrupted-downloads-in-osx-with-curl/ and https://ec.haxx.se/usingcurl/usingcurl-timeouts | |
export ec=18; while [ $ec -ne 0 ]; do /usr/bin/curl --speed-time 15 --speed-limit 1000 -O -C - "http://somedomain.com/path/to/some_huge_file.txt"; export ec=$?; done |
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
# Couldn't find a reference on how to authenticate to an SMTP server that doesn't require authentication, but this worked. | |
# Based on the yagmail PyPi page: https://pypi.org/project/yagmail/ | |
# and yagmail docs: https://yagmail.readthedocs.io/en/latest/api.html#smtp-client | |
import yagmail | |
user_email = "[email protected]" | |
yag = yagmail.SMTP(user=user_email, host='smtp.somedomain.com', port=25, smtp_skip_login=True, smtp_ssl=False) |
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
import time | |
import socket | |
ip = "mylicenseserver.mydomain.com" | |
port = 27000 | |
responses = [] | |
for i in range(10): | |
try: |
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 python | |
import os | |
import argparse | |
from pathlib import Path | |
import qrcode | |
from PIL import Image, ImageDraw, ImageFont |
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
export PATH="$PATH:/c/Users/ctichenor/AppData/Local/Continuum/anaconda3:/c/Users/ctichenor/AppData/Local/Continuum/anaconda3/Scripts" | |
alias python="winpty python" |
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 bash | |
find . -maxdepth 1 -type f -name '*.md' | xargs -I {} basename "{}" .md | xargs -I {} pandoc -f markdown_mmd -t html {}.md -o {}.xls |
NewerOlder