Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am DavidLutton on github.
  • I am davidlutton (https://keybase.io/davidlutton) on keybase.
  • I have a public key whose fingerprint is 5B99 DE20 5ED7 D40B 40F9 25F1 C26D 5081 9BE2 79BB

To claim this, I am signing this object:

@DavidLutton
DavidLutton / USB_rsync.sh
Last active June 7, 2017 12:48
Find USB then rsync && sync && umount USB
#!/bin/bash
# Use find to search for media matching USB*
# rsync *.pdf in current directory to media && sync && umount media
# Inform operator
while [ True ]
do
# echo -en "\a" # terminal tone (beep)
dalun@Hertz:~/Public$ python3 -m venv ~/Public/gnuradio_venv
dalun@Hertz:~/Public$ ~/Public/gnuradio_venv/bin/pip3 install pybombs
dalun@Hertz:~/Public$ alias pybombs='~/Public/gnuradio_venv/bin/pybombs'
dalun@Hertz:~/Public$ pybombs
@DavidLutton
DavidLutton / download_tumblr_likes.py
Last active December 17, 2018 22:02
Download Tumblr likes
from pprint import pprint
import time
from random import uniform
import pytumblr # https://github.com/tumblr/pytumblr
import requests
'''
MIT License
import matplotlib
from numpy import arange, sin, pi
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
from matplotlib.figure import Figure
from matplotlib.backend_bases import key_press_handler
# import matplotlib.animation as animation
import sys
import skrf as rf
from skrf.media import Freespace
from skrf.frequency import Frequency
rf.stylely()
frequency = Frequency(300e3, 6e9, 801, unit='Hz', sweep_type='lin')
med = Freespace(frequency=frequency, z0=50)
f = frequency.f
C0 = 89.939 * 10**-15
@DavidLutton
DavidLutton / filter_regions.py
Last active April 6, 2019 22:10
Find regions of a filter
import skrf as rf
import numpy as np
from matplotlib import pyplot as plt
rf.stylely()
def filter_regions(network, minimum=-3, maximum=-30, *, offset=0.0):
"""Find regions of a filter.
Parameters
@DavidLutton
DavidLutton / CSVtoBokehPlot.py
Created April 9, 2019 21:19
Convert a CSV from a logging DMM to an Bokeh plot
from pathlib import Path
from pprint import pprint
import pandas as pd
import numpy as np
from bokeh.plotting import figure, output_file, show, save
from bokeh.models import ColumnDataSource
for source in Path('.').glob('*.csv'):
@DavidLutton
DavidLutton / GetNetwork.py
Last active May 18, 2019 22:45
Download s-param network
from functools import lru_cache
import io
import requests
import skrf as rf
from matplotlib import pyplot as plt
rf.stylely()
@DavidLutton
DavidLutton / kindle.py
Last active September 15, 2024 19:19
Make use of a Kindle as a ePaper display
import time
from datetime import datetime
from textwrap import wrap
import requests
from requests_html import HTMLSession
import paramiko
import schedule
def get_traffic(road):