.bash_aliases
· 1.6 KiB · Bash
Raw
alias install_no="sudo pacman -Sy"
alias install_ya="yay -S --noconfirm"
alias backupvps="rsync -avhzr --delete --progress --rsh='ssh -p22' user@ip:/ --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found","/swapfile","/boot/*"} /to/dir/"
# Compress a video with CUDA acceleration (GPU from NVIDIA is required)
function reducevideo {
ffmpeg -hwaccel cuda -i "$1" -c:v libx265 -vtag hvc1 -c:a copy "$2"
}
alias reducevideo="reducevideo"
# Download videos from YouTube in full HD. Creates an JSON file with all the information about the video, includes the chapters, and more.
function ytdl {
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"
}
alias ytdl="ytdl"
# Download a video from YouTube and convert it to a MP3 file. Embed the cover to the file.
function ytdla {
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"
}
alias ytdla="ytdla"
# Compress an image by reducing size and quality and remove all metadata. Inspired from Telegram.
function reduceimage {
convert -resize 2000x2000 -quality 70 "$1".jpg "$1"-r.webp
exiftool -overwrite_original -all= "$1"-r.webp
}
alias reduceimage="reduceimage"
1 | alias install_no="sudo pacman -Sy" |
2 | alias install_ya="yay -S --noconfirm" |
3 | alias 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) |
7 | function reducevideo { |
8 | ffmpeg -hwaccel cuda -i "$1" -c:v libx265 -vtag hvc1 -c:a copy "$2" |
9 | } |
10 | |
11 | alias 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. |
15 | function 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 | |
19 | alias ytdl="ytdl" |
20 | |
21 | |
22 | # Download a video from YouTube and convert it to a MP3 file. Embed the cover to the file. |
23 | function 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 | |
27 | alias ytdla="ytdla" |
28 | |
29 | |
30 | # Compress an image by reducing size and quality and remove all metadata. Inspired from Telegram. |
31 | function reduceimage { |
32 | convert -resize 2000x2000 -quality 70 "$1".jpg "$1"-r.webp |
33 | exiftool -overwrite_original -all= "$1"-r.webp |
34 | } |
35 | |
36 | alias reduceimage="reduceimage" |