Skip to content

Instantly share code, notes, and snippets.

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')
@arobb
arobb / sierra-virtualbox-install.md
Last active November 24, 2020 13:15
Install macOS Sierra in VirtualBox on macOS host

Step 1 (Creating a bootable macOS Sierra ISO for VirtualBox):

  1. hdiutil attach /Applications/Install\ macOS\ Sierra\ Public\ Beta.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app
  2. hdiutil create -o /tmp/Sierra.cdr -size 7316m -layout SPUD -fs HFS+J
  3. hdiutil attach /tmp/Sierra.cdr.dmg -noverify -nobrowse -mountpoint /Volumes/install_build
  4. asr restore -source /Volumes/install_app/BaseSystem.dmg -target /Volumes/install_build -noprompt -noverify -erase
  5. rm /Volumes/OS\ X\ Base\ System/System/Installation/Packages
  6. cp -rp /Volumes/install_app/Packages /Volumes/OS\ X\ Base\ System/System/Installation/
  7. cp -rp /Volumes/install_app/BaseSystem.chunklist /Volumes/OS\ X\ Base\ System/BaseSystem.chunklist
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
@arobb
arobb / rpi-temp.sh
Created October 2, 2016 00:55
Temperature from Raspberry Pi
#!/usr/bin/env bash
vcgencmd measure_temp | sed -n 's/temp=\([0-9.]*\).*$/\1/p' | bc <<< "9 / 5 * `cat` + 32"
@arobb
arobb / rpi-config.txt
Last active October 13, 2021 16:01
Raspberry Pi initial configuration
# IP and new hostname of PI
PI_IP=""
PI_NEW_HOSTNAME=""
# Set ssh keys, use default password
cat ~/.ssh/id_rsa.pub | ssh pi@"$PI_IP" 'cat >> .ssh/authorized_keys'
# Connect to the pi
ssh pi@"$PI_IP"
@arobb
arobb / openvpn-server.ovpn
Last active September 4, 2016 04:39
OpenVPN Server Config
# OpenVPN Configuration
# Multiple files will start independent daemons
# Basic options
## Logging
log-append /var/log/openvpn.log
verb 3
## Listen port
dev tun
apt-get install bc
git clone https://github.com/openssl/openssl.git
git checkout OpenSSL_1_0_2-stable
./config enable-egd zlib threads no-ssl2 no-ssl3 no-weak-ssl-ciphers
make depend
make
make test
#!/bin/bash
# Decrypt GPG files in current directory
# Files created with gpg --armor --output <out enc file> --symmetric --cipher-algo AES256 <in clear file>
read -s -p "Enter Password: " pw
echo -ne "\033[0K\r"
for infile in *.gpg;
do
outfile=${infile%.gpg}
Encrypt: gpg --armor --output <out enc file> --symmetric --cipher-algo AES256 <in clear file>
Decrypt: gpg --output <out clear file> --decrypt <in clear file>
# ip utility (OS X)
git clone git@github.com:brona/iproute2mac.git
sudo cp iproute2mac/src/ip.py /usr/local/bin/ip
sudo chown root:wheel /usr/local/bin/ip
# LZO headers (OS X)
http://www.oberhumer.com/opensource/lzo/#download
~/Download/lzo-2.09/src
./configure
make