hdiutil attach /Applications/Install\ macOS\ Sierra\ Public\ Beta.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app
hdiutil create -o /tmp/Sierra.cdr -size 7316m -layout SPUD -fs HFS+J
hdiutil attach /tmp/Sierra.cdr.dmg -noverify -nobrowse -mountpoint /Volumes/install_build
asr restore -source /Volumes/install_app/BaseSystem.dmg -target /Volumes/install_build -noprompt -noverify -erase
rm /Volumes/OS\ X\ Base\ System/System/Installation/Packages
cp -rp /Volumes/install_app/Packages /Volumes/OS\ X\ Base\ System/System/Installation/
cp -rp /Volumes/install_app/BaseSystem.chunklist /Volumes/OS\ X\ Base\ System/BaseSystem.chunklist
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
re.findall(r'((?:[0-9a-f-A-F.:]+)(?:[.:]+)(?:[0-9a-f-A-F.:]+))', 'f 2001:0db8:85a3:0000:0000:8a2e:0370:7334 1.1.1.1 ::1 234.34.55.3 fed') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://superuser.com/questions/792427/creating-a-large-file-of-random-bytes-quickly | |
Slight modification to watch progress | |
dd if=<(openssl enc -aes-256-ctr -pass pass:"$(dd if=/dev/urandom bs=128 count=1 2>/dev/null | base64)" -nosalt < /dev/zero) \ | |
bs=1M count=7000 iflag=fullblock \ | |
| pv -pterb > random-7G.txt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://apple.stackexchange.com/a/70189 | |
sudo port install bash | |
Add /opt/local/bin/bash to /etc/shells | |
chsh -s /opt/local/bin/bash | |
Open a new tab and check echo $BASH_VERSION |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Bash for macOS and Linux | |
LC_CTYPE=C tr -cd '[:alnum:]' < /dev/urandom | fold -w30 | head -n1 | |
# Python | |
import binascii, os | |
length=10 | |
binascii.b2a_hex(os.urandom(length)).decode('utf-8')[0:length] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Determine which OS we are in | |
# | |
platform='unknown' | |
unamestr=$(uname) | |
case $unamestr in | |
Darwin) | |
platform='mac' | |
;; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Done on Debian Stretch | |
# Configure local user as 'pi' | |
# Source for build process: https://github.com/RPi-Distro/pi-gen/blob/master/README.md | |
# Install sudo | |
# /etc/sudoers.d/010-pi | |
pi ALL=(ALL) ALL | |
# Dependencies |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fn + P |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Include files that have been symlinked | |
tar -czf backup.tar.gz --dereference ./backup | |
gpg --armor --output backup.tar.gz.gpg --symmetric --cipher-algo AES256 backup.tar.gz | |
# Decrypt for a bunch of files | |
read -s -p "Enter Password: " pw | |
echo -ne "\033[0K\r" | |
echo "$pw" | gpg --batch --passphrase-fd 0 --output backup.tar.gz --decrypt backup.tar.gz.gpg |