Skip to content

Instantly share code, notes, and snippets.

@hdoverobinson
hdoverobinson / ubxconfig.sh
Last active February 1, 2024 12:48
Configure u-blox GPS/GNSS modules with Bash
#!/bin/bash
###AUTHOR###
#Harry Dove-Robinson 5/8/2017
#harry@doverobinson.me
#https://gist.github.com/hdoverobinson
#https://github.com/hdoverobinson
###USAGE###
#This is a script used to configure u-blox GPS/GNSS modules from a text file generated by u-center.
@hdoverobinson
hdoverobinson / iptables-docker.rules
Created May 9, 2017 02:16
Complete ruleset that allows Docker networking behind an iptables firewall with a default drop policy
*mangle
:PREROUTING ACCEPT [0:0]
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
COMMIT
*nat
:PREROUTING ACCEPT [3530:581109]
@hdoverobinson
hdoverobinson / socat-ntp-acts.txt
Created May 9, 2017 02:14
Socat server and client for use with NTP's type 18 ACTS driver.
#This is currently used by an NTP server to access a V.92 modem over the LAN to dial the NIST ACTS.
#The options here work using a USR5686G modem over a PL2303 USB to RS232 adapter with NTP 4.2.8p8.
#NTP expects a device called "acts1" at 19200 baud. You should adjust the port number, character device file, baudrate, and lockfile to suit your environment.
#NTP will not autobaud after a successful connection using this method. The modem init string in ntpd/refclock_acts.c must be edited to lock the modem to 19200 baud.
#A ping test was added to the client to limit the number of retries it makes during a network outage.
#These are placed in startup scripts run by a cronjob.
#socat-server
/usr/bin/screen -dmS socat-server-acts1 /bin/bash -c "while true; do /usr/bin/socat -v -d -d -d -t10 tcp-l:54321,reuseaddr,keepalive file:/dev/ttyUSB0,b19200,nonblock,raw,echo=0,cread,cs8,crtscts,min=1,time=0,nl0,cr0,tab0,bs0,vt0,ff0,waitlock=/var/run/ttyUSB0.lock; done"