Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am kk7ds on github.
  • I am dansmith (https://keybase.io/dansmith) on keybase.
  • I have a public key whose fingerprint is E124 C163 113A 5794 E8C2 33D7 1799 C5A3 044A 3355

To claim this, I am signing this object:

@kk7ds
kk7ds / idle.py
Last active August 29, 2015 14:14
Script to sleep machine based on login idle times
#!/usr/bin/python
import datetime
import subprocess
import sys
import time
now = datetime.datetime.now()
if now.hour > 6 and now.hour < 19:
timeout_hours = 4
@kk7ds
kk7ds / wakeupd.py
Last active August 29, 2015 14:14
Daemon to watch for ARP requests and issue WOL packets
# Copyright 2015 Dan Smith <dsmith@danplanet.com>
import logging
import optparse
import os
import socket
import struct
import subprocess
import sys
import time
#!/bin/bash
curl https://raw.githubusercontent.com/openstack-dev/devstack/5df868e83d2761fec9cdfba1c04df17c6a766fb4/lib/nova |\
grep m1 | grep create | bash
@kk7ds
kk7ds / nts.el
Created January 31, 2017 17:31
An emacs module for recording NTS traffic
;;
;; nts.el - Copyright 2009 Dan Smith KK7DS (dsmith at danplanet dot com)
;;
;; To use, place the following in ~/.emacs:
;;
;; (require 'nts)
;;
;; To instantiate a form, execute M-x nts-make-form RET
;;
;; The Validate, SENT, and RECV buttons will save the form in the Active
#!/usr/bin/python
import collections
import datetime
import re
import sys
import time
import pprint
diff --git a/nx584/controller.py b/nx584/controller.py
index fe64d56..4ee5d90 100644
--- a/nx584/controller.py
+++ b/nx584/controller.py
@@ -505,8 +505,15 @@ class NXController(object):
event.reportable = bool(frame.data[2] & 0x80)
event.zone_user_device = frame.data[3]
event.partition_number = frame.data[4]
- month = frame.data[5]
- day = frame.data[6]
#!/usr/bin/python
#
# Copyright 2019 Dan Smith <dsmith+gist@danplanet.com>
#
# This fixes broken Gaia GPX files which fail to pass the GPX 1.1 schema
# check (and thus won't import into real software) because the elements
# are ordered incorrectly.
#
# Run me like this:
#
import collections
import logging
import json
import sys
import threading
import time
from oslo_config import cfg
import oslo_messaging
import logging
import re
import struct
import subprocess
import sys
Mi = 1024 * 1024
LOG = logging.getLogger(__name__)