Skip to content

Instantly share code, notes, and snippets.

@indygreg
indygreg / README.rst
Last active April 26, 2024 20:17
Firefox source repository metrics
@indygreg
indygreg / find_old_lines.pl
Created June 17, 2012 20:17
Find oldest lines in git repository
#!/usr/bin/perl
# This script parses Git blame's "porcelain" output format and
# ascertains the oldest lines of code seen.
#
# If you want to perform a custom report, just define your own callback
# function and invoke parse_porcelain() with it.
#
# The expected input format is slightly modified from raw `git blame
# -p`. Here is an example script for producing input:
@indygreg
indygreg / zeromq_blocking_receive_bug.cpp
Created November 28, 2010 02:47
ZeroMQ Blocking recv() Bug Reproduce
// 0MQ "data ready" + recv() block bug by Gregory Szorc <gregory.szorc@gmail.com>
//
// This file produces a bug where a 0MQ socket says it has a message
// available but the call to recv() blocks. This should not happen.
//
// Reproduce conditions:
//
// Definitely on Linux. Not on Windows
//
// For me, this reproduces on x86_64 Linux most of the time, but not always.
@indygreg
indygreg / Apple Bug Report
Last active November 9, 2022 15:53
Slow readdir() or lstat() behavior for parallel directory walks
(This is the content of https://bugreport.apple.com/web/?problemID=45648013.)
Area:
Something not on this list
Summary: Calling readdir() from multiple threads apparently acquires a global kernel lock, making directory traversal operations from multiple processes extremely slow as the number of parallel I/O operations increases.
Steps to Reproduce:
@indygreg
indygreg / Dockerfile
Created May 19, 2013 18:37
Dockerfile for Firefox development
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# Create a build and development environment for Firefox.
FROM ubuntu:12.10
MAINTAINER Gregory Szorc "gps@mozilla.com"
RUN apt-get update
@indygreg
indygreg / import_stdlib.py
Created December 28, 2018 18:00
Python stdlib importing
import __future__
import _bootlocale
import _collections_abc
import _compat_pickle
import _compression
import _dummy_thread
import _markupbase
import _osx_support
import _py_abc
import _pydecimal
@indygreg
indygreg / pyalloc.rs
Last active December 27, 2018 21:34
Rust allocator for Python
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
use libc::{c_void, size_t};
use std::alloc;
use std::collections::HashMap;
use std::ptr::null_mut;
const MIN_ALIGN: usize = 16;
def reposetup(ui, repo):
class extrarepo(repo.__class__):
def commit(self, self, text="", user=None, date=None, match=None, force=False,
editor=False, extra=None):
extra = extra or {}
# modify extra
return super(extrarepo, self).commit(text=text, user=user, ...)
repo.__class__ = extrarepo
@indygreg
indygreg / kern.bad
Last active August 3, 2016 22:17
kernel parameters
abi.vsyscall32 = 1
debug.exception-trace = 1
debug.kprobes-optimization = 1
dev.cdrom.autoclose = 1
dev.cdrom.autoeject = 0
dev.cdrom.check_media = 0
dev.cdrom.debug = 0
dev.cdrom.info = CD-ROM information, Id: cdrom.c 3.20 2003/12/17
dev.cdrom.info =
dev.cdrom.info = drive name:
@indygreg
indygreg / pending.py
Created May 19, 2016 19:47
Analyze Automation
import collections
import datetime
import operator
import requests
r = requests.get('http://builddata.pub.build.mozilla.org/builddata/buildjson/builds-pending.js')
pending = r.json()['pending']
by_tree = collections.Counter()