This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Adam Sharp | |
# Aug 21, 2013 | |
# | |
# Usage: Add it to your PATH and `git remove-submodule path/to/submodule`. | |
# | |
# Does the inverse of `git submodule add`: | |
# 1) `deinit` the submodule | |
# 2) Remove the submodule from the index and working directory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ctypes as c | |
import string | |
import logging; log = logging.getLogger(__name__) | |
# ... | |
def dump(obj, logger=log.info): | |
# assert isinstance(obj, c.C_TYPE) | |
B = [] | |
C = [] | |
offset = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import os | |
import errno | |
AUTO_EXPAND_USER = True | |
def RootFS(root='/'): return FS(root) | |
def SysFS(root='/sys'): return FS(root) | |
def ProcFS(root='/proc'): return FS(root) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import sys | |
CHUNK_SIZE = 1024 | |
LINE_LENGTH = 16 | |
if __name__ == '__main__': | |
if len(sys.argv) < 3: | |
print('Usage: ' + sys.argv[0] + ' ${input_name} ${output_name} < ${bin_file} > ${c_file}') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Supplemental thing for better handling of json.load() results. | |
I.e. keep it ordered. | |
''' | |
from collections import OrderedDict | |
import json | |
class OrderedJson(OrderedDict): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
'''The Pelco-D Protocol | |
Standard Number TF-0002 | |
Version 2 Revision 1 Release Date August 15, 2003 | |
Transmitters will format a single character and receivers will be able to | |
decipher a single character as: 1 start bit, 8 data bits, 1 stop bit, | |
and no parity. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from __future__ import print_function | |
from setuptools import setup, Extension | |
from distutils import spawn | |
from distutils.util import get_platform | |
from distutils.version import LooseVersion | |
from logging import info, warning, error | |
import argparse | |
import ctypes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
''' | |
lsusb for MacOS after https://github.com/jlhonora/lsusb | |
MacBook-Pro-apple-2:~ jno$ system_profiler SPUSBDataType | |
2018-12-19 15:14:49.583 system_profiler[96589:1580584] SPUSBDevice: IOCreatePlugInInterfaceForService failed 0xe00002be | |
USB: | |
USB 3.0 Bus: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
''' | |
Garmin JNX as of http://whiter.brinkster.net/JNX.shtml | |
''' | |
import logging; log = logging.getLogger('JNX' if __name__ == '__main__' else __name__) | |
import sys | |
import os | |
import struct | |
import json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
''' | |
After https://gist.github.com/jn0/7739995c5b7da04183ffc7ebfe65ff35 script | |
we have a whole bunch of JPEG tiles and this JSON: | |
{ | |
"header": { | |
"signature_offset": 0, | |
"coordinates": { | |
"sw_lon": 36.36583659628678, |