Skip to content

Instantly share code, notes, and snippets.

View yunzheng's full-sized avatar

Yun Zheng Hu yunzheng

View GitHub Profile
@yunzheng
yunzheng / eicfg_remover.py
Created November 13, 2011 17:01
ei.cfg removal/restore util in Python
#!/usr/bin/env python
"""
eicfg_remover.py
Based on Kai Liu's eicfg_remover.c @ http://code.kliu.org/misc/winisoutils/
"""
import sys
from binascii import crc_hqx, hexlify
@yunzheng
yunzheng / indexer.py
Created November 23, 2011 19:27
File indexer
import os
import os.path
import csv
import stat
import pwd
import grp
import sys
import datetime
ospathjoin = os.path.join
@yunzheng
yunzheng / fix_time.reg
Created November 24, 2011 22:02
RealTimeIsUniversal cmd for dual boot Mac OS X and Windows
reg add HKLM\SYSTEM\CurrentControlSet\Control\TimeZoneInformation /v RealTimeIsUniversal /t REG_DWORD /d 1
@yunzheng
yunzheng / gist:2262423
Created March 31, 2012 11:25
brew install -v --HEAD ledger
$ brew install -v --HEAD ledger
==> Installing ledger
==> Cloning https://github.com/jwiegley/ledger.git
Updating /Library/Caches/Homebrew/ledger--git
git remote set-url origin https://github.com/jwiegley/ledger.git
git fetch origin
==> Checking out branch next
git checkout origin/next
HEAD is now at 1809e63... Added a test harness error diagnostic
git checkout-index -a -f --prefix=/private/tmp/homebrew-ledger-HEAD-E6YH/
@yunzheng
yunzheng / gist:2262437
Created March 31, 2012 11:26
ledger --HEAD config.log errors
## ----------- ##
## Core tests. ##
## ----------- ##
configure:2735: checking for a BSD-compatible install
configure:2803: result: /usr/bin/install -c
configure:2814: checking whether build environment is sane
configure:2864: result: yes
configure:3005: checking for a thread-safe mkdir -p
configure:3044: result: ./install-sh -c -d
@yunzheng
yunzheng / ElCapitan.mtree
Created October 7, 2015 08:04
OS X El Capitan mtree spec
# created with:
# mtree -c -p "/Applications/Install OS X El Capitan.app" -k type,mode,flags,md5digest,sha1digest
#
# check with:
# mtree -f /tmp/ElCapitan.mtree -p "/Applications/Install OS X El Capitan.app"
#
# user: yun
# tree: /Applications/Install OS X El Capitan.app
# date: Wed Oct 7 09:54:00 2015
@yunzheng
yunzheng / ElCapitan.10.11.4.mtree
Created May 1, 2016 16:24
OS X El Capitan 10.11.4 mtree spec
# created with:
# mtree -c -p "/Applications/Install OS X El Capitan.app" -k type,mode,flags,md5digest,sha1digest,ripemd160digest
#
# check with:
# mtree -f /tmp/ElCapitan.mtree -p "/Applications/Install OS X El Capitan.app"
#
# user: yun
# tree: /Applications/Install OS X El Capitan.app
# date: Sun May 1 18:18:28 2016
@yunzheng
yunzheng / ElCapitan.10.11.5.mtree
Created May 17, 2016 09:42
OS X El Capitan 10.11.5 mtree spec Raw
# created with:
# mtree -c -p "/Applications/Install OS X El Capitan.app" -k type,mode,flags,md5digest,sha1digest,ripemd160digest
#
# check with:
# mtree -f /tmp/ElCapitan.mtree -p "/Applications/Install OS X El Capitan.app"
#
# user: yun
# tree: /Applications/Install OS X El Capitan.app
# date: Tue May 17 11:38:50 2016
@yunzheng
yunzheng / macOS_10.14_mojave.md
Last active April 22, 2020 21:17
macOS Mojave Installer Files

macOS 10.14 Mojave

URLS

http://swcdn.apple.com/content/downloads/49/44/041-08708/vtip954dc6zbkpdv16iw18jmilcqdt8uot/InstallAssistantAuto.smd
http://swcdn.apple.com/content/downloads/49/44/041-08708/vtip954dc6zbkpdv16iw18jmilcqdt8uot/OSInstall.mpkg
http://swcdn.apple.com/content/downloads/49/44/041-08708/vtip954dc6zbkpdv16iw18jmilcqdt8uot/InstallInfo.plist
http://swcdn.apple.com/content/downloads/49/44/041-08708/vtip954dc6zbkpdv16iw18jmilcqdt8uot/InstallESDDmg.chunklist
http://swcdn.apple.com/content/downloads/49/44/041-08708/vtip954dc6zbkpdv16iw18jmilcqdt8uot/MajorOSInfo.pkg
https://swdist.apple.com/content/downloads/49/44/041-08708/vtip954dc6zbkpdv16iw18jmilcqdt8uot/MajorOSInfo.pkm
@yunzheng
yunzheng / records2sqlite.py
Created June 9, 2023 08:42
Convert flow records to sqlite3 database
# !/usr/bin/env python3
#
# Convert flow records to sqlite3 database
#
# Author: Yun Zheng Hu <[email protected]>
import argparse
import logging
import sqlite3
import sys