Last active a month ago

These are my number one bash scripts. I can't live without them.

Revision c419bb7

.bash_aliases Raw
1alias install_no="sudo pacman -Sy"
2alias install_ya="yay -S --noconfirm"
3alias backupvps="rsync -avhzr --delete --progress --rsh='ssh -p22' user@ip:/ --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found","/swapfile","/boot/*"} /to/dir/"
4
5
6# Compress a video with CUDA acceleration (GPU from NVIDIA is required)
7function reducevideo {
8 ffmpeg -hwaccel cuda -i "$1" -c:v libx265 -vtag hvc1 -c:a copy "$2"
9}
10
11alias reducevideo="reducevideo"
12
13
14# Download videos from YouTube in full HD. Creates an JSON file with all the information about the video, includes the chapters, and more.
15function ytdl {
16 yt-dlp --check-formats --progress -f "bv*[height<1080][ext=mp4]+ba" --write-info-json --embed-metadata --convert-thumbnail jpg --embed-thumbnail --embed-chapters --embed-info-json --sponsorblock-mark all -o "/mnt/Storage/YouTube/videos/%(channel)s/%(upload_date>%Y-%m-%d)s - %(title)s.%(ext)s" "$1"
17}
18
19alias ytdl="ytdl"
20
21
22# Download a video from YouTube and convert it to a MP3 file. Embed the cover to the file.
23function ytdla {
24 yt-dlp --no-call-home --no-part --add-metadata --embed-thumbnail --audio-format "mp3" --extract-audio --format bestaudio/best -x -w -o "/mnt/Storage/YouTube/audio/%(uploader)s/%(upload_date>%Y-%m-%d)s - %(title)s (%(id)s).%(ext)s" "$1"
25}
26
27alias ytdla="ytdla"
28
29
30# Compress an image by reducing size and quality and remove all metadata. Inspired from Telegram.
31function reduceimage {
32 convert -resize 2000x2000 -quality 70 "$1".jpg "$1"-r.webp
33 exiftool -overwrite_original -all= "$1"-r.webp
34}
35
36alias reduceimage="reduceimage"