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/python3 | |
from os import listdir | |
from os.path import isdir | |
from dateutil.parser import parse as parse_time | |
from datetime import datetime, timedelta | |
from collections import namedtuple | |
import pytz | |
from subprocess import call |
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
from collections import defaultdict | |
TAG_TYPE_NULL = 0x1000 | |
TAG_TYPE_BYTE = 0x2000 | |
TAG_TYPE_WORD = 0x3000 | |
TAG_TYPE_DWORD = 0x4000 | |
TAG_TYPE_QWORD = 0x5000 | |
TAG_TYPE_STRINGREF = 0x6000 | |
TAG_TYPE_LIST = 0x7000 | |
TAG_TYPE_STRING = 0x8000 |
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 | |
import gi | |
gi.require_version('Gst', '1.0') | |
from gi.repository import GObject, Gst | |
loop = GObject.MainLoop() | |
GObject.threads_init() | |
Gst.init() |
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 | |
from socket import socket | |
import xml.etree.ElementTree as ET | |
magic = b'\x58\x91\x58\x51' | |
auth_response = """<?xml version="1.0" encoding="GB2312" ?> | |
<XML_TOPSEE> | |
<MESSAGE_HEADER |
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 | |
import sys | |
import lzma | |
import crcmod | |
from struct import unpack, iter_unpack | |
from collections import namedtuple | |
from functools import partial | |
from tabulate import tabulate | |
crc32 = crcmod.predefined.mkPredefinedCrcFun('crc-32') |
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 | |
import sys | |
from hashlib import md5 | |
from re import split | |
with open(sys.argv[1], "rb") as f: | |
data = b"".join(x for x in split(b"[\r\n]+", f.read()) if not x.startswith(b"#")) | |
m = md5() |
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 | |
import sys | |
import crcmod | |
from struct import unpack | |
from collections import namedtuple | |
def to_hex(data): | |
return ''.join('%02x' % x for x in data) |
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
def _bits(byte): | |
return [(byte >> 0) & 1, | |
(byte >> 1) & 1, | |
(byte >> 2) & 1, | |
(byte >> 3) & 1, | |
(byte >> 4) & 1, | |
(byte >> 5) & 1, | |
(byte >> 6) & 1, | |
(byte >> 7) & 1] |
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 | |
import sys, struct | |
fd = open(sys.argv[1], "rb") | |
while(True): | |
byte = fd.read(1) | |
if byte != b'-': | |
break |
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
CREATE TABLE application_settings ( | |
id bigserial NOT NULL, | |
registrationenabled boolean NOT NULL | |
); | |
CREATE TABLE devices ( | |
id bigserial NOT NULL, | |
name character varying(255), | |
uniqueid character varying(255), | |
latestposition_id bigint |