10 Commits
0.2.3 ... 0.5.1

Author SHA1 Message Date
bcaffe612c fixed move function in deploy.sh 2023-12-14 15:07:11 +01:00
391b85bea5 fixed new fancyfy scheme in deploy.sh 2023-12-14 15:02:45 +01:00
e24f3337a1 fixed terminal_fancyfy not working for server
excluded fancyfy from source in for loop
added sourcing only the correct file
2023-12-14 14:24:21 +01:00
fdb5d070e4 moved from static list of file to include to for cycle 2023-12-12 15:47:25 +01:00
ab8821aa4c fixed typo, updated variable fancyfy 2023-12-12 14:50:24 +01:00
4833a0a72e added dockerpull alias 2023-12-12 14:47:22 +01:00
761f7cf482 updated docker logs aliases 2023-12-12 14:46:33 +01:00
fd349baa99 variabilized terminal fancifying (client/server) 2023-12-12 14:45:02 +01:00
3c4e7d7858 added nocomments alias
removes comments from file and prints the rest
2023-10-02 14:38:23 +02:00
756bfbc542 added convenience alias 'sshfingerprint' 2023-03-31 20:25:47 +02:00
5 changed files with 52 additions and 29 deletions

View File

@@ -1,12 +1,4 @@
for source in colored_commands \
convenience_aliases \
docker_aliases \
git_functions \
histcontrol \
home_bin_folder \
ls_aliases \
safety_aliases \
terminal_colors \
terminal_fancyfying; do
. "$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )/$source"
for source in $(find "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd)" -type f | grep -Ev "_all|terminal_fancyfying"); do
. "${source}"
done
. "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd)/terminal_fancyfying_${TERMINAL_FANCYFY}"

View File

@@ -4,6 +4,8 @@ alias historygrep='history | grep'
alias sshconfig='nano ~/.ssh/config'
alias bashrc='. ~/.bashrc'
alias sshagent='eval `ssh-agent` && ssh-add ~/.ssh/id_!(*.pub)'
alias sshfingerprint='ssh-keygen -lf'
alias nocomments='grep -vE "^$|^#|^;"'
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)'

View File

@@ -1,6 +1,9 @@
alias dockerpull='docker compose pull'
alias dockerup='docker compose up'
alias dockerupd='docker compose up -d'
alias dockerdown='docker compose down'
alias dockerdownv='docker compose down --volumes'
alias dockerlogs='docker compose logs --tail=10'
alias dockerlogsf='docker compose logs --tail=10 --follow'
alias dockerlogs='docker compose logs'
alias dockerlogsf='docker compose logs --follow'
alias dockerlogst='docker compose logs --tail=10'
alias dockerlogstf='docker compose logs --tail=10 --follow'

View File

@@ -1,14 +1,28 @@
#!/usr/bin/env bash
THIS="$(dirname "$(readlink -fm "$0")")"
SERVER=false
FANCYFY="client"
CURRENT_FANCYFY=""
DELETE=false
MOVE=false
PRESENT=false
_bashrc_present() {
if [ ! -z "$(grep "#REF:bashrc_overrides:REF" ~/.bashrc)" ]; then
echo true
exit
fi
echo false
}
_arguments() {
if [ "$(_bashrc_present)" = true ]; then
PRESENT=true
CURRENT_FANCYFY="$(grep TERMINAL_FANCYFY /home/bryanpedini/.bashrc | sed 's/.*=//')"
fi
for PARM in "$@"; do
if [ "${PARM}" = "--server" ]; then
SERVER=true
FANCYFY="server"
elif [ "${PARM}" = "--delete" ]; then
DELETE=true
elif [ "${PARM}" = "--move" ]; then
@@ -38,17 +52,18 @@ _help() {
}
_delete() {
sed -i '/REF:bashrc_overrides:REF/{N;d}' ~/.bashrc
sed -i '/REF:bashrc_overrides:REF/{N;N;d}' ~/.bashrc
}
_bashrc_ref() {
echo "#REF:bashrc_overrides:REF" >> ~/.bashrc
echo "export TERMINAL_FANCYFY=${1}" >> ~/.bashrc
echo ". ${THIS}/bashrc_overrides/_all" >> ~/.bashrc
}
_move() {
_delete
_bashrc_ref
_bashrc_ref "${FANCYFY}"
}
_main() {
@@ -56,23 +71,34 @@ _main() {
if [ "${DELETE}" = true ]; then
_delete
echo "removed custom configs"
elif [ "${MOVE}" = true ]; then
_move
elif [ ! -z "$(grep "#REF:bashrc_overrides:REF" ~/.bashrc)" ]; then
echo "bash overrides already in place"
echo "skipping..."
echo
if [ "${PRESENT}" = false ]; then
_bashrc_ref "${FANCYFY}"
echo "unable to move to current directory"
echo "bash overrides not previously present"
echo "adding bash overrides..."
echo
else
_move
echo "moved custom config directory to ${THIS}"
echo
fi
elif [ "${PRESENT}" = true ]; then
if [ "${CURRENT_FANCYFY}" != "${FANCYFY}" ]; then
sed -i "s/TERMINAL_FANCYFY=${CURRENT_FANCYFY}/TERMINAL_FANCYFY=${FANCYFY}/" ~/.bashrc
echo "customized fancyfying"
echo
else
echo "bash overrides already in place"
echo "skipping..."
echo
fi
else
_bashrc_ref
_bashrc_ref "${FANCYFY}"
echo "bash overrides added"
echo
fi
if [ "${SERVER}" = true ]; then
sed -i 's/terminal_fancyfying/terminal_fancyfying_server/' ${THIS}/bashrc_overrides/_all
else
sed -i 's/terminal_fancyfying_server/terminal_fancyfying/' ${THIS}/bashrc_overrides/_all
fi
}
_main "$@"