Last active
February 4, 2025 18:31
-
-
Save lostvikx/31b536b537f50e259dc104d7ebcf6d1f to your computer and use it in GitHub Desktop.
Personal list of bash aliases.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Some useful bash aliases used by Vikram Negi | |
# navigation | |
alias ..="cd .." | |
# copy to clipboard (pipe sysin) | |
alias copy="xclip -selection clipboard" | |
# python | |
alias venv-init="python -m venv venv" | |
alias requirements-pip="pip freeze | sed -r 's/(\w+?)[==><]+.+/\1/' > requirements.txt" | |
# git | |
alias addup="git add ." | |
alias status="git status" | |
alias commit="git commit -m" | |
alias git-log="git log --oneline" | |
# disk info | |
alias disk-info="df -h" | |
# kill node process | |
alias kill-node="killall -9 node" | |
# cool stuff | |
alias vtop="vtop --theme wizard" | |
alias weather-report="curl -s https://wttr.in/" | |
# alias nsdr-script="mpv https://www.youtube.com/watch?v=AKGrmY8OSHM --no-video" | |
# alias nsdr-script="mpv Music/nsdr.opus" | |
alias mpv-yt="mpv --profile=1080p --fs" | |
alias battery-status="upower -i /org/freedesktop/UPower/devices/battery_BAT0" | |
alias yt-download="yt-dlp --config-locations ~/.config/yt-dlp/yt-dlp-config.conf" | |
# alias download-music="yt-dlp -f bestaudio --extract-audio --audio-format vorbis -o '%(title)s.%(ext)s'" | |
alias yt-music-download="yt-dlp --config-locations ~/.config/yt-dlp/music-config.conf" | |
alias download-music-playlist="yt-dlp --config-locations ~/.config/yt-dlp/music-config.conf https://music.youtube.com/playlist?list=PLbbnlAagn5E3kubW1IFJwK70Zk0u3j0A2" | |
# ffmpeg | |
# alias img2vid="ffmpeg -loop 1 -i $1 -c:v libx264 -t $2 -pix_fmt yuv420p -vf scale=640:480 out.mp4" | |
compress_mkv_files() { | |
mkdir -p Compressed | |
for file in *.mkv; do | |
# ffmpeg -i "$file" -c:v libx264 -crf 28 -c:a copy -c:s copy "Compressed/${file}" | |
ffmpeg -i "$file" -c:v libx264 -threads 4 -crf 23 -c:a aac -b:a 128k -c:s copy "Compressed/${file}" | |
done | |
} | |
# pandoc | |
alias build-resume='pandoc -s -V geometry:"top=1cm, bottom=1cm, left=2cm, right=2cm" -V fontsize=12pt -V linestretch=0.85 -V linkcolor=blue -V header-includes="\usepackage{nopageno}" -o resume.pdf resume.md' | |
# darken images | |
darken_img() { | |
file_name="${1%.*}" | |
file_ext="${1##*.}" | |
out_file="${file_name}-dark.${file_ext}" | |
# Second arg is optional (default=40) | |
convert "${1}" -fill black -colorize ${2:-40} "${out_file}" | |
} | |
# Rename all files in a directory to random. | |
alias random_rename='for file in *; do mv "$file" "$(sha256sum <<< "$file" | awk '\''{print substr($1,1,16)}'\'').${file##*.}"; done' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment