You've already forked personal-linux-config
added aliases and deploy function
This commit is contained in:
@@ -1,13 +1,16 @@
|
|||||||
alias pubkey='for PUBKEY_FILE in $(ls ~/.ssh/id_*.pub); do echo "${PUBKEY_FILE} :" | sed -e "s/.*id_//;s/\.pub//"; cat "${PUBKEY_FILE}"; ssh-keygen -lf "${PUBKEY_FILE}" -E sha256; echo; done'
|
alias pubkey='for PUBKEY_FILE in $(ls ~/.ssh/id_*.pub); do echo "${PUBKEY_FILE} :" | sed -e "s/.*id_//;s/\.pub//"; cat "${PUBKEY_FILE}"; ssh-keygen -lf "${PUBKEY_FILE}" -E sha256; echo; done'
|
||||||
alias taglist='git tag | tr - \~ | sort -V | tr \~ -'
|
alias taglist='git tag | tr - \~ | sort -V | tr \~ -'
|
||||||
|
alias desudo="sudo -k"
|
||||||
alias hosts='sudo nano /etc/hosts'
|
alias hosts='sudo nano /etc/hosts'
|
||||||
alias historygrep='history | grep'
|
alias historygrep='history | grep'
|
||||||
alias sshconfig='nano ~/.ssh/config'
|
alias sshconfig='nano ~/.ssh/config'
|
||||||
alias aliases='nano ~/.bash_aliases'
|
alias aliases='nano ~/.bash_aliases'
|
||||||
alias bashrc='. ~/.bashrc'
|
alias bashrc='. ~/.bashrc'
|
||||||
|
alias bashrc-edit="nano ~/.bashrc"
|
||||||
alias sshagent='eval `ssh-agent` && ssh-add ~/.ssh/id_!(*.pub)'
|
alias sshagent='eval `ssh-agent` && ssh-add ~/.ssh/id_!(*.pub)'
|
||||||
alias sshfingerprint='ssh-keygen -lf'
|
alias sshfingerprint='ssh-keygen -lf'
|
||||||
alias nocomments='grep -vE "^$|^#|^;"'
|
alias nocomments='grep -vE "^$|^#|^;"'
|
||||||
|
alias ipecho="curl -fsSL https://ipecho.net/plain; echo"
|
||||||
alias newrepo='bash <(curl -s https://get.bjphoster.com/new-git-repo.sh)'
|
alias newrepo='bash <(curl -s https://get.bjphoster.com/new-git-repo.sh)'
|
||||||
alias newansibleworkspace='bash <(curl -s https://get.bjphoster.com/new-ansible-workspace.sh)'
|
alias newansibleworkspace='bash <(curl -s https://get.bjphoster.com/new-ansible-workspace.sh)'
|
||||||
alias infinitenothing='while true; do sleep 1; done'
|
alias infinitenothing='while true; do sleep 1; done'
|
||||||
|
|||||||
16
bashrc_overrides/deploy
Normal file
16
bashrc_overrides/deploy
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
deploy() {
|
||||||
|
REPO_HOST="git.bjphoster.com/"
|
||||||
|
REPO_ORG="deployments"
|
||||||
|
DEPLOY_DIRECTORY="${DEPLOY_DIRECTORY:-/srv}"
|
||||||
|
SERVICE="$1"
|
||||||
|
if [ "$#" -lt 1 ]; then
|
||||||
|
echo "Usage: deploy <service> [service-name]"
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
if [ "$#" -gt 1 ]; then
|
||||||
|
SERVICE_NAME="$2"
|
||||||
|
else
|
||||||
|
SERVICE_NAME="$SERVICE"
|
||||||
|
fi
|
||||||
|
git clone https://$REPO_HOST$REPO_ORG/$SERVICE $DEPLOY_DIRECTORY/$SERVICE_NAME
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user