Alias - s50600822/Notes GitHub Wiki

alias algo='cd /Users/hoaphan/dev/code/s50600822/Notes/interview_prep/algorithm/java/ide_handicapped'


alias jn='jx ns'
alias jnc='jx ns conductor'
alias jns='jx ns streamtech'

alias k='kubectl'
alias k_list_all_resources='kubectl api-resources |sort -k1'
alias kg='kubectl get'
alias kd='kubectl describe'
alias ke='kubectl exec '
alias kei='kubectl exec -it '
alias kl='k logs '
alias klf='k logs -f '
alias kdns='k delete ns '
alias knsc='k get ns|grep netflix-conductor'
alias knsa='k get ns -A'
alias ked='k edit deployment '

alias kr='kubectl api-resources'
alias kallpod='kubectl get pods -A'
alias pod='k get pod --sort-by=.status.startTime'
alias ing='k get ing'
alias dep='k get deployment'
alias ns='k get ns'
alias podsl='k get pod --show-labels'
alias svc='k get svc'
alias kgetYaml='k get -o yaml'
alias kpfw='k port-forward'
alias krestart='kubectl rollout restart deployment '

alias grm='git pull --rebase origin '
alias gustag='git fetch upstream --tags'
alias grsmain='git reset --hard origin/main'

alias subl="/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl"
alias sub=subl
alias zshrc='sub ~/.zshrc'

han(){
	open -a "Google Chrome"  'https://github.com/s50600822/Notes/wiki/Hanzi'
}

#launch link from various browser
openLink() {
    local link="$1"
    open -a "Google Chrome" "$link"
    open -a "Safari" "$link"
    open -a "Opera" "$link"
    open -a "Brave Browser" "$link"
    open -a "DuckDuckGo" "$link"
}





jbenchPrj(){
echo "Java Microbenchmark Harness https://github.com/openjdk/jmh"
mvn archetype:generate \
  -DinteractiveMode=false \
  -DarchetypeGroupId=org.openjdk.jmh \
  -DarchetypeArtifactId=jmh-java-benchmark-archetype \
  -DgroupId=org.sample \
  -DartifactId=test \
  -Dversion=1.0
}


alias n20='nvm use v20.11.1'
alias n18='nvm use v18.19.1'
alias n16='nvm use v16.20.2'
alias n14='nvm use v14.21.3'
alias n10='nvm use v10.24.1'
# https://stackoverflow.com/questions/69692842/error-message-error0308010cdigital-envelope-routinesunsupported/73465262#73465262
npmLegacySSL(){
   export NODE_OPTIONS=--openssl-legacy-provider
}

# list all docker images sorted by size
dimg(){
docker images --format "{{.Repository}}:{{.Tag}} - {{.Size}}" | awk '{print $NF, $0}' | sort -h
}


alias ngroot='cd /opt/homebrew/var/www'
alias ngxsta='brew services start nginx'
alias ngxsto='brew services stop nginx'

export GOPATH=$HOME/go
export PATH="$GOPATH/bin:$PATH"


dirname__dash2underscore() {
# rename dirs like a-b-c in current dir to a_b_c    
  for dir in */; do
    # Check if the directory name contains '-'
    if [ $dir == *-* ](/s50600822/Notes/wiki/-$dir-==-*-*-); then
      # Replace '-' with '_' in the directory name
      new_dir=$(echo "$dir" | tr '-' '_')
      mv -v "$dir" "$new_dir"
    fi
  done
}