Skip to content

Instantly share code, notes, and snippets.

@jalotra
Created July 9, 2025 15:50
Show Gist options
  • Save jalotra/78f0200a38949b2e70d5e540d9eff7ba to your computer and use it in GitHub Desktop.
Save jalotra/78f0200a38949b2e70d5e540d9eff7ba to your computer and use it in GitHub Desktop.
# Amazon Q pre block. Keep at the top of this file.
[[ -f "${HOME}/Library/Application Support/amazon-q/shell/zshrc.pre.zsh" ]] && builtin source "${HOME}/Library/Application Support/amazon-q/shell/zshrc.pre.zsh"
# If you come from bash you might have to change your $PATH.
export PATH=$HOME/bin:$HOME/.local/bin:/usr/local/bin:$PATH
export PATH=~/miniconda3/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
ZSH_THEME="robbyrussell"
# Set list of themes to pick from when loading at random
# Setting this variable when ZSH_THEME=random will cause zsh to load
# a theme from this variable instead of looking in $ZSH/themes/
# If set to an empty array, this variable will have no effect.
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )
# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"
# Uncomment the following line to use hyphen-insensitive completion.
# Case-sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"
# Uncomment one of the following lines to change the auto-update behavior
zstyle ':omz:update' mode disabled # disable automatic updates
# zstyle ':omz:update' mode auto # update automatically without asking
# zstyle ':omz:update' mode reminder # just remind me to update when it's time
# Uncomment the following line to change how often to auto-update (in days).
# zstyle ':omz:update' frequency 13
# Uncomment the following line if pasting URLs and other text is messed up.
# DISABLE_MAGIC_FUNCTIONS="true"
# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"
# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"
# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"
# Uncomment the following line to display red dots whilst waiting for completion.
# You can also set it to another string to have that shown instead of the default red dots.
# e.g. COMPLETION_WAITING_DOTS="%F{yellow}waiting...%f"
# Caution: this setting can cause issues with multiline prompts in zsh < 5.7.1 (see #5765)
# COMPLETION_WAITING_DOTS="true"
# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"
# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# You can set one of the optional three formats:
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# or set a custom format using the strftime function format specifications,
# see 'man strftime' for details.
# HIST_STAMPS="mm/dd/yyyy"
# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder
# Which plugins would you like to load?
# Standard plugins can be found in $ZSH/plugins/
# Custom plugins may be added to $ZSH_CUSTOM/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(git brew fzf httpie zsh-autosuggestions)
source $ZSH/oh-my-zsh.sh
# User configuration
# export MANPATH="/usr/local/man:$MANPATH"
export PATH="$PATH:$HOME/.local/bin"
# You may need to manually set your language environment
export LANG=en_US.UTF-8
# Preferred editor for local and remote sessions
if [[ -n $SSH_CONNECTION ]]; then
export EDITOR='vim'
else
export EDITOR='nvim'
fi
# Setup ranger
ranger_cd() {
temp_file="$(mktemp -t "ranger_cd.XXXXXXXXXX")"
ranger --choosedir="$temp_file" -- "${@:-$PWD}"
if chosen_dir="$(cat -- "$temp_file")" && [ -n "$chosen_dir" ] && [ "$chosen_dir" != "$PWD" ]; then
cd -- "$chosen_dir"
fi
rm -f -- "$temp_file"
}
bindkey '^@' create_completion
# This binds Ctrl-O to ranger_cd:
bindkey -s "^O" "ranger_cd^M"
# Example aliases
alias v='nvim'
# Aliases for newer rust tools
# Smarter Copy [Enable rm ONLY in linux]
# alias cp="cp -iv"
# alias mv="mv -iv"
# alias rm='rm -vI --preserve-root'
# alias mkdir="mkdir -pv"
#THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!!
export SDKMAN_DIR="$HOME/.sdkman"
[[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh"
# Added by Windsurf
export PATH="/Users/chinmayhebbar/.codeium/windsurf/bin:$PATH"
alias ls="ls -lhSrtFG"
# aws Logging
awsbackendlogs(){
filter_pattern=$1
# log_group_name="/ecs/cbx1-prod-usea1-java-backend"
log_group_name="/ecs/cbx1-qa-usea1-java-backend"
region="us-east-1"
limit="10000"
latest_stream=""
latest_stream=$(aws logs describe-log-streams \
--log-group-name "$log_group_name" --region $region \
--order-by LastEventTime --descending \
--limit 1 | jq -r '.logStreams[0].logStreamName')
echo $latest_stream
# If filter pattern is provided, use filter-log-events instead
if [ -n "$filter_pattern" ]; then
aws logs tail filter-log-events \
--log-group-name "$log_group_name" \
--log-stream-names "$latest_stream" \
--filter-pattern "$filter_pattern" \
--region "$region" \
--limit "$limit"
else
aws logs tail get-log-events \
--log-group-name "$log_group_name" \
--log-stream-names "$latest_stream" \
--region "$region" \
--limit "$limit"
fi
}
# Temporal specific config
start-temporal-dev() {
echo "Starting Temporal!"
temporal server start-dev & TEMPORAL_PID=$!
sleep 1
echo "creating search attributes!"
temporal operator search-attribute create --namespace default --name tasksExecuted --type Int
temporal operator search-attribute create --namespace default --name currentTask --type Keyword
temporal operator search-attribute create --namespace default --name lastExecutedTask --type Keyword
temporal operator search-attribute create --namespace default --name lastTaskCompletedAt --type Datetime
trap "echo 'stopped temporal!'; kill $TEMPORAL_PID; exit" SIGINT
wait $TEMPORAL_PID
}
# JavaHome
export JAVA_HOME=/opt/homebrew/opt/openjdk@21/libexec/openjdk.jdk/Contents/Home
alias run="java -Dspring.profiles.active=local --add-opens java.base/java.math=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.time=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 -jar application/target/application-0.0.1-SNAPSHOT.jar | tee app.log"
alias build="mvn clean package -DskipTests"
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/Users/jalotra/miniconda3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/Users/jalotra/miniconda3/etc/profile.d/conda.sh" ]; then
. "/Users/jalotra/miniconda3/etc/profile.d/conda.sh"
else
export PATH="/Users/jalotra/miniconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<
start-temporal-dev() {
echo "Starting Temporal!"
temporal server start-dev & TEMPORAL_PID=$!
sleep 1
echo "creating search attributes!"
temporal operator search-attribute create --namespace default --name tasksExecuted --type Int
temporal operator search-attribute create --namespace default --name currentTask --type Keyword
temporal operator search-attribute create --namespace default --name lastExecutedTask --type Keyword
temporal operator search-attribute create --namespace default --name lastTaskCompletedAt --type Datetime
trap "echo 'stopped temporal!'; kill $TEMPORAL_PID; exit" SIGINT
wait $TEMPORAL_PID
}
# this is for pyenv
export PATH="$PYENV_ROOT/shims:$PATH"
# this is to alias podman with docker
echo "alias docker=podman" >> ~/.zshrc
echo "alias docker-compose=podman-compose" >> ~/.zshrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment