Last active
May 31, 2022 07:47
-
-
Save mmaia/23a4e25706ae5483ead6abde5a9ddec1 to your computer and use it in GitHub Desktop.
my generic zsh custom file
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
#!/bin/zsh | |
echo "--------------- Loading mmaia.zsh functions----------------" | |
function idea() { | |
find ~/.local/share/JetBrains/Toolbox/apps/IDEA-U -name "idea.sh" -exec chmod +x {} \; -exec {} $1 \; >/dev/null 2>&1 & | |
} | |
function reload() { | |
source ~/.zshrc | |
} | |
function open() { | |
echo "opening in chrome" $1 | |
google-chrome $1 >/dev/null 2>&1 & | |
} | |
function books() { | |
open https://read.amazon.com | |
} | |
function kmanager() { | |
open http://localhost:9000 | |
} | |
function postman() { | |
echo "starting postman" | |
~/tools/Postman/Postman >/dev/null 2>&1 & | |
} | |
function hawtio() { | |
echo "starting hawtio" && \ | |
java -jar ~/tools/hawtio-1.5.5/hawtio-app-1.5.5.jar --port 8090 >/dev/null 2>&1 & | |
} | |
function jmc() { | |
echo "starting java mission control" | |
/usr/lib/jvm/jdk1.8.0_91/bin/jmc >/dev/null 2>&1 & | |
} | |
function ionic-dev() { | |
echo "starting ionic engine, please make sure you phone is plugged in" | |
nohup terminator -T ionic --working-directory=/home/mmaia/git/nutrilife/nutrilife-mobile --command="ionic run android -lc" & | |
} | |
function nutriboard() { | |
open https://github.com/mmaia/nutri-java/issues | |
} | |
function nutrimobboard() { | |
open https://gitlab.com/marcosmaia/nutri-weight-mobile/issues | |
} | |
function blog() { | |
open http://codespair.com | |
} | |
function edit() { | |
code ~/.oh-my-zsh/custom/mmaia.zsh | |
} | |
function gch() { | |
google-chrome http://$1 & | |
} | |
function ff() { | |
firefox http://$1 > /dev/null 2>&1 & | |
} | |
function ghub() { | |
google-chrome https://github.com/mmaia & | |
} | |
function spotify() { | |
google-chrome https://play.spotify.com/browse & | |
} | |
function gmail() { | |
google-chrome https://gmail.google.com & | |
} | |
function calendar() { | |
google-chrome https://calendar.google.com & | |
} | |
function keep() { | |
google-chrome https://keep.google.com & | |
} | |
function translate() { | |
google-chrome https://translate.google.com & | |
} | |
function nutri-deploy() { | |
cd '~/git/nutrilife-platform/nutri-gateway/src/main/ansible' | |
} | |
function workspaces() { | |
alias |grep "ws-" | |
} | |
function checkPort() { | |
lsof -i tcp:$1 | awk 'NR!=1 {print $2}' | |
} | |
function softKillProcessUsingPort() { | |
kill -14 $(lsof -t -i:$1 -sTCP:LISTEN) | |
} | |
function killProcessUsingPort() { | |
kill -9 $(lsof -t -i:$1 -sTCP:LISTEN) | |
} | |
function dcfud() { | |
echo 'issuing command docker compose up -d on compose file: $1' | |
docker compose -f $1 up -d | |
} | |
function freeIconsAndImages() { | |
open https://freeillustrations.xyz/ && \ | |
open https://iconduck.com/ && \ | |
open https://commons.wikimedia.org/wiki/Main_Page && \ | |
open https://unsplash.com/ | |
} | |
alias portainer='open http://localhost:9010' | |
alias netflix='ff www.netflix.com/browse' | |
alias ws-nutri="cd ~/git/nutrilife" | |
alias ws-nutri-mob="cd ~/git/nutrilife-platform/nutri-mobile" | |
alias ws-nutri-weight-mobile="cd ~/git/nutrilife-platform/nutri-mobile" | |
alias ws-kafel-root="cd ~/git/kafel" | |
alias nutri-board="open https://gitlab.com/marcosmaia/nutrilife/boards" | |
alias nutri-mr="open https://gitlab.com/marcosmaia/nutrilife/merge_requests" | |
alias nutri-pipelines="open https://gitlab.com/marcosmaia/nutrilife/pipelines" | |
alias nutri-milestones="open https://gitlab.com/marcosmaia/nutrilife/milestones" | |
alias nutri-issues="open https://gitlab.com/marcosmaia/nutrilife/issues" | |
alias nutri-img="nautilus ~/git/nutrilife/src/main/webapp/content/images" | |
alias gitlab="open https://gilab.com" | |
alias kafel-issues="open https://gitlab.com/marcosmaia/kafel/issues" | |
alias kafel-pipelines="open https://gitlab.com/marcosmaia/kafel/pipelines" | |
alias kafel-boards="open https://gitlab.com/marcosmaia/kafel/boards" | |
alias kafel-milestones="open https://gitlab.com/marcosmaia/kafel/milestones" | |
alias kafel-master="open https://gitlab.com/marcosmaia/kafel/tree/master" | |
alias kafel-merge="open https://gitlab.com/marcosmaia/kafel/merge_requests" | |
alias home="cd ~" | |
alias nutri-server="ssh -i ~/.ssh/githubkey [email protected]" | |
alias mvna="mvncist -T 1C" | |
alias dc="docker compose" | |
alias dcu="docker compose up" | |
alias dcs="docker compose stop" | |
alias dcb="docker compose build" | |
alias dcd="docker compose down" # stop and delete containers | |
alias dcdv="docker compose down --volumes" # careful, deletes also mapped container volumes | |
alias dclf="docker compose logs -f" #tail the logs | |
alias dps="docker ps" | |
alias dpsa="docker ps -a" | |
alias di="docker images" | |
alias drm="docker rm" | |
alias drmi="docker rmi" | |
alias drmall="docker system prune -f" | |
alias android_samples="open https://github.com/android?q=\&type=\&language=kotlin" | |
alias android-free-courses-1="open https://pl-coding.com/courses/" | |
# linux file system useful commands | |
function linuxTips() { | |
echo " | |
replace multiple file names by pattern: for file in * ; do mv \$file \${file//\$toBeReplaced/\$replacement/} ; done | |
replace words by pattern in multiple files: sed -i 's/foo/bar/g' * | |
" | |
} | |
# nutrilife useful sites | |
alias domain-management="open https://www.namecheap.com" | |
alias google-play-dev="open https://play.google.com" | |
alias nutri-site="open https://www.nutrilife.com" | |
alias nutri-email="open https://privateemail.com" | |
alias nutri-blood-pressure-tracker-google-play="open https://play.google.com/store/apps/details?id=com.neonutrilife.blood_pressure_tracker" | |
# end nutrilife useful sites | |
alias restart-dns="sudo systemctl restart systemd-resolved.service" # If get error Temporary failure in name resolution after using VPN | |
alias connect-vpn="nordvpn connect" | |
alias disconnect-vpn="nordvpn disconnect" | |
alias vpn-status="nordvpn status" | |
alias enable-firewall="sudo ufw enable" | |
alias disable-firewall="sudo ufw disable" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment