← 🦋
linux spellbook
the terminal feels like a alchemical mixing table. random cuncoctions of letters make the computer do cool and wacky things.
moving to linux
Create a bootable usb stick from an .iso image.
First find and confirm the name of your usb drive. Usually somthing like
devsda.
sudo fdisk -l
Use the dd command to flash the image to the disk.
sudo dd bs=4M if=/path/to/file.iso of=/path/to/usb status=progress oflag=sync
yt-dlp
A tool for dowloading DRMed media from the web.
Download a youtube playlist as mp3s in the format
artist - trackindex - trackname.mp3.
yt-dlp -t mp3 --embed-thumbnail --add-metadata --metadata-from-title "%(title)s" --parse-metadata "title:%(title)s" --parse-metadata "uploader:%(artist)s" --output "%(artist)s - %(playlist_index)s - %(title)s.%(ext)s" YOURYOUTUBEPLAYLISTLINKHERE
dowload a youtube video as an mp3 file
t-dlp -t mp3 https://www.youtube.com/watch?v=70byQuA58fg
Converting media
Convert video from .mkv to .mp4 with ffmpeg
ffmpeg -i my_video.mkv -c:v copy output.mp4
Convert pdf to image. My printer won't print pdfs.
pdftoppm -png pdf_filename image_name
merge multiple pdfs into one pdf
pdfunite 1.pdf 2.pdf n.pdf out.pdf
# beware, the last file is always the output file.
Convert wav to mp3
ffmpeg -i input.wav -acodec libmp3lame output.mp3
Batch covert images to png
for file in *.webp; do ffmpeg -i "$file" "${file%.webp}.png"; done
File managment
Print the size of a folder
du -sh /path/to/folder/