Skip to content

Instantly share code, notes, and snippets.

Avatar

Leif akhepcat

  • Anchorage, AK
View GitHub Profile
@akhepcat
akhepcat / ntp.conf
Created Aug 2, 2022
sanitized config file for ntp+gpsd using ArduSimple RTK-2B on pi3
View ntp.conf
# /etc/ntpsec/ntp.conf, configuration for ntpd; see ntp.conf(5) for help
# Drift file etc.
# Ensure that the directory exists, and is writable by whichever user
# the ntpd daemon runs as.
driftfile /var/lib/ntpsec/ntp.drift
leapfile /usr/share/zoneinfo/leap-seconds.list
# Enable this if you want statistics to be logged.
statsdir /var/log/ntpsec/
@akhepcat
akhepcat / reneg@.service
Created Jul 20, 2022
quick network interface renegotiation script and helper
View reneg@.service
# Install in /etc/systemd/system
# enable as 'reneg@eth0.service' or other interface(s)
#
[Unit]
Description=ethtool configuration to enable 2500mbps speed for the specified card
After=network-online.target
Wants=network-online.target
[Service]
ExecStart=/usr/local/sbin/renegotiate-eth %i
@akhepcat
akhepcat / docker-mgmt.sh
Created Feb 3, 2022
Keeping my grafana docker instance up-to-date....
View docker-mgmt.sh
#!/bin/bash
if [ -n "$(command -v docker)" ]
then
# Check if it's installed at all...
if [ -n "$(docker container ls --all | grep grafana)" ]
then
# it's installed, so first check if it's running...
if [ -n "$(docker container ls | grep grafana)" ]
then
@akhepcat
akhepcat / pkexec
Created Jan 26, 2022
replacement pkexec wrapper to log pkexec attempts
View pkexec
#!/bin/bash
# Don't forget to mv /usr/bin/pkexec /usr/bin/pkexec.bin; chmod 0 /usr/bin/pkexec.bin; before using this
PATH=/bin:/usr/bin:/sbin:/usr/sbin
PROG="${0##*/}"
SYSLOG=localhost #change to a remote collector if you have one
PID=$$
cmdline=$(tr '\0' ' ' </proc/$PPID/cmdline | tr -dc '[:print:]')
logger --priority auth.alert -n ${SYSLOG} -t "${PROG}-watch" "called by $USER, PID=$PID, Parent=$PPID, cmdline=[${cmdline}]"
@akhepcat
akhepcat / docker-grafana
Created Dec 13, 2021
Management script to ensure that grafana-docker stays up-to-date on restart
View docker-grafana
#!/bin/bash
if [ -n "$(command -v docker)" ]
then
# Check if it's installed at all...
if [ -n "$(docker container ls --all | grep grafana)" ]
then
# it's installed, so first check if it's running...
if [ -n "$(docker container ls | grep grafana)" ]
then
@akhepcat
akhepcat / default.pa
Last active Oct 21, 2020
Linux PulseAudio config for split audio channel routing
View default.pa
#!/usr/bin/pulseaudio -nF
.include /etc/pulse/default.pa
# Set up some mono-single-channel maps
load-module module-remap-sink sink_name=Left-to-Mono sink_properties="device.description='Stereo-to-Left-Only'" master=combined channels=2 master_channel_map=left,left channel_map=left,left
load-module module-remap-sink sink_name=Right-to-Mono sink_properties="device.description='Stereo-to-Right-Only'" master=combined channels=2 master_channel_map=right,right channel_map=right,right
@akhepcat
akhepcat / force-dkms.sh
Created Sep 12, 2017
dkms force builds
View force-dkms.sh
#!/bin/bash
for module in $(dkms status | sed 's/, /\//g; s/:.*//g');
do
dkms build $module -k
done
@akhepcat
akhepcat / ipcapuniq.sh
Last active May 31, 2017
a script to tcpdump only uniquely seen IP addresses
View ipcapuniq.sh
#!/bin/bash
DBFILE=ipcapuniq.log
if [ -z "${1}" ]
then
echo "$0 [iface] {expr....}"
exit 1
fi
ifaces=$(ip link show | grep UP | cut -f 2 -d: )
ifaces=$(echo $ifaces)
View keybase.md

Keybase proof

I hereby claim:

  • I am akhepcat on github.
  • I am ak_hepcat (https://keybase.io/ak_hepcat) on keybase.
  • I have a public key whose fingerprint is 1E3E 9937 804A 5948 5328 CE94 9599 700F 08BE EDA8

To claim this, I am signing this object: