Skip to content

Instantly share code, notes, and snippets.

View duckythescientist's full-sized avatar

Sean Murphy duckythescientist

View GitHub Profile
@duckythescientist
duckythescientist / stable_diffusion_collected_notes.md
Last active February 22, 2024 03:38
Stable Diffusion Image Generation Notes
@duckythescientist
duckythescientist / uwu_logging.py
Created January 10, 2023 23:02
Is your Python logging not UwU enough for you? Well, do I have a solution!
#!/usr/bin/env python3
"""
Notices your logging, OwO what's this?
"""
import logging
@duckythescientist
duckythescientist / mbs_karplus_strong_vsr_smoothing.ino
Created April 15, 2021 05:07
Karplus Strong for a single board ATtiny85 Eurorack module
/*
Make Better Choices
Single-board/panel Eurorack module
1 audio/cv input
1 audio/cv output
1 gate/trigger input or output
1 potentiometer
2 RGB LEDs
@duckythescientist
duckythescientist / morse_echo.sh
Last active September 4, 2019 01:42
Blink text as morse code to the Raspberry Pi built-in LED
#!/usr/bin/env bash
# Blink out text using the Pi's built-in status LED
# Example usage: ./morse_echo.sh hello world
# Requires root for the Raspberry Pi
DIT_SPACE="0.2"
INTER_CHARACTER_SPACE="0.4" # 2xDIT_SPACE for normal timing (3 total)
INTER_WORD_SPACE="0.8" # 4xDIT_SPACE for normal timing (7 total)
# Increase INTER_WORD_SPACE and INTER_CHARACTER_SPACE more than "normal" for Farnsworth timing
@duckythescientist
duckythescientist / quit_with_q.py
Last active April 17, 2019 01:38
Quit from Python/IPython with a `q` statement
#!/usr/bin/env python3
# export PYTHONSTARTUP="$HOME/.pythonrc"
# Allow you to quit from python/IPython with a `q` statement
# instead of just `quit` or `exit()`
import sys
from functools import wraps
@duckythescientist
duckythescientist / Dockerfile
Created January 4, 2019 02:42
Dockerfile for Kurso de Esperanto
# Dockerfile for Kurso de Esperanto
# !!!!!!!!! NOT WORKING !!!!!!!!
# `WARNING: bool Phonon::FactoryPrivate::createBackend() phonon backend plugin could not be loaded`
# Sound fails to play through the container
FROM ubuntu:16.04
RUN apt-get update && apt-get update \
&& apt-get install -y \
liboss4-salsa-asound2 \
@duckythescientist
duckythescientist / fix.sh
Last active April 16, 2019 16:13
Fix my monitors and touchpad because Linux doesn't work on laptops
#!/bin/bash
cachedir="${XDG_CACHE_HOME:-$HOME/.cache}"
synclient ClickFinger3=2
synclient TapButton3=2
synclient EmulateMidButtonTime=50
pkill syndaemon
syndaemon -d -t -K -i 1.0
@duckythescientist
duckythescientist / worklog.sh
Created December 15, 2018 00:15
Quick notes by date
#!/usr/bin/env bash
worklog_dir="worklog"
editor="subl"
show_usage () {
cat <<-EOF
Create a diary text file by week in the $worklog_dir subdirectory
by the year and month. Automagically adds a heading to the file
and opens the file with $editor to the current* date.
@duckythescientist
duckythescientist / entropy_crib.py
Created July 16, 2018 03:57
Plot the entropy of the xor of two texts as one is shifted against the other. Good for finding key length for xor encryption.
#!/usr/bin/env python3
import math
import numpy as np
import matplotlib.pyplot as plt
# def string_shannon(data):
# '''Performs a Shannon entropy analysis on a given block of data.
@duckythescientist
duckythescientist / pprimes.py
Last active March 4, 2018 21:28
Permutable Primes
#!/usr/bin/env python3
# Or python2
import itertools
import collections
# @profile
def get_primes(nMax):
"""Return a set of prime numbers under nMax