Skip to content

Instantly share code, notes, and snippets.

ariscop /
Last active Aug 29, 2015
USDX-WP song hash thingy
#!/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]+", if not x.startswith(b"#"))
m = md5()
ariscop /
Created Feb 24, 2015
Extracts .ros firmware files used by some netgear swtiches, eg: ng_gs728_52tp_516tp_bx-60116.ros
#!/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')
ariscop / clear_snapshot
Created May 18, 2015
Trivial utils for managing snapshots
View clear_snapshot
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
ariscop / Output
Last active Aug 29, 2015
C++ Ref counting template
View Output
Sizeof Integer: 48
Sizeof Ref<Integer>: 8
Refcount is 1
Refcount is 2
Value: 12
Refcount is 1
Refcount is 0
ariscop / gist:4213cfdb3b1d5b341a6b
Created Jun 9, 2015
Windows 7 appcompat shims sorted by usage
View gist:4213cfdb3b1d5b341a6b
2165 GameUX
619 VirtualRegistry
551 CorrectFilePaths
468 Win95VersionLie
377 VistaRTMVersionLie
305 WinXPSP2VersionLie
199 ShimViaEAT
194 IgnoreAltTab
164 AOLFindBundledInstaller
152 ElevateCreateProcess
ariscop /
Created Jun 9, 2015
dump sdb files as xml
from collections import defaultdict
TAG_TYPE_NULL = 0x1000
TAG_TYPE_BYTE = 0x2000
TAG_TYPE_WORD = 0x3000
TAG_TYPE_LIST = 0x7000
ecdsa-sha2-nistp521 AAAAE2VjZHNhLXNoYTItbmlzdHA1MjEAAAAIbmlzdHA1MjEAAACFBAD3JmRaQbYK2WIXKjVNOf/43GrVZpABKf06nc2Olv/tsNni4roI1lLBc6n/39FXjCYpeijf5BaJYHI97sq37eGfqQEVHRY/ihBwlVt/F6SN4SYssFcOEWyiXwQMnmIUrQeLEqkOdkc7ZklaxA+KF/K5IBPvL7ldzQbIhY5MJt7o4Zz9vA==
View 1.7.10.csv
We can make this file beautiful and searchable if this error is corrected: It looks like row 3 should actually have 1 column, instead of 2. in line 2.
dev lastupdated name dependencies tags author shorturl longurl modid repo prevversion license added_at version aliases comment
1424268785 3DFurnace ['MinecraftForge'] [] spAnser furnace3d 1.3a 0 1.4 []
1432764026 4Space ['MinecraftForge', 'Galacticraft'] [] Mattparks SpaceCore 4.1.3 0 4.1.9 [] Galacticraft addon
1438453027 AbyssalCraft ['MinecraftForge'] [] Shinoow abyssalcraft 0 1.8.7 []
1426578995 AchieveSON ['MinecraftForge'] [] Lomeli12 achieveson 0 1.0.1 [] Add custom achievements via json, example here
1438621441 ActuallyAdditions ['MinecraftForge'] [] Ellpeck
View json2csv
#!/usr/bin/env python3
import sys
import json
data = []
with open(sys.argv[1], "r", encoding="utf-8") as f:
data = json.loads(, encoding="utf-8")
keys = data[0].keys()
View -
$ cppcheck ass0.c ±[master]
Checking ass0.c...
[ass0.c:71]: (error) Memory leak: e
[ass0.c:99]: (error) Uninitialized variable: newEntry
[ass0.c:100]: (error) Uninitialized variable: newEntry
[ass0.c:115]: (error) Uninitialized variable: newEntry