<commit_before># Load Jmake autocompletion
[ -d $HOME/.jmake ] && source $HOME/.jmake/completion/jmake.completion.zsh

# AWS CLI support
[ -d ~/sources/awscli-saml-auth ] && source $HOME/sources/awscli-saml-auth/zshrc_additions

# LaaS CLI support
[ -f /usr/share/zsh/site-functions/_laas ] && source /usr/share/zsh/site-functions/_laas

# Helper function for work laptop
function reinit_peripherals() {
    nmcli con up "Ethernet (Atlassian)" || nmtui

    # Check for missing wifi firmware
    journalctl -b 0 -k -p warning | grep --color=always iwlwifi

    numlockx on
    xmodmap -e "remove Lock = Caps_Lock"
    xmodmap -e "keysym Caps_Lock = Escape"
    xmodmap -e "keysym XF86Tools = Insert"
    echo 2 | sudo tee /sys/module/hid_apple/parameters/fnmode
}


# Aliases for grepping POMs / plugin.xml
alias pom-grep="find . -iname pom.xml -print0 | xargs -0 -r ag"
alias plugin-grep="find . -iname atlassian-plugin.xml -print0 | xargs -0 -r ag"

# Aliases for connecting to Postgres in a docker container (started by jmake)
alias pg-docker="./jmake postgres docker"
alias pg-purge='docker rm -f $(cat docker.cid)'
alias pgcli-docker="pgcli -h localhost -p 5433 jira jira"
alias docker-cleanup='docker rm $(docker ps -a | awk "/Exited/{print $1}")'

# Aliases for starting JIRA
alias jdbg="./jmake debug --db DOCKER -J-Djira.webresource.local.caching=true"
alias jdbg-indexprimary='jdbg -J-Djira.instrumentation.laas=true -J-Datlassian.darkfeature.jira.issue.search.api.indexprimary.enabled=true'
alias jdbg-dbprimary='jdbg -J-Djira.instrumentation.laas=true -J-Datlassian.darkfeature.jira.issue.search.api.databaseprimary.enabled=true'
alias jdbg-dbonly='jdbg -J-Djira.instrumentation.laas=true -J-Datlassian.darkfeature.jira.issue.search.api.databaseonly.enabled=true'
alias jdbg-vertigo="jdbg -J-Dsearch.vertigo.mode=true"

alias jqdbg="./jmake debug quickstart --db DOCKER -J-Djira.webresource.local.caching=true"
alias jqdbg-indexprimary='jqdbg -J-Djira.instrumentation.laas=true -J-Datlassian.darkfeature.jira.issue.search.api.indexprimary.enabled=true'
alias jqdbg-dbprimary='jqdbg -J-Djira.instrumentation.laas=true -J-Datlassian.darkfeature.jira.issue.search.api.databaseprimary.enabled=true'
alias jqdbg-dbonly='jqdbg -J-Djira.instrumentation.laas=true -J-Datlassian.darkfeature.jira.issue.search.api.databaseonly.enabled=true'
alias jqdbg-vertigo="jqdbg -J-Dsearch.vertigo.mode=true"

function jira-prod-commits(){
    curl -sS https://version-tracker.internal.useast.atlassian.io/services/JIRA \
        | jq '.shards["jira-prod-us-1", "jira-prod-us-2"].stacks[].stack' \
        | awk -F-- '{print $3}' \
        | awk -F- '{print $4}'
}

# Jira quick compile
function jqc() {<commit_msg>Deleted function, as it no longer works<commit_after># Load Jmake autocompletion
[ -d $HOME/.jmake ] && source $HOME/.jmake/completion/jmake.completion.zsh

# AWS CLI support
[ -d ~/sources/awscli-saml-auth ] && source $HOME/sources/awscli-saml-auth/zshrc_additions

# LaaS CLI support
[ -f /usr/share/zsh/site-functions/_laas ] && source /usr/share/zsh/site-functions/_laas

# Helper function for work laptop
function reinit_peripherals() {
    nmcli con up "Ethernet (Atlassian)" || nmtui

    # Check for missing wifi firmware
    journalctl -b 0 -k -p warning | grep --color=always iwlwifi

    numlockx on
    xmodmap -e "remove Lock = Caps_Lock"
    xmodmap -e "keysym Caps_Lock = Escape"
    xmodmap -e "keysym XF86Tools = Insert"
    echo 2 | sudo tee /sys/module/hid_apple/parameters/fnmode
}


# Aliases for grepping POMs / plugin.xml
alias pom-grep="find . -iname pom.xml -print0 | xargs -0 -r ag"
alias plugin-grep="find . -iname atlassian-plugin.xml -print0 | xargs -0 -r ag"

# Aliases for connecting to Postgres in a docker container (started by jmake)
alias pg-docker="./jmake postgres docker"
alias pg-purge='docker rm -f $(cat docker.cid)'
alias pgcli-docker="pgcli -h localhost -p 5433 jira jira"
alias docker-cleanup='docker rm $(docker ps -a | awk "/Exited/{print $1}")'

# Aliases for starting JIRA
alias jdbg="./jmake debug --db DOCKER -J-Djira.webresource.local.caching=true"
alias jdbg-indexprimary='jdbg -J-Djira.instrumentation.laas=true -J-Datlassian.darkfeature.jira.issue.search.api.indexprimary.enabled=true'
alias jdbg-dbprimary='jdbg -J-Djira.instrumentation.laas=true -J-Datlassian.darkfeature.jira.issue.search.api.databaseprimary.enabled=true'
alias jdbg-dbonly='jdbg -J-Djira.instrumentation.laas=true -J-Datlassian.darkfeature.jira.issue.search.api.databaseonly.enabled=true'
alias jdbg-vertigo="jdbg -J-Dsearch.vertigo.mode=true"

alias jqdbg="./jmake debug quickstart --db DOCKER -J-Djira.webresource.local.caching=true"
alias jqdbg-indexprimary='jqdbg -J-Djira.instrumentation.laas=true -J-Datlassian.darkfeature.jira.issue.search.api.indexprimary.enabled=true'
alias jqdbg-dbprimary='jqdbg -J-Djira.instrumentation.laas=true -J-Datlassian.darkfeature.jira.issue.search.api.databaseprimary.enabled=true'
alias jqdbg-dbonly='jqdbg -J-Djira.instrumentation.laas=true -J-Datlassian.darkfeature.jira.issue.search.api.databaseonly.enabled=true'
alias jqdbg-vertigo="jqdbg -J-Dsearch.vertigo.mode=true"

# Jira quick compile
function jqc() {
{'fraction_non_alphanumeric': 0.1348900038595137, 'fraction_numerical': 0.005789270551910459, 'mean_word_length': 4.288775510204082, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4970265', 'n_tokens_mistral': 1957, 'n_tokens_neox': 1897, 'n_words': 392}