Skip to content

Instantly share code, notes, and snippets.

@meeuw
meeuw / parse_pbzx.py
Last active July 6, 2017 10:25 — forked from pudquick/parse_pbzx.py
Pure python reimplementation of .cpio.xz content extraction from pbzx file payload for OS X packages.without any third party tools
#!/usr/bin/python
# tar -Oxf /Volumes/install_app/Packages/Essentials.pkg Payload|python pbzx.py|tar t
import subprocess
import struct
import sys
def pbzx():
if sys.stdin.read(4) != "pbzx":
print "Not a pbzx stream"
@meeuw
meeuw / dnsmasq.sh
Created November 28, 2013 19:48 — forked from anonymous/dnsmasq.sh
Hookscript for dhclient (place in /etc/dhcp/dhclient.d) to configure dnsmasq (using dbus) with the supplied nameserver. Add enable-dbus to dnsmasq
#!/bin/bash
function inet_aton () {
local count=3
local int=0
for num in $(echo $1 | sed -e 's/\./ /g'); do
let "int+=$num*256**$count"
let "count-=1"
done
echo $int
}