Skip to content

Instantly share code, notes, and snippets.

@iwakura
iwakura / mount_fwextfs
Last active March 18, 2020 11:19
mount ext3fs from firmware image
#!/bin/sh
fail() {
echo $1 1>&2
exit $2
}
[ $# -eq 2 ] || fail "Usage: `basename $0` fw.img /mount/point" 1
[ `which bgrep` ] || fail "Please install bgrep tool." 2
[ -r $1 ] || fail "Unable to locate image file: $1" 3
:020000000D2AC7
:10000600831285128030F300F20108307202031861
:100016001C2873083505F1007108003A031D1528E0
:1000260085101628851485168512F30CF313F20A2B
:04003600082808008E
:10003A00831203137008F100F0010830FC00710804
:10004A00F40C03182C28FC0B2528F10100340310AA
:10005A003128F40C0318F107F10CF00CFC0B2E28D4
:02006A0008008C
:0C006C0083122B088A002A08820008007A
@iwakura
iwakura / fake_zone_generator.rb
Created July 2, 2014 14:38
blocking ads using unbound
#!/usr/bin/env ruby
# script generates fake zones to plug into unbound in order to block some ads sites.
require 'open-uri'
class FakeZoneGenerator
LIST_URL = 'http://pgl.yoyo.org/adservers/serverlist.php?hostformat=nohtml&showintro=0'
IPV4_ADDR = '127.0.0.1'