Skip to content

Instantly share code, notes, and snippets.

View opensiriusfox's full-sized avatar
📡
CQ'ing for Space

Luke opensiriusfox

📡
CQ'ing for Space
  • Greater Seattle Area
View GitHub Profile
@opensiriusfox
opensiriusfox / blinky_led_ulx3s.py
Created October 7, 2023 22:23
ULX3S custom Pmod example
#!/usr/bin/env python3
from amaranth import *
from amaranth_boards.ulx3s import ULX3S_12F_Platform as ulx3s_tgt
class LEDBlinker(Elaboratable):
"""
LED Blinker reference code pulled directly from the Amaranth reference implemenetation
https://amaranth-lang.org/docs/amaranth/latest/start.html#a-blinking-led
@opensiriusfox
opensiriusfox / Windows git.bashrc
Last active June 10, 2023 23:18
Git-Bash Notepad++ shortcut
# When notepad++ is available, use it
function npp() {
export IFS=$'\n'
NOTEPADPP_EXE='/c/Program Files/Notepad++/notepad++.exe'
if [[ -e "${NOTEPADPP_EXE}" ]]; then
echo 'notepad++.exe '$*' &'
"${NOTEPADPP_EXE}" $* &
return 0
else
echo "notepad++ not found."
@opensiriusfox
opensiriusfox / bash-5-bug.sh
Last active June 10, 2021 15:00
A script to reproduce a regression from Bash 4.4 to 5.0
#!/bin/bash
echo "====="
echo "== Test #1"
echo "== Working in bash 4, broken in bash 5"
echo "====="
# Test Case 1
startTime=$(date +"%s")
recheckSleepTime=0.2
@opensiriusfox
opensiriusfox / obfuscate.py
Created May 16, 2021 03:01
A little utility ot obfuscate strings with unicode.
#!/usr/bin/env python3
import click
from random import randint
from random import random
####################################################
##### Example Execution
# $ pip3 install click
# $ chmod +x ./obfuscate.py
@opensiriusfox
opensiriusfox / tmux.conf
Created August 27, 2020 19:58
core tmux.conf
set-option -g mouse on
set-window-option -g mode-keys vi
bind r source-file ~/.tmux.conf \; display "reloaded ~/.tmux.conf"
bind \" split-window -v -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"
#set -g @ttm-window-mode vertical
@opensiriusfox
opensiriusfox / LPRPlotDefs.py
Created April 13, 2020 00:34
My dissertation/paper matplotlib tinkering scripts
#!/usr/bin/env python3
################################################################################
# Define the prefered plotting defaults.
# These generally translate to how I want stuff to show up in IEEE papers.
# Note that when I do my debugging, I override figure.figsize in my testing
# enviornment.
################################################################################
import matplotlib
import matplotlib.font_manager as FM
set(groot,'defaultAxesFontName','Proxima Nova Rg');
set(groot,'defaultPolaraxesFontName','Proxima Nova Rg');
set(groot,'defaultLegendFontName','Proxima Nova Rg');
set(groot,'defaultTextFontName','Proxima Nova Rg');
set(groot,'defaultTextarrowshapeFontName','Proxima Nova Rg');
set(groot,'defaultTextboxshapeFontName','Proxima Nova Rg');
set(groot,'defaultLegendBox','off')
%set(groot,'defaultLegendLocation','best')
@opensiriusfox
opensiriusfox / .cshrc
Created June 19, 2018 23:29
A .cshrc that chainloads to /bin/bash unless csh is explicitly needed
#!/bin/csh
# Override default login C shell to use bash, unless we explicitly call
# the shell. This allows it to be used if truly desired.
if ($SHELL != "/bin/bash") then
if ($?prompt) then
setenv SHELL /bin/bash
exec $SHELL
endif
exit
endif
@opensiriusfox
opensiriusfox / waitdone.sh
Last active June 2, 2018 22:31
waitdone - A simple bash script to sleep until another proccess is done.
#!/bin/bash
# waitdone
###############################################################################
# A simple bash script to sleep until another process is done. This is handy
# if you have an executable running in another tab/session/etc and want to
# automatically run a dependent command when the first finishes, or if you
# want to queue up another command that will make use of the same system
# resources being locked by the currently executing process.
###############################################################################
# VERSION HISTORY
@opensiriusfox
opensiriusfox / omxplayer-native_ec7ac68_lrenaud.patch
Created December 13, 2012 07:32
OMXPlayer Patch to enable Native Raspberry Pi Builds (Dec 12 2012) [For ec7ac68fa65eabcb491684d371899673cae93fbf] (Note: My Pi is out of commission for a short while, so this patch is untested. If it fails you should know almost immediately. Let me know if it fails for you and I'll get it fixed.)
diff -rupN Makefile.ffmpeg Makefile.ffmpeg
--- Makefile.ffmpeg 2012-12-12 23:20:04.000000000 -0800
+++ Makefile.ffmpeg 2012-12-12 23:22:48.000000000 -0800
@@ -8,11 +8,11 @@ all: checkout configure compile
copy:
find ffmpeg -name '*.so*' -exec cp {} . \;
- $(HOST)-strip *.so*
+ strip *.so*