Skip to content

Instantly share code, notes, and snippets.

@ariscop
ariscop / songhash.py
Last active Aug 29, 2015
USDX-WP song hash thingy
View songhash.py
#!/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()
@ariscop
ariscop / extract_ros.py
Created Feb 24, 2015
Extracts .ros firmware files used by some netgear swtiches, eg: ng_gs728_52tp_516tp_bx-60116.ros
View extract_ros.py
#!/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
ariscop / clear_snapshot
Created May 18, 2015
Trivial utils for managing snapshots
View clear_snapshot
#!/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
@ariscop
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
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
ariscop / names.py
Created Jun 9, 2015
dump sdb files as xml
View names.py
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
View id_ecdsa.pub
ecdsa-sha2-nistp521 AAAAE2VjZHNhLXNoYTItbmlzdHA1MjEAAAAIbmlzdHA1MjEAAACFBAD3JmRaQbYK2WIXKjVNOf/43GrVZpABKf06nc2Olv/tsNni4roI1lLBc6n/39FXjCYpeijf5BaJYHI97sq37eGfqQEVHRY/ihBwlVt/F6SN4SYssFcOEWyiXwQMnmIUrQeLEqkOdkc7ZklaxA+KF/K5IBPvL7ldzQbIhY5MJt7o4Zz9vA== ariscop@gmail.com
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 http://goo.gl/ObMZs2 http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/1288346 furnace3d 1.3a 0 1.4 []
1432764026 4Space ['MinecraftForge', 'Galacticraft'] [] Mattparks http://goo.gl/bQ9pwP http://4space.mods.center/ SpaceCore 4.1.3 0 4.1.9 [] Galacticraft addon
1438453027 AbyssalCraft ['MinecraftForge'] [] Shinoow http://goo.gl/HrvVev http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/1287002 abyssalcraft 1.7.8.1 0 1.8.7 []
1426578995 AchieveSON ['MinecraftForge'] [] Lomeli12 http://goo.gl/aZ04lE http://www.curse.com/mc-mods/minecraft/227850-achieveson achieveson 0 1.0.1 [] Add custom achievements via json, example here http://goo.gl/v6BCjV
1438621441 ActuallyAdditions ['MinecraftForge'] [] Ellpeck http://goo.gl/xr7W16 http://www.minecraftforum.net/forums/mapping-and-modding/
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(f.read(), 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