Skip to content

Instantly share code, notes, and snippets.

View almirbraggio's full-sized avatar

Almir A. Braggio almirbraggio

View GitHub Profile
@almirbraggio
almirbraggio / auto-mounting.md
Created December 9, 2023 16:58
Fstab Auto-Mounting Partition

Using a fstab file we can mounting and linking an extra partition in an elegant way. To adding the partition on fstab file, you need to find the correct UUID from the partition you want to add.

List the by-uuid file for finding out:

$ ls -lh /dev/disk/by-uuid
lrwxrwxrwx 1 root root 842db29e-56d8-4ccf-b857-44e039bb065f -> ../../sda1
lrwxrwxrwx 1 root root f57a0952-0a96-4140-8aa1-b2df924e3389 -> ../../sdb1
@almirbraggio
almirbraggio / file-to-mp3.md
Last active December 9, 2023 16:48
wma, flac or m4a to mp3
$ sudo apt-get install lame flac libav-tools
$ for f in *.wav; do lame -V0 -h -b 160 --vbr-new "$f" "${f%.*}".mp3; done
$ for f in *.flac; do flac -cd "$f" | lame -b 320 - "${f%.*}".mp3; done
$ for f in *.m4a; do avconv -i "$f" "${f%.*}".mp3; done
@almirbraggio
almirbraggio / cli-pass-gen.md
Last active December 9, 2023 16:53
Terminal Password Generation
$ sudo apt install apg
$ apg -n 1 -s
$ apg -n 1 -a 1 -m 12 -x 20 -s
$ sudo apt-get install pwgen
$ pwgen
@almirbraggio
almirbraggio / split-join.md
Last active December 9, 2023 14:27
Split & Join Files

We have a bigger iso file to compress to tar.gz and split it into 120 MB per parts:

$ tar -czvf file.tar.gz file.iso
$ split -b 120m file.tar.gz file.tar.gz.part-
$ ls
file.tar.gz.part-aa
file.tar.gz.part-ab
file.tar.gz.part-ac