Skip to content

Instantly share code, notes, and snippets.

View luser's full-sized avatar

Ted Mielczarek luser

View GitHub Profile
[2015-05-01 11:27:16.010][debug][command:c1965204-3ace-4e14-b6d6-7302b889b680][tid:01][com.facebook.buck.cli.Main] Starting up (build date 2015-05-01 10:55:52 -0400, rev 402d6b7e5365daec5cf93a05589e1a74b1200b88), args: [build, --verbose=10, :rr]
[2015-05-01 11:27:16.069][debug][command:c1965204-3ace-4e14-b6d6-7302b889b680][tid:01][com.facebook.buck.io.ExecutableFinder] Executable 'python2' mapped to 'Optional.of(/usr/bin/python2)'
[2015-05-01 11:27:16.130][debug][command:c1965204-3ace-4e14-b6d6-7302b889b680][tid:01][com.facebook.buck.cxx.CxxPlatforms] Using system default C++ platform CxxPlatform{flavor=default, as=com.facebook.buck.cxx.HashedFileTool@1a3869f4, asflags=[], aspp=com.facebook.buck.cxx.HashedFileTool@a38d7a3, asppflags=[], cc=com.facebook.buck.cxx.HashedFileTool@77f99a05, cflags=[], cxx=com.facebook.buck.cxx.HashedFileTool@63440df3, cxxflags=[], cpp=com.facebook.buck.cxx.HashedFileTool@3aeaafa6, cppflags=[], cxxpp=com.facebook.buck.cxx.HashedFileTool@76a3e297, cxxppflags=[], cxxld=com.facebook.b
#!/usr/bin/env python
import sys
from subprocess import check_call
from tempfile import NamedTemporaryFile
INLINE_SCRIPT = """{filename}
import gdb
import urllib
if 'srcmap' not in globals():
@luser
luser / packagesymbols.py
Last active June 11, 2021 10:10
Scripts to produce symbol package and upload to Mozilla crash-stats server
#!/usr/bin/env python
from __future__ import print_function
import argparse
import os
import subprocess
import sys
import zipfile
@luser
luser / irccexport.py
Last active January 3, 2018 21:00 — forked from dpk/irccexport.py
Quick-and-dirty IRCCloud log export tool
#!/usr/bin/env python3
# Run this like:
# ircexport.py <email> <password> <log directory>
import requests
import json
import sys
from collections import deque
from concurrent.futures import ThreadPoolExecutor as Pool
from datetime import datetime
#!/usr/bin/env python
import bisect
import subprocess
import sys
def lookup(lib, find_addr):
funcs = {}
for line in subprocess.check_output(['readelf', '-s', lib]).splitlines():
line = line.strip()
#!/usr/bin/env python
from BaseHTTPServer import BaseHTTPRequestHandler
from SocketServer import ThreadingTCPServer
from spotify.util import logging_support
import distutils.spawn
import logging
import os
import requests
import shutil
import signal
#!/usr/bin/env python
'''
Given a revision, this script finds the first release tag that contains
that revision in a local Chromium git clone.
'''
import subprocess
import sys
from distutils.version import LooseVersion
@luser
luser / lldb-disassemble-stack.py
Created October 1, 2015 22:05
Run LLDB and disassemble the top 10 functions on the stack
#!/usr/bin/env python
import os
import re
import sys
sys.path.insert(0, '/Library/Developer/CommandLineTools/Library/PrivateFrameworks/LLDB.framework/Resources/Python/')
import lldb
MAX_FRAMES = 10
@luser
luser / dump_pe_pdb_info.cpp
Created October 29, 2015 17:52
Dump PDB information from a PE file
#include <stdio.h>
#include <stdint.h>
#include <Windows.h>
#include <string>
#include <DbgHelp.h>
#pragma comment(lib, "dbghelp.lib")
const DWORD CV_SIGNATURE_RSDS = 0x53445352; // 'SDSR'
@luser
luser / pocketsphinx-gstreamer.py
Created November 16, 2015 16:35
Use PocketSphinx with Gstreamer 1.0
#!/usr/bin/env python
# Any copyright is dedicated to the Public Domain.
# http://creativecommons.org/publicdomain/zero/1.0/
#
# Example of using gstreamer 1.0 with PocketSphinx without a GUI.
#
# If you're having problems with this, try this gst-launch command first:
# gst-launch-1.0 uridecodebin uri=http://ted.mielczarek.org/test.wav ! audioconvert ! audioresample ! pocketsphinx ! fdsink fd=1
# It should print the usual gst-launch output with the recognition results in
# the middle.