From ae0fd0182e2b89c6b761206a2061469805f089d0 Mon Sep 17 00:00:00 2001 From: binaryDiv Date: Wed, 5 Apr 2023 15:35:42 +0200 Subject: [PATCH 01/13] .profile: Add ~/.local/bin to PATH --- .profile | 1 + 1 file changed, 1 insertion(+) diff --git a/.profile b/.profile index 89890ba..2fe763f 100644 --- a/.profile +++ b/.profile @@ -17,6 +17,7 @@ export BC_ENV_ARGS="-lq" [[ -f "$HOME/.bcrc" ]] && export BC_ENV_ARGS="$BC_ENV_ARGS $HOME/.bcrc" # PATH +[[ -d "$HOME/.local/bin" ]] && export PATH="$HOME/.local/bin:$PATH" [[ -d "$HOME/bin" ]] && export PATH="$HOME/bin:$PATH" # Wine: do not change filetype associations From cf777fad2d1243b48cc7a8e18e58108228feac2e Mon Sep 17 00:00:00 2001 From: binaryDiv Date: Sun, 20 Aug 2023 17:13:53 +0200 Subject: [PATCH 02/13] bashrc: Add dig aliases digs and digrr --- .bashrc.d/10_common_aliases.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.bashrc.d/10_common_aliases.sh b/.bashrc.d/10_common_aliases.sh index 83543ed..f673c29 100644 --- a/.bashrc.d/10_common_aliases.sh +++ b/.bashrc.d/10_common_aliases.sh @@ -102,3 +102,7 @@ function b64dec() { echo -n "$1" | base64 -d echo } + +# Shortcuts for dig with less output +alias digs='dig +short' +alias digrr='dig +noall +answer' From 6d036476e434431aa3141e87c91a3d479f626cd6 Mon Sep 17 00:00:00 2001 From: binaryDiv Date: Sun, 20 Aug 2023 17:15:19 +0200 Subject: [PATCH 03/13] bashrc: Improve cdtmp to include date in dir name --- .bashrc.d/10_common_aliases.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.bashrc.d/10_common_aliases.sh b/.bashrc.d/10_common_aliases.sh index f673c29..5fbb3f3 100644 --- a/.bashrc.d/10_common_aliases.sh +++ b/.bashrc.d/10_common_aliases.sh @@ -36,16 +36,18 @@ yay() { command yay "$@" } -# Create and cd to tmp dir -alias cdtmp='cd $(mktemp -d -p ~/tmp/)' +# Create and cd to temporary directory ~/tmp/tmp.YYYYMMDD.XXXXXX or ~/tmp/tmp.$1.XXXXXX if an argument is given +function cdtmp() { + cd $(mktemp -d -p ~/tmp tmp.${1:-$(date +%Y%m%d)}.XXXXXX) +} -# Make dir and cd to it (from Mara) +# Make dir and cd into it (from Mara) function mkcd() { mkdir -p "$1" cd "$1" } -# cd to dir + ll (ls -la) +# cd into dir + ll (ls -la) function cdll() { cd "$1" ls -la From 8e2c9918aba3b4a781f9f5c855b92e1e17e6ddb6 Mon Sep 17 00:00:00 2001 From: binaryDiv Date: Sun, 20 Aug 2023 17:20:10 +0200 Subject: [PATCH 04/13] Add .inputrc and readline macros in bashrc --- .bashrc.d/10_common_aliases.sh | 6 ++++++ .inputrc | 24 ++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 .inputrc diff --git a/.bashrc.d/10_common_aliases.sh b/.bashrc.d/10_common_aliases.sh index 5fbb3f3..bd7f43e 100644 --- a/.bashrc.d/10_common_aliases.sh +++ b/.bashrc.d/10_common_aliases.sh @@ -108,3 +108,9 @@ function b64dec() { # Shortcuts for dig with less output alias digs='dig +short' alias digrr='dig +noall +answer' + +# Readline macro Ctrl-Alt-L: Append "| less" to current command +bind '"\e\C-l": "\C-e | less"' + +# Readline macro Ctrl-Alt-B: Append ">/dev/null 2>&1 &" to current command +bind '"\e\C-b": "\C-e >/dev/null 2>&1 &"' diff --git a/.inputrc b/.inputrc new file mode 100644 index 0000000..a5bd70f --- /dev/null +++ b/.inputrc @@ -0,0 +1,24 @@ +# Include system defaults +$include /etc/inputrc + +# Disable terminal bell +set bell-style none + +# Enable colors for completion listings +set colored-completion-prefix on +set colored-stats on + +# Enable case-insensitive completion +set completion-ignore-case on + +# Show completion listing without double-Tab +set show-all-if-ambiguous on + +# Don't keep changes to history lines +set revert-all-at-newline on + +# Keybinding Alt-W: Like Ctrl-w but allowing slashes as word boundaries +"\ew": unix-filename-rubout + +# Keybinding Alt-Tab: Cycle through completions +"\e\C-i": menu-complete From 17e20bc020be84a05c9350007250b534b4a41ca6 Mon Sep 17 00:00:00 2001 From: binaryDiv Date: Sun, 20 Aug 2023 17:38:28 +0200 Subject: [PATCH 05/13] gitconfig: Add support for LFS --- .gitconfig.inc/common.gitconfig | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.gitconfig.inc/common.gitconfig b/.gitconfig.inc/common.gitconfig index 41d31a0..4fdf05e 100644 --- a/.gitconfig.inc/common.gitconfig +++ b/.gitconfig.inc/common.gitconfig @@ -1,5 +1,6 @@ [core] - eol = lf + # Normalize line endings + autocrlf = input [init] defaultBranch = main @@ -36,6 +37,12 @@ [credential] helper = /usr/lib/git-core/git-credential-libsecret +[filter "lfs"] + required = true + clean = git-lfs clean -- %f + smudge = git-lfs smudge -- %f + process = git-lfs filter-process + [pretty] ls = tformat:%C(yellow)%h %Cgreen%ad %Creset%s %Cblue[%an]%C(auto)%d lsd = tformat:%>|(13)%C(yellow)%h %Cgreen%ad %Creset%s %Cblue[%an]%C(auto)%d From 5a0c45b1bf32be057814fe5cf115d1cf512c5f96 Mon Sep 17 00:00:00 2001 From: binaryDiv Date: Sun, 20 Aug 2023 18:45:59 +0200 Subject: [PATCH 06/13] ssh_config: Include drop-in configs, set host defaults --- .ssh/config | 19 ++++++++----------- .ssh/config.d/50_hosts.conf | 8 ++++++++ 2 files changed, 16 insertions(+), 11 deletions(-) create mode 100644 .ssh/config.d/50_hosts.conf diff --git a/.ssh/config b/.ssh/config index 69881bf..87af48f 100644 --- a/.ssh/config +++ b/.ssh/config @@ -1,13 +1,10 @@ +# Include drop-in configurations +Include ~/.ssh/config.d/*.conf + +# Global configuration AddKeysToAgent yes -Host afra-door - HostName 172.23.42.69 - ProxyJump afra.fe80.eu - User pi - -Host toriel-dropbear - HostName 192.168.16.4 - User root - RemoteCommand cryptroot-unlock - RequestTTY yes - +# Host defaults +Host * + IdentitiesOnly yes + SendEnv LANG LC_* diff --git a/.ssh/config.d/50_hosts.conf b/.ssh/config.d/50_hosts.conf new file mode 100644 index 0000000..f683fd2 --- /dev/null +++ b/.ssh/config.d/50_hosts.conf @@ -0,0 +1,8 @@ +Host toriel + ForwardAgent yes + +Host toriel-dropbear + HostName 192.168.16.4 + User root + RemoteCommand cryptroot-unlock + RequestTTY yes From 9b881a2ddd283fa157be7bd66cd66a3251a0a2c5 Mon Sep 17 00:00:00 2001 From: binaryDiv Date: Mon, 21 Aug 2023 10:08:32 +0200 Subject: [PATCH 07/13] ssh_config: Add tanuki-dropbear host --- .ssh/config.d/50_hosts.conf | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.ssh/config.d/50_hosts.conf b/.ssh/config.d/50_hosts.conf index f683fd2..07f8a3f 100644 --- a/.ssh/config.d/50_hosts.conf +++ b/.ssh/config.d/50_hosts.conf @@ -6,3 +6,9 @@ Host toriel-dropbear User root RemoteCommand cryptroot-unlock RequestTTY yes + +Host tanuki-dropbear + Hostname tanuki + User root + RemoteCommand cryptroot-unlock + RequestTTY yes From a8d1c29d14289eeb717962597f8262a8675c7931 Mon Sep 17 00:00:00 2001 From: binaryDiv Date: Tue, 19 Sep 2023 15:01:05 +0200 Subject: [PATCH 08/13] Add set-display-dpi script --- bin/set-display-dpi | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 bin/set-display-dpi diff --git a/bin/set-display-dpi b/bin/set-display-dpi new file mode 100755 index 0000000..c40d364 --- /dev/null +++ b/bin/set-display-dpi @@ -0,0 +1,15 @@ +#!/bin/bash + +if [[ $# -eq 0 ]]; then + xdpyinfo | grep -B 2 resolution + exit 0 +fi + +NEW_VALUE="$1" + +xrandr --dpi "$NEW_VALUE" +echo "Xft.dpi: $NEW_VALUE" | xrdb -merge + +# Restart i3 +i3-msg restart >/dev/null + From 3458164a380e69e28578b53801a1adadcd9a9e59 Mon Sep 17 00:00:00 2001 From: binaryDiv Date: Wed, 22 Nov 2023 16:37:59 +0100 Subject: [PATCH 09/13] gitconfig: Set advice.detachedHead=false --- .gitconfig.inc/common.gitconfig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitconfig.inc/common.gitconfig b/.gitconfig.inc/common.gitconfig index 4fdf05e..5d3c504 100644 --- a/.gitconfig.inc/common.gitconfig +++ b/.gitconfig.inc/common.gitconfig @@ -2,6 +2,9 @@ # Normalize line endings autocrlf = input +[advice] + detachedHead = false + [init] defaultBranch = main From 2c00847807f4201774ece23f1adfdf395d126601 Mon Sep 17 00:00:00 2001 From: binaryDiv Date: Wed, 22 Nov 2023 16:39:37 +0100 Subject: [PATCH 10/13] bashrc: Set HISTTIMEFORMAT --- .bashrc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.bashrc b/.bashrc index 375387b..c16633f 100644 --- a/.bashrc +++ b/.bashrc @@ -14,6 +14,9 @@ export HISTSIZE=20000 export HISTFILESIZE=20000 export PROMPT_DIRTRIM=3 +# Save and display timestamps for history +HISTTIMEFORMAT="[%F %T] " + # Color output and default options export GREP_OPTS='--color=auto' export LS_OPTS='--color=auto -hFN --group-directories-first' From a7f548e94895461e1823791c26d0cf6f7823e466 Mon Sep 17 00:00:00 2001 From: binaryDiv Date: Wed, 22 Nov 2023 16:40:21 +0100 Subject: [PATCH 11/13] bashrc: Add shortcut "c" for "lscat" --- .bashrc.d/10_common_aliases.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.bashrc.d/10_common_aliases.sh b/.bashrc.d/10_common_aliases.sh index bd7f43e..4f4ba4a 100644 --- a/.bashrc.d/10_common_aliases.sh +++ b/.bashrc.d/10_common_aliases.sh @@ -70,6 +70,9 @@ function lscat() { done } +# Shortcut for lscat (either c for cat or c for "see") +alias c='lscat' + function calc() { echo "$@" | bc } From 4cf3083fd842b06a943ec28bd91b1561769267a6 Mon Sep 17 00:00:00 2001 From: binaryDiv Date: Wed, 6 Mar 2024 18:39:29 +0100 Subject: [PATCH 12/13] profile: Set SSH_AUTH_SOCK to gcr ssh agent --- .profile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.profile b/.profile index 2fe763f..2df3854 100644 --- a/.profile +++ b/.profile @@ -2,8 +2,8 @@ # ~/.profile -- Included by .bash_profile; includes ~/.profile.local # -# SSH key agent is started by systemd user -#export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.sock" +# SSH key agent +[[ -e "$XDG_RUNTIME_DIR/gcr/ssh" ]] && export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/gcr/ssh" # GPG key stuff export GPG_TTY=$(tty) From 30e3ab07420d663d5d926afdbf35c989c0ae908c Mon Sep 17 00:00:00 2001 From: binaryDiv Date: Wed, 6 Mar 2024 18:41:04 +0100 Subject: [PATCH 13/13] vimrc: Add shortcut to unindent with Shift-Tab --- .vimrc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.vimrc b/.vimrc index 12dc898..5d48566 100644 --- a/.vimrc +++ b/.vimrc @@ -139,6 +139,9 @@ inoremap j inoremap k inoremap l +" Unindent with Shift-Tab +inoremap << + " Copy and to X clipboard (Ctrl-C in visual mode and Ctrl-V in insert mode) vmap "+y imap "+P