Skip to content

Instantly share code, notes, and snippets.

@bnagy
bnagy / ntstatus.rb
Created June 13, 2013 13:08
ntstatus
NTSTATUS_ERRORS = {
'STATUS_SUCCESS' => "0x00000000",
'STATUS_SEVERITY_SUCCESS' => "0x00000000",
'STATUS_SEVERITY_INFORMATIONAL' => "0x00000001",
'STATUS_SEVERITY_WARNING' => "0x00000002",
'STATUS_SEVERITY_ERROR' => "0x00000003",
'STATUS_WAIT_0' => "0x00000000",
'STATUS_WAIT_1' => "0x00000001",
'STATUS_WAIT_2' => "0x00000002",
'STATUS_WAIT_3' => "0x00000003",
ARGF.each_line {|line|
begin
warn "Starting work on #{line.chomp}"
# expect a line like this:
# s3://commoncrawl-crawl-002/2010/09/24/9/1285380159663_9.arc.gz
proto,unused,bucket_name,*rest=line.chomp.split File::SEPARATOR
raise ArgumentError, "#{__FILE__}: Unknown S3 Protocol #{proto}" unless proto=~/^s3/
object_name=File.join rest
size=Integer( s3.buckets[bucket_name].objects[object_name].content_length )
warn "Reading from #{bucket_name.inspect}, #{object_name.inspect}, size #{size}"
class ArcFile
include Enumerable
def initialize( input_stream )
@handle=input_stream
end
def each
return self.to_enum unless block_given?
#! /usr/bin/env ruby
# Pollenate ONE sync dir from each target into all other
# targets fuzzing the same format. Assumes that work
# dirs are named as by github.com/bnagy/afl-launch.
#
# Each target syncs inside its own directory already
# so copying any of the sync dirs works. It is possible
# that you'll miss some stuff, but it saves N * N-1 sync
#
@bnagy
bnagy / searchers.rb
Created August 13, 2012 05:23
trying to make a threadsafe capybara poltergeist searcher
require 'capybara'
require 'capybara/dsl'
require 'capybara/poltergeist'
Capybara.configure do |config|
config.run_server = false
config.default_driver = :poltergeist
end
module Searchers
@bnagy
bnagy / afl-llvm-rt.o.c
Last active June 13, 2018 21:54
AFL SHM with guard pages
/*
american fuzzy lop - LLVM instrumentation bootstrap
---------------------------------------------------
Written by Laszlo Szekeres <lszekeres@google.com> and
Michal Zalewski <lcamtuf@google.com>
LLVM integration design comes from Laszlo Szekeres.
Copyright 2015 Google Inc. All rights reserved.
@bnagy
bnagy / scansion.ipynb
Created June 26, 2018 04:33
Teaching a computer to teach me how to scan latin poetry
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/bin/sh
#
# american fuzzy lop - pause a set of fuzzers
# --------------------------------------
#
# By @rantyben, based on afl-whatsup, which is:
# Written and maintained by Michal Zalewski <lcamtuf@google.com>
#
# Copyright 2015 Google Inc. All rights reserved.
#
@bnagy
bnagy / gpgmutt.md
Last active March 30, 2024 07:52
Mutt, Gmail and GPG

GPG / Mutt / Gmail

About

This is a collection of snippets, not a comprehensive guide. I suggest you start with Operational PGP.

Here is an incomplete list of things that are different from other approaches:

  • I don't use keyservers. Ever.
  • Yes, I use Gmail instead of some bespoke hipster freedom service