Skip to content

Instantly share code, notes, and snippets.

Keegan McAllister kmcallister

Block or report user

Report or block kmcallister

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@kmcallister
kmcallister / calc
Created Jul 28, 2019
Weight tracking scripts
View calc
#!/bin/sh
#set -e
./ewma.py < log > smoothed
echo
./progress.py "$@" < smoothed
echo
gnuplot < weight-graph.gpl
View breathe.py
#!/usr/bin/env python3
import time
import sys
repeats = 12
phases = [
('Inhale', 4),
('Hold', 2),
('Exhale', 6),
@kmcallister
kmcallister / logger.py
Created Jul 4, 2019
Dead-simple DS1054Z data logger
View logger.py
#!/usr/bin/env python
import time
import visa
IP_ADDR = '192.168.50.219'
INTERVAL = 1.0
rm = visa.ResourceManager('@py')
scope = rm.open_resource('TCPIP::%s::INSTR' % (IP_ADDR,))
View bot.py
#!/usr/bin/env python
import itertools
import colorsys
import datetime
import irc.bot
import random
import socket
import struct
import sys
import re
View ntp.conf
$ ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
*SHM(0) .GPS. 0 l 16 16 377 0.000 -1.389 2.475
$ ntpq -cv
ntpq 4.2.8p10@1.3728-o Sat Mar 10 18:04:53 UTC 2018 (1)
$ ntpq -c rl
associd=0 status=0418 leap_none, sync_uhf_radio, 1 event, no_sys_peer,
version="ntpd 4.2.8p10@1.3728-o Sat Mar 10 18:03:33 UTC 2018 (1)",
processor="armv7l", system="Linux/4.14.98-v7+", leap=00, stratum=1,
@kmcallister
kmcallister / nmea.txt
Created May 12, 2019
GPS receiver output
View nmea.txt
(35) $GPVTG,,T,,M,0.660,N,1.222,K,A*20
(75) $GPGGA,212239.00,3745.75505,N,12229.50685,W,1,07,1.12,69.6,M,-29.8,M,,*56
(56) $GPGSA,A,3,19,17,06,24,28,02,12,,,,,,2.32,1.12,2.02*06
(68) $GPGSV,4,1,13,02,40,181,22,03,01,043,,06,60,124,19,12,31,304,21*7F
(66) $GPGSV,4,2,13,13,03,200,,15,06,231,,17,38,047,24,19,59,035,24*70
(66) $GPGSV,4,3,13,24,56,280,25,28,18,098,14,44,46,171,,48,45,197,*74
(29) $GPGSV,4,4,13,51,43,156,*4A
(52) $GPGLL,3745.75505,N,12229.50685,W,212239.00,A,A*71
(60) b56201063400509796040667fbff050803dd64c8d5ef203e9ee6cd88271708090000090000000a0000001100000066000000e800030784d301005a59
@kmcallister
kmcallister / rail.csv
Created Mar 27, 2019
Rail frequencies
View rail.csv
Location Name Frequency
501 JPBXRD 160.815000
502 JPBXMW 161.505000
503 JPBXMW 160.575000
504 JPBXYD 161.070000
505 JPBXYD 161.565000
506 JPBXSW 161.550000
507 WINE1 160.575000
508 WINE3 161.085000
509 WINE4 161.175000
View bay_area_repeaters.csv
Location Name Frequency Duplex Offset Tone rToneFreq cToneFreq DtcsCode DtcsPolarity Mode TStep Skip Comment URCALL RPT1CALL RPT2CALL DVCODE
21 W6PW 2 145.150000 - 0.600000 DTCS 88.5 88.5 664 NN FM 5.00
22 W6PW 7 444.225000 + 5.000000 DTCS 88.5 88.5 664 NN FM 5.00
23 W6EE 441.450000 - 5.000000 TSQL 85.4 85.4 023 NN FM 5.00
24 K6POU 145.330000 - 0.600000 Tone 100.0 88.5 023 NN FM 5.00
25 K6POU 443.800000 + 5.000000 Tone 100.0 88.5 023 NN FM 5.00
26 WA6HAM 145.410000 - 0.600000 TSQL 107.2 107.2 023 NN FM 5.00
27 WA6HAM 145.490000 - 0.600000 TSQL 107.2 107.2 023 NN FM 5.00
28 WA6HAM 147.735000 - 0.600000 TSQL 107.2 107.2 023 NN FM 5.00
29 KF6REK 442.470000 + 5.000000 TSQL 114.8 114.8 023 NN FM 5.00
View foo.c
#include <util/atomic.h>
void blahblah();
void foo() {
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
blahblah();
}
}
View foo.c
#include <util/atomic.h>
void blahblah();
void foo() {
ATOMIC_BLOCK(ATOMIC_FORCEON) {
blahblah();
}
}
You can’t perform that action at this time.