Skip to content

Instantly share code, notes, and snippets.

View bonds's full-sized avatar

Scott Bonds bonds

View GitHub Profile
@bonds
bonds / gist:1cb0ae202dbe409aebb81b1f1feacbc4
Created August 6, 2022 12:36
wrappers for nix+flakes to make un/installing software easier
# ~/.config/fish/functions/nin.fish
function nin
set installed (nix profile list)
if string match "" "$argv"
set argv (cat ~/.config/nix/nin.conf)
end
@bonds
bonds / runghcc
Created December 19, 2021 19:21
script for running and caching Haskell scripts
#!/bin/sh
# Copyright (c) 2021 Scott Bonds <scott@ggr.com>
# ISC License, see https://en.wikipedia.org/wiki/ISC_license
# inspired by: https://github.com/idris-lang/Idris-dev/blob/master/scripts/runidris
# This is a script that runs a Haskell program, suitable for use in a shebang
# line. We cache the executables by naming them after the SHA hash of the
# Haskell source and looking for it before compiling.
@bonds
bonds / gps_on
Created August 11, 2017 15:06
script to run gpsd using a Ericsson H5321 on OpenBSD
#!/bin/sh
# This script allows you to use the gps function of a Lenovo H5321 (aka
# Ericsson H5321) mobile broadband module under OpenBSD 6.1.
#
# Requires: gpsd, socat, access to port 2947 on localhost (i.e. pf.conf)
# Usage: gps_on [interval] [tempfile]
#
# Forked from:
#
@bonds
bonds / gps_location
Created August 11, 2017 15:04
script to print out your gps location from gpsd
#!/bin/sh
gpspipe -w 2>&1 | grep --line-buffered lon | jq -c "{time: .time|todateiso8601, latitude: .lat, longitude: .lon}"