Stannum

FreeBSD cheatsheet

2019-09-29 Permalink

Generate a secure password:

$ head -c 30 /dev/random | uuencode -mr -

Recover partitions (including exfat):

$ testdisk /dev/disk-or-section

Create then extract an encrypted backup (split into chunks):

$ tar -cf - input/ | openssl aes-256-cbc -md sha256 -pbkdf2 | split -b 100M -a 4 -d - output/backup.tar.
$ cat output/backup.tar.* | openssl aes-256-cbc -md sha256 -pbkdf2 -d | tar -xfv -

Set time in current timezone:

# date 2315

Packages

Display the post-install message:

$ pkg query %M firefox

List non-automatic packages:

$ pkg query -e '%a = 0' %o

Audio

Get list of installed devices:

$ cat /dev/sndstat

Set default device:

$ sysctl hw.snd.default_unit=2

Share on