You've already forked personal-linux-config
Compare commits
36 Commits
Author | SHA1 | Date | |
---|---|---|---|
391b85bea5 | |||
e24f3337a1 | |||
fdb5d070e4 | |||
ab8821aa4c | |||
4833a0a72e | |||
761f7cf482 | |||
fd349baa99 | |||
3c4e7d7858 | |||
756bfbc542 | |||
d235ac670d | |||
3a1f00ae34 | |||
8a87db917d | |||
dc2300b9cb | |||
464b77caa4 | |||
74d4d88ac6 | |||
42c11470b9 | |||
ae3732ebbb | |||
1c41cd039d | |||
799af1f6a1 | |||
c51a067dda | |||
8a8f304c1c | |||
ead9cb0d71 | |||
6dd1d386d1 | |||
9c4db7fef6 | |||
fe4a896ada | |||
c33ae90b33 | |||
09cf9b8bbe | |||
2913920987 | |||
ee267c0c50 | |||
6179e8d809 | |||
e8f69fbbad | |||
53752a866e | |||
a4885fa060 | |||
627282b2cc | |||
a8eaab7e81 | |||
6b2dded19a |
12
README.md
12
README.md
@@ -1,4 +1,10 @@
|
|||||||
# personal-kde-config
|
# Personal Linux config
|
||||||
Personal KDE and other Linux-related configs to help me succeed in life (or at least simplify it).
|
Personal Linux-related configs to help me succeed in life (or at least simplify it).
|
||||||
|
|
||||||
Feel free to try this out, or even add "cool stuff" to help each other out!
|
Feel free to try or poke around in the source (it's all human-readable bash), or heck even add "cool stuff" to help each other out!
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
Explaining section for not-so-intuitive configurations
|
||||||
|
|
||||||
|
- alias `sambaserver`: please `cd` into the directoy is needed to be shared and execute `sambaserver` followed by `"shareuser;<SUBSTITUTE-YOUR-PASSWORD-HERE>"`, then just login with username `shareuser` and the provided password with the host computer as URL/IP, autodiscovery of both the host and the share was tested working on Windows and a Samsung Tablet.
|
||||||
|
- alias `termbin`: use when piping a cat/echo/file/etc to upload to termbin.com (¡requires Netcat!)
|
||||||
|
@@ -1,13 +1,4 @@
|
|||||||
for source in colored_commands \
|
for source in $(find "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd)" -type f | grep -Ev "_all|terminal_fancyfying"); do
|
||||||
convenience_aliases \
|
. "${source}"
|
||||||
git_functions \
|
|
||||||
histcontrol \
|
|
||||||
home_bin_folder \
|
|
||||||
ls_aliases \
|
|
||||||
safety_aliases \
|
|
||||||
terminal_colors \
|
|
||||||
terminal_fancyfying; do
|
|
||||||
if [ -f ~/.bashrc_overrides/$source ]; then
|
|
||||||
. ~/.bashrc_overrides/$source
|
|
||||||
fi
|
|
||||||
done
|
done
|
||||||
|
. "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd)/terminal_fancyfying_${TERMINAL_FANCYFY}"
|
||||||
|
@@ -1,4 +1,15 @@
|
|||||||
alias pubkey='cat ~/.ssh/id_rsa.pub'
|
alias pubkey='for PUBKEY_FILE in $(ls ~/.ssh/id_*.pub); do echo "${PUBKEY_FILE} :" | sed -e "s/.*id_//;s/\.pub//"; cat "${PUBKEY_FILE}"; echo; done'
|
||||||
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 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 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 sambaserver='docker run -it --rm --network host -p 137:137 -p 138:138 -p 139:139 -p 445:445 -v `pwd`:/share dperson/samba -n -p -s "sambashare;/share;yes;no;no;shareuser" -w "WORKGROUP"'
|
||||||
|
alias acme.sh='docker run -it --rm -v ~/acme.sh:/acme.sh neilpang/acme.sh'
|
||||||
|
alias termbin='nc termbin.com 9999'
|
||||||
|
alias dnsversion='dig txt chaos version.bind'
|
||||||
|
9
bashrc_overrides/docker_aliases
Normal file
9
bashrc_overrides/docker_aliases
Normal file
@@ -0,0 +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'
|
||||||
|
alias dockerlogsf='docker compose logs --follow'
|
||||||
|
alias dockerlogst='docker compose logs --tail=10'
|
||||||
|
alias dockerlogstf='docker compose logs --tail=10 --follow'
|
@@ -13,4 +13,4 @@ if [ $GIT_FUNCTIONS ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
#PS1="$PS1${RED}#${FORMAT_RESET}"
|
#PS1="$PS1${RED}#${FORMAT_RESET}"
|
||||||
PS1="$PS1${RED}${FORMAT_BLINK}\$${FORMAT_RESET}"
|
PS1="$PS1${RED}\$${FORMAT_RESET}"
|
92
deploy.sh
92
deploy.sh
@@ -1,18 +1,32 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
THIS="$(dirname "$(readlink -fm "$0")")"
|
THIS="$(dirname "$(readlink -fm "$0")")"
|
||||||
SERVER=false
|
FANCYFY="client"
|
||||||
FORCE=false
|
CURRENT_FANCYFY=""
|
||||||
CLEANUP=false
|
DELETE=false
|
||||||
|
MOVE=false
|
||||||
|
PRESENT=false
|
||||||
|
|
||||||
|
_bashrc_present() {
|
||||||
|
if [ ! -z "$(grep "#REF:bashrc_overrides:REF" ~/.bashrc)" ]; then
|
||||||
|
echo true
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
echo false
|
||||||
|
}
|
||||||
|
|
||||||
_arguments() {
|
_arguments() {
|
||||||
|
if [ "$(_bashrc_present)" = true ]; then
|
||||||
|
PRESENT=true
|
||||||
|
CURRENT_FANCYFY="$(grep TERMINAL_FANCYFY /home/bryanpedini/.bashrc | sed 's/.*=//')"
|
||||||
|
fi
|
||||||
for PARM in "$@"; do
|
for PARM in "$@"; do
|
||||||
if [ "${PARM}" = "--server" ]; then
|
if [ "${PARM}" = "--server" ]; then
|
||||||
SERVER=true
|
FANCYFY="server"
|
||||||
elif [ "${PARM}" = "--force" ]; then
|
elif [ "${PARM}" = "--delete" ]; then
|
||||||
FORCE=true
|
DELETE=true
|
||||||
elif [ "${PARM}" = "--cleanup" ]; then
|
elif [ "${PARM}" = "--move" ]; then
|
||||||
CLEANUP=true
|
MOVE=true
|
||||||
elif [ "${PARM}" = "-h" ] || [ "${PARM}" = "--help" ]; then
|
elif [ "${PARM}" = "-h" ] || [ "${PARM}" = "--help" ]; then
|
||||||
_help
|
_help
|
||||||
exit 0
|
exit 0
|
||||||
@@ -24,45 +38,59 @@ _help() {
|
|||||||
echo "Usage: $(readlink -fm "$0") [-h | --help] [--cleanup]"
|
echo "Usage: $(readlink -fm "$0") [-h | --help] [--cleanup]"
|
||||||
echo
|
echo
|
||||||
echo "Options:"
|
echo "Options:"
|
||||||
echo " -h | --help : Prints this help message and quits"
|
echo " -h | --help"
|
||||||
echo " --server: Customizes the terminal feel for a server installation"
|
echo " Prints this help message and quits"
|
||||||
echo " --cleanup: Removes the source folder after installation"
|
echo " --force"
|
||||||
|
echo " Force the reinstallation of the files"
|
||||||
|
echo " --delete"
|
||||||
|
echo " Delete the reference in ~/.bashrc"
|
||||||
|
echo " --move"
|
||||||
|
echo " Create a new reference if the location of this folder has been changed"
|
||||||
|
echo " --server"
|
||||||
|
echo " Customizes the terminal feel for a server installation"
|
||||||
echo
|
echo
|
||||||
}
|
}
|
||||||
|
|
||||||
_bash_overrides() {
|
_delete() {
|
||||||
cp -r bashrc_overrides ~/.bashrc_overrides
|
sed -i '/REF:bashrc_overrides:REF/{N;N;d}' ~/.bashrc
|
||||||
echo "#REF:bashrc_overrides:REF" >> ~/.bashrc
|
|
||||||
echo "if [ -f ~/.bashrc_overrides/_all ]; then" >> ~/.bashrc
|
|
||||||
echo " . ~/.bashrc_overrides/_all" >> ~/.bashrc
|
|
||||||
echo "fi" >> ~/.bashrc
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_cleanup() {
|
_bashrc_ref() {
|
||||||
rm -rf ${THIS}
|
echo "#REF:bashrc_overrides:REF" >> ~/.bashrc
|
||||||
|
echo "export TERMINAL_FANCYFY=${1}" >> ~/.bashrc
|
||||||
|
echo ". ${THIS}/bashrc_overrides/_all" >> ~/.bashrc
|
||||||
|
}
|
||||||
|
|
||||||
|
_move() {
|
||||||
|
_delete
|
||||||
|
_bashrc_ref
|
||||||
}
|
}
|
||||||
|
|
||||||
_main() {
|
_main() {
|
||||||
_arguments "$@"
|
_arguments "$@"
|
||||||
|
|
||||||
if [ ! -z "$(grep "#REF:bashrc_overrides:REF" ~/.bashrc)" ] && [ "${FORCE}" = false ]; then
|
if [ "${DELETE}" = true ]; then
|
||||||
echo "bash overrides already in place"
|
_delete
|
||||||
echo "skipping..."
|
echo "removed custom configs"
|
||||||
|
elif [ "${MOVE}" = true ]; then
|
||||||
|
_move
|
||||||
|
echo "moved custom config directory to ${THIS}"
|
||||||
echo
|
echo
|
||||||
|
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
|
else
|
||||||
_bash_overrides
|
_bashrc_ref "${FANCYFY}"
|
||||||
echo "bash overrides added"
|
echo "bash overrides added"
|
||||||
echo
|
echo
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${SERVER}" = true ]; then
|
|
||||||
sed -i 's/terminal_fancyfying/terminal_fancyfying_server/' ~/.bashrc_overrides/_all
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "${CLEANUP}" = true ]; then
|
|
||||||
echo "cleaning up..."
|
|
||||||
_cleanup
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_main "$@"
|
_main "$@"
|
||||||
|
Reference in New Issue
Block a user