This file contains 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
# s is the offset provided in the BQ load error | |
# filename.ext is your file's name | |
python -c "s=12345; f=open('filename.ext'); f.seek(s); print(f.readline())" |
This file contains 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
# Logging | |
OFF=0 | |
FATAL=100 | |
ERROR=200 | |
WARN=300 | |
INFO=400 | |
DEBUG=500 | |
TRACE=600 | |
ALL=1000000 |
This file contains 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
if command -v echo >/dev/null; then echo "exists"; else echo "doesn't exist"; fi |
This file contains 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 |
This file contains 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 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 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 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 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 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 |
NewerOlder