Skip to content

Instantly share code, notes, and snippets.

#!/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()
@luser
luser / iTunesDBLoader.cs
Created August 13, 2025 17:49
Very old C# code for reading a binary iTunes Library file
using System;
using System.Windows.Forms;
using System.IO;
using System.Text;
namespace iTunesDBBrowser
{
public delegate void UpdateFormDelegate(Song song, long bytes, long totalbytes);
public struct Song
@luser
luser / fetch_microsoft_symbols.py
Created March 6, 2015 21:04
Fetch and convert PDB files from Microsoft's symbol server to Breakpad .sym format
#!/usr/bin/env python
import distutils.spawn
import os
import requests
import shutil
import subprocess
import sys
import tempfile
import urlparse
#include "platform.h"
#include <stdint.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <unistd.h>
#include <string.h>
#include <time.h>
#include <stdlib.h>
#include <stdio.h>
// RawInputTest.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
using std::vector;
const struct {
int usagePage;
int usage;
@luser
luser / servo-cross-mac
Created May 26, 2016 18:29
Cross-compile Servo from Linux to OS X
#!/bin/bash
#TODO: you will need to manually get an OS X SDK.
set -e
# Install the proper Rust nightly with rustup, and add the OSX target.
rustup install nightly-`cat rust-nightly-date`
rustup override add nightly-`cat rust-nightly-date`
rustup target install x86_64-apple-darwin
@luser
luser / Code.gs
Created December 11, 2024 20:29
Dinner menu Google Sheet/Calendar App Script
var WEDNESDAY = 3;
function startup() {
checkCalendarEvents();
};
function edit(e) {
var sheet = SpreadsheetApp.getActiveSheet();
var cells = sheet.getRange('A2:G2');
var c = e.range.getColumn();
@luser
luser / symbols.py
Last active September 9, 2023 04:54
GDB Mozilla symbol server
# Any copyright is dedicated to the Public Domain.
# http://creativecommons.org/publicdomain/zero/1.0/
#
# A GDB Python script to fetch debug symbols from the Mozilla symbol server.
#
# To use, run `source /path/to/symbols.py` in GDB 7.9 or newer, or
# put that in your ~/.gdbinit.
from __future__ import print_function
@luser
luser / output.txt
Created June 1, 2023 18:11
ldd audify
$ ldd ../node_modules/audify/build/Release/audify.node
linux-vdso.so.1 (0x00007ffc0a9de000)
libopus.so.0 => /build/audify/../node_modules/audify/build/Release/libopus.so.0 (0x00007f9795a81000)
librtaudio.so.6 => /build/audify/../node_modules/audify/build/Release/librtaudio.so.6 (0x00007f9795a5f000)
libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f9795811000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f979572a000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f979570a000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f97954e0000)
libasound.so.2 => /lib/x86_64-linux-gnu/libasound.so.2 (0x00007f97953dd000)
libpulse.so.0 => /lib/x86_64-linux-gnu/libpulse.so.0 (0x00007f9795388000)
@luser
luser / bloaty.txt
Created April 4, 2022 12:11
Bloaty functions
FILE SIZE
--------------
+31% +225Ki .text
+36% +148Ki [4603 Others]
[NEW] +9.58Ki url::host::Host::parse
[NEW] +9.21Ki fancy_regex::compile::compile_inner
[NEW] +9.00Ki flatbuffers::get_root::root
+45% +6.50Ki _$LT$$RF$T$u20$as$u20$core..fmt..Debug$GT$::fmt
+28e2% +5.38Ki shared_core::events::eventlist::EventList::push_fb_event
[NEW] +4.89Ki fancy_regex::parse::Parser::parse_branch