Last active
May 7, 2024 18:21
-
-
Save urklc/c9d04e1bbd84b8eedcba01ea06e41a93 to your computer and use it in GitHub Desktop.
bash helpers
This file contains 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
export PATH=/opt/homebrew/bin:$PATH | |
export PATH="~/.rbenv/shims:${PATH}" | |
export JAVA_HOME=$(/usr/libexec/java_home) | |
source $(brew --prefix nvm)/nvm.sh | |
alias python="python3" | |
# Load Git completion | |
zstyle ':completion:*:*:git:*' script ~/.zsh/git-completion.bash | |
fpath=(~/.zsh $fpath) | |
autoload -Uz compinit && compinit | |
# file management | |
uconvert () { | |
if [ "$1" != "v" ] ; then | |
convert +append *.png jklgerbe.png | |
return 0 | |
fi | |
convert -append *.png jklgerbe.png | |
} | |
uconvertj () { | |
if [ "$1" != "v" ] ; then | |
convert +append *.jpg jklgerbe.jpg | |
return 0 | |
fi | |
convert -append *.jpg jklgerbe.jpg | |
} | |
ucombine () { | |
montage -mode concatenate -tile 5x *.png jklgerbe.png | |
} | |
ujoin() { | |
ffmpeg -f concat -i input.txt -c copy $1.mp4 | |
} | |
ump4() { | |
ffmpeg -i $1.mkv -c copy ~/Downloads/$1.mp4 | |
} | |
ubitrate() { | |
ffmpeg -i "$1" -c:v libx264 -b:v 1500k "out_$1" | |
} | |
uresolution() { | |
ffmpeg -i "$1" -vf "scale=1920:1080" "out_$1" | |
} | |
uconcat() { | |
ffmpeg -f concat -safe 0 -i list.txt -c copy -c:a aac output.m4a | |
} | |
uoptimize() { | |
du -hs | |
jpegoptim --max=90 *.JPG | |
du -hs | |
} | |
usize() { | |
du -sh * | sort -h | |
} | |
ubesh() { | |
subl ~/.zshenv | |
} | |
ucreate() { | |
dd if=/dev/zero of=FileName7 bs=1024 count=1000000 | |
} | |
uyoutube() { | |
youtube-dl "$1" | |
} | |
# osx | |
uxcode() { | |
if [ -z $1 ]; then | |
path="/Applications/Xcode.app/" | |
else | |
path="/Applications/Xcode$1.app/" | |
fi | |
sudo xcode-select -switch $path | |
echo "new Xcode path: $path" | |
} | |
ufixssh () { | |
ssh-add --apple-use-keychain ~/.ssh/id_rsa | |
} | |
ufixcharles() { | |
networksetup -setwebproxystate "iPhone USB" off | |
networksetup -setsecurewebproxystate "iPhone USB" off | |
} | |
udecrypt() { | |
openssl aes-256-cbc -d -salt -pass pass:$1 -in file.zip.enc -out file.zip | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment