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
#DESIGNED FOR MICROPYTHON | |
server_dict = [{"address": "test.com","fingerprints":[bytearray('adlfasdfekre3r2309234902302lqkejroi23ro239842342304')]}] #list of possible servers and accepted keys | |
def download_file(server_dir,filename,server_index=0,block_size=512): #Boneless file downloader | |
#typical socket stuff | |
s = socket.socket() | |
s.settimeout(60) | |
ai = socket.getaddrinfo(server_dict[server_index]['address'], 443) #FIXME: This will probably do a dns lookup every time - probably shouldn't. | |
addr = ai[0][-1] |
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
#Need a G-code tapered helix, like a SPTM thread milled NPT thread? This is that. | |
#Designed for linuxcnc, but you can just change the template G code to whatever you need. | |
#WARNING! Be careful with this script. Always dry run generated code. | |
#all dims. in mm. | |
import math | |
import numpy as np | |
res = 0.01 #how accurate do you want the path to be | |
thread_pitch = 1.81356 #pretty obvious. | |
thread_depth = 13.71600 #how deep do you want the hole to be threaded |
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
from mido import MidiFile | |
mid = MidiFile('onmyown1.mid') | |
NOTE_NUMBER = 129 | |
NOTE_DURATION_THRESHOLD = 30 | |
freqs = [] | |
times = [] | |
for i, track in enumerate(mid.tracks): | |
print('Track {}: {}'.format(i, track.name)) |
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
2019-01-10 | |
attended | |
2019-01-17 | |
attended | |
2019-01-31 | |
attended | |
2019-02-07 | |
attended | |
2019-02-28 | |
attended |
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
#python3 induction.py | |
import numpy as numpy | |
import math | |
import matplotlib.pyplot as plt | |
SIZE_X = 128 | |
SIZE_Y = 256 | |
LENGTH_SCALE = 0.01#meters/node |
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
#python3 script to decode the output from an Inficon BPG400 high vacuum gauge | |
#or, as I prefer to call it, the BFG | |
#Call like python3 gauge.py SERIALPORT h | |
# for human readable output, or without h for | |
# csv-compatible. | |
#yittrium oxide filament! | |
# 0 Length of data string 7 (Set value) | |
# 1 Page number 5 (For BPG400) | |
# 2 Status - Status byte |
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
# see http://www.cse.yorku.ca/~kosta/CompVis_Notes/fourier_transform_Gaussian.pdf | |
# http://www.sci.utah.edu/~gerig/CS7960-S2010/handouts/04%20Gaussian%20derivatives.pdf | |
def normalized_gaussian_pulse(t,fwhm): | |
sigma = fwhm/2.355 | |
return exp(-((t**2.0)/(2.0*(sigma**2.0)))) | |
def normalized_gaussian_derivative_pulse(t,fwhm): | |
sigma = fwhm/2.355 | |
return (exp((1.0/2.0) - (t**2.0)/(2.0*sigma**2.0))*t)/sigma |
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
# <add spaces to keep out of bash hist> export RESTIC_PASSWORD="" | |
# run this command with sudo -E ./restic.sh | |
######## | |
lvcreate -L 20G -s -n backup-snapshot /dev/new_root/lv0 || exit 1 | |
mount /dev/new_root/backup-snapshot /home/arthurdent/NAS/backup-snapshot || exit 1 | |
export B2_ACCOUNT_ID="XXXXXXXXXX" |
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
{ | |
"extractor": { | |
"twitter": { | |
"archive": "/home/arthurdent/archive.db", | |
"cookies": { | |
"auth_token": "" | |
}, | |
"syndication": true, | |
"logout": true, | |
"replies": true, |