From 191679bb000e1e9da7fc04e161f0bd94417f607a Mon Sep 17 00:00:00 2001 From: chodak166 Date: Fri, 17 Apr 2026 09:55:58 +0200 Subject: [PATCH] bashrc/zshrc update --- .bashrc | 24 +++++++----------- .gitignore | 4 --- .zshrc | 72 +++--------------------------------------------------- README.md | 2 -- 4 files changed, 13 insertions(+), 89 deletions(-) delete mode 100644 .gitignore delete mode 100644 README.md diff --git a/.bashrc b/.bashrc index e35c1e4..61b0a9c 100755 --- a/.bashrc +++ b/.bashrc @@ -1,8 +1,3 @@ -### Added by Codeium. These lines cannot be automatically removed if modified -if command -v termium > /dev/null 2>&1; then - eval "$(termium shell-hook show pre)" -fi -### End of Codeium integration # ~/.bashrc: executed by bash(1) for non-login shells. # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) # for examples @@ -123,8 +118,8 @@ fi ######### GIT-AWARE-PROMPT ######### -export GITAWAREPROMPT=/usr/share/git-aware-prompt -source "${GITAWAREPROMPT}/main.sh" +#export GITAWAREPROMPT=/usr/share/git-aware-prompt +#source "${GITAWAREPROMPT}/main.sh" export PS1="\${debian_chroot:+(\$debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\] \[$txtcyn\]\$git_branch\[$txtred\]\$git_dirty\[$txtrst\]\$ " @@ -153,20 +148,19 @@ PROMPT_COMMAND="history -a; $PROMPT_COMMAND" -alias pbgit='git config user.name "Łukasz Chodyła" && git config user.email "lukasz.chodyla@platformabiznesu.net"' +alias git-config-pb='git config user.name "Łukasz Chodyła" && git config user.email "lukasz.chodyla@platformabiznesu.net"' +alias git-cofig-ch='git config user.name "chodak166" && git config user.email "chodak166@op.pl" -alias bashI="bash --init-file <(echo '. ~/.bashrc; unset HISTFILE')" +alias ibash="bash --init-file <(echo '. ~/.bashrc; unset HISTFILE')" alias gl="git log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all" +alias bat=batcat + +# source /usr/share/doc/fzf/examples/key-bindings.bash + [ -f ~/.fzf.bash ] && source ~/.fzf.bash -alias cat=batcat -### Added by Codeium. These lines cannot be automatically removed if modified -if command -v termium > /dev/null 2>&1; then - eval "$(termium shell-hook show post)" -fi -### End of Codeium integration . "$HOME/.local/bin/env" diff --git a/.gitignore b/.gitignore deleted file mode 100644 index b9d5f7f..0000000 --- a/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# ---> Diff -*.patch -*.diff - diff --git a/.zshrc b/.zshrc index 62f6ce6..c0c56c5 100644 --- a/.zshrc +++ b/.zshrc @@ -163,79 +163,15 @@ if [[ "$TERM" == screen* ]]; then PROMPT_COMMAND="screen_set_window_title; $PROMPT_COMMAND" fi -edit_secure() { - # Using $HOME is safer than ~ inside scripts - local plain_file="$HOME/.scripts/secure_functions.sh" - local encrypted_file="${plain_file}.gpg" - - # 1. Check if the encrypted file exists - if [[ -f "$encrypted_file" ]]; then - # It exists: Decrypt it so we can edit - gpg -q -o "$plain_file" -d "$encrypted_file" || return 1 - else - # It doesn't exist: Create the directory just in case - mkdir -p "$(dirname "$plain_file")" - echo "Creating new secure file..." - fi - - # 2. Open editor (Defaults to nano if EDITOR is not set) - ${EDITOR:-nano} "$plain_file" - - # 3. Encrypt and Cleanup - # Only encrypt if the file actually exists (in case you exited editor without saving) - if [[ -f "$plain_file" ]]; then - echo "Encrypting..." - # Encrypt (-c) AND THEN remove the plaintext file (rm) only if encryption succeeded (&&) - gpg -c "$plain_file" && rm "$plain_file" - echo "Done. Secrets saved to $encrypted_file" - else - echo "Aborted: No file saved." - fi -} - - -_run_secure_func() { - local func_name="$1" - local encrypted_file="$HOME/.scripts/secure_functions.sh.gpg" - - [[ -f "$encrypted_file" ]] || { - echo "Error: Encrypted file not found" >&2 - return 1 - } - - # SECURITY CRITICAL: Run in isolated subshell with history disabled - ( - # Cross-shell history disabling - unset HISTFILE # Disables history file in BOTH shells - HISTSIZE=0 # Bash: disable in-memory history - SAVEHIST=0 # Zsh: disable history saving - - # Zsh-specific hardening (safe to run in bash too) - [ -n "${ZSH_VERSION:-}" ] && setopt no_history no_hist_save no_hist_verify 2>/dev/null || true - - # Decrypt → source → execute (all in-memory) - gpg --quiet --decrypt "$encrypted_file" 2>/dev/null | { - source /dev/stdin - "$func_name" - } - ) - - # Optional: Invalidate cache after use (prevents lingering secrets) - #{ sleep 1; echo RELOADAGENT | gpg-connect-agent >/dev/null 2>&1; } & -} - - -test_secure() { - _run_secure_func _test_secure -} - - -[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh alias bat=batcat alias ll='eza --icons=auto -T --level 2 -lah --group-directories-first --color=always | less' +alias gl="git log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all" +alias git-config-pb='git config user.name "Łukasz Chodyła" && git config user.email "lukasz.chodyla@platformabiznesu.net"' +alias git-cofig-ch='git config user.name "chodak166" && git config user.email "chodak166@op.pl" alias config='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME' export VCPKG_ROOT=/opt/vcpkg +[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh . "$HOME/.local/bin/env" diff --git a/README.md b/README.md deleted file mode 100644 index d23d95a..0000000 --- a/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# dotfiles -