minor improvements
authorIan Kelling <ian@iankelling.org>
Wed, 29 Apr 2026 15:25:53 +0000 (11:25 -0400)
committerIan Kelling <ian@iankelling.org>
Wed, 29 Apr 2026 15:25:53 +0000 (11:25 -0400)
.gitconfig
.psqlrc
.sqliterc
beetag
big.sqliterc
brc
distro-end
fast.sqliterc
filesystem/etc/sysctl.d/iank.conf
filesystem/etc/systemd/system/postgresql@18-main.service.d/iank.conf [new file with mode: 0644]
subdir_files/.config/konsolerc

index 9d45ab5b2de8070039758fc09388f6b00ae8ed5a..16b148c610a67cad05359a0999d7d5fbd5f2abcd 100644 (file)
@@ -3,12 +3,14 @@ name = Ian Kelling
 email = iank@fsf.org
 #email = ian@iankelling.org
 [alias]
-lg = log --graph --follow
-lgstat = log --stat --graph --follow --pretty=format:'%h %ad- %s [%an]'
+lg = log --graph
+lgstat = log --stat --graph --pretty=format:'%h %ad- %s [%an]'
+# stat without showing modification of existing files. ARCD = Added, Removed, Copied, Deleted.
+lgstat-m = log --stat --graph --pretty=format:'%h %ad- %s [%an]' --diff-filter=ARCD
 co = checkout
 s = status
 ci = commit
-lol = log --graph --follow --pretty=oneline --abbrev-commit --all
+lol = log --graph --pretty=oneline --abbrev-commit --all
 dt = difftool
 # https://stackoverflow.com/questions/17369254/is-there-a-way-to-cause-git-reflog-to-show-a-date-alongside-each-entry
 rl = reflog --format='%C(auto)%h %<|(17)%gd %C(blue)%ci%C(reset) %s'
diff --git a/.psqlrc b/.psqlrc
index f59b3a29da275f7b8dd460d5c304f67955c9919f..be763a5b6b5b10b0e9d9e56bbd17b98a29212d3d 100644 (file)
--- a/.psqlrc
+++ b/.psqlrc
@@ -1,2 +1,17 @@
--- wraps long columns. so nice.
-\pset format wrapped
+\set QUIET on
+
+-- reminder comment for occasionally useful setting to make nulls displayed explicitly.
+-- \pset null '.n_.'
+
+-- occasionally useful setting when optimizing queries, print the time of each query:
+-- \timing on
+
+\set HISTSIZE 500000
+\set HISTCONTROL ignoredups
+\set ON_ERROR_STOP on
+-- auto switch to \x when results are too wide to fix
+\x auto
+-- alternative to x auto, this wraps long columns.
+--\pset format wrapped
+
+\unset QUIET
index 6f7d58d13770133b567c3cf367440c0aff2d07be..733e873162b4e646d99d9593d904eb123b7e226d 100644 (file)
--- a/.sqliterc
+++ b/.sqliterc
@@ -1 +1,3 @@
-.timeout 6000
+.output /dev/null
+.timeout 20000
+.output stdout
diff --git a/beetag b/beetag
index 38eb1cc63429edccefbf68da671505c069047f50..f81aaabd22803856a7b3c3f7486f5fb7c3226d25 100755 (executable)
--- a/beetag
+++ b/beetag
@@ -354,6 +354,8 @@ beetag-track-select() {
 
 beetag-usage() {
   cat <<'EOF'
+#### note: the central place for my beets docs is in t.org
+
 tag with beets.
 usage: beetag [OPTIONS] QUERY
 
index 58051fba7197065246829ea886464d1a2211b56e..6fe276988d2e53d06cd406bf6a5717b30e0c62e7 100644 (file)
@@ -5,6 +5,7 @@
 -- 0 = OFF 1 = NORMAL 2 = FULL
 
 .output /dev/null
+.timeout 60000
 PRAGMA synchronous = NORMAL;
 PRAGMA journal_size_limit = 6144000;
 PRAGMA temp_store = MEMORY;
diff --git a/brc b/brc
index bdfbaca6c3e8be7edd3d0822f35d484708a559f5..61672d6ff871fa647fec8afbd43bdcec22e5549a 100644 (file)
--- a/brc
+++ b/brc
@@ -1165,13 +1165,8 @@ c4() { c /var/log/exim4; }
 # commit all amend
 caa() { git commit --amend --no-edit -a; }
 
-# cat + hr all files found by find.
-caf() {
-  local file
-  find -L "$@" -type f -not \( -name .svn -prune -o -name .git -prune \
-       -o -name .hg -prune -o -name .editor-backups -prune \
-       -o -name .undo-tree-history -prune \) -printf '%h\0%d\0%p\n' | sort -t '\0' -n \
-    | awk -F '\0' '{print $3}' 2>/dev/null | while read -r file; do
+catf-pretty() {
+  for file; do
     hr "$file"
     if type -p v &>/dev/null; then
       v "$file"
@@ -1185,6 +1180,31 @@ caf() {
     fi
   done
 }
+# cat + hr all files found by find. But if we just pass files, skip the find.
+caf() {
+  local file arg only_file_args=true
+
+  if (( $# == 0 )); then only_file_args=false; fi
+  for arg; do
+    if [[ ! -f $arg ]]; then
+      only_file_args=false
+      break
+    fi
+  done
+
+  if $only_file_args; then
+    catf-pretty "$@"
+  else
+
+
+    find -L "$@" -type f -not \( -name .svn -prune -o -name .git -prune \
+         -o -name .hg -prune -o -name .editor-backups -prune \
+         -o -name .undo-tree-history -prune \) -printf '%h\0%d\0%p\n' | sort -t '\0' -n \
+      | awk -F '\0' '{print $3}' 2>/dev/null | while read -r file; do
+      catf-pretty "$file"
+    done
+  fi
+}
 ccomp cat cf caf
 
 # calculator
@@ -2332,13 +2352,15 @@ lowr() {
   done
 }
 
-# note: this does not work for EOL chars.
-# aka chomp in perl. note this doesn't work as you would want because its not a variable reference. todo: think about improving it.
+# reminds me of chomp in perl. note this doesn't work as you would want
+# because its not a variable reference. todo: think about improving it.
 strips() {
   # remove leading whitespace characters
   var="${var#"${var%%[![:space:]]*}"}"
-  # remove trailing whitespace characters
+  # Inner var expansion: get from var: right of the rightmost non-space
+  # char. Outer var expansion: remove that from the right.
   var="${var%"${var##*[![:space:]]}"}"
+  #
 }
 
 # make filenames lowercase, remove bad chars
@@ -3129,11 +3151,12 @@ shk-p() {
   local fname="${1##*/}"
   [[ ! -L $1 && ( $fname == *.sh || $fname != *.* ) ]] && istext "$1" && [[ $(head -n1 "$1" 2>/dev/null) == '#!/bin/bash'* ]]
 }
-# todo: update bash style guide with new exceptions
+# todo: update bash style guide with new exceptions.
+# note: I wouldn't recommend 2012 to others.
 shellcheck-except() {
   local quotes others
-  quotes=2048,2064,2068,2086,2119,2206,2254,2231
-  others=2024,2029,2032,2033,2054,2164,2185,2190,2317
+  quotes=2048,2064,2068,2086,2119,2206,2254,2231,2223
+  others=2024,2029,2032,2033,2054,2164,2185,2190,2317,2012,2103
   shellcheck -e $quotes,$others "$@" || return $?
 }
 # wrapper for shellcheck with better defaults.
@@ -4865,7 +4888,7 @@ cryptc() {
   cryptsetup luksClose "$arg"
 }
 
-# crypt open
+# crypt open. just to save typing.
 crypto() {
   cryptsetup luksOpen "$@"
 }
index a9eece009bcb10ac5afcf0a689f5f158795e219e..1725cbaa29403cd753785aa60328635d95ca3838 100755 (executable)
@@ -1713,6 +1713,7 @@ esac
 
 ##### begin beets #####
 
+#### note: the central place for my beets docs is in t.org
 
 ## note: begin u24 message upon pip install
 # If you wish to install a non-Debian-packaged Python package,
@@ -2085,6 +2086,15 @@ if [[ ! -e /etc/apt/sources.list.d/pgdg.sources ]]; then
   fi
   # initial db creation with:
   # createdb -O iank db_name
+
+  e "vm.hugetlb_shm_group=$(getent group postgres|awk -F : '{print $3}')" |  sd /etc/sysctl.d/80-iank-hugepage-postgres.conf
+  sudo sysctl -p/etc/sysctl.d/80-iank-hugepage-postgres.conf
+  # total mem > 10g
+  if (( $(free -m|a2| sed -n 2p) > 10000 )); then
+    :
+    # if we get oomed, try enabling this in sysctl to disable overcommit.
+    # vm.overcommit_memory = 2
+    fi
 fi
 
 #####
index 8bc9da3489f93929150b112b76b91c5350b8f442..78692c7f012ee1a55eb8d37023c59e97bec1e904 100644 (file)
@@ -1,4 +1,5 @@
 .output /dev/null
+.timeout 20000
 -- note: this causes sqlite cli to print "memory"
 PRAGMA journal_mode = MEMORY;
 PRAGMA synchronous = OFF;
index 6442b2eff342ce6f64cb82a7029dfebfd9643f8f..2a30cf41d261386699454679285a311bd142d1f4 100644 (file)
@@ -2,3 +2,7 @@
 
 # default is 120 and gets hit a lot with heavy io.
 kernel.hung_task_timeout_secs=600
+
+# default is 50, preventing any app from commiting more than 50% of
+# physical memory + swap. I want to allow memory hogs.
+vm.overcommit_ratio=100
diff --git a/filesystem/etc/systemd/system/postgresql@18-main.service.d/iank.conf b/filesystem/etc/systemd/system/postgresql@18-main.service.d/iank.conf
new file mode 100644 (file)
index 0000000..4e78c71
--- /dev/null
@@ -0,0 +1,6 @@
+[Service]
+# enables using static hugepages.
+# default on t12: cat /proc/POSTGRES_PID/limits , Max locked memory = 8mb
+LimitMEMLOCK=infinity
+# not sure this is really needed, but supposedly this ensures postgres uses static huge pages.
+ExecStartPre=/bin/sh -c 'echo never | tee /sys/kernel/mm/transparent_hugepage/defrag /sys/kernel/mm/transparent_hugepage/enabled >/dev/null'
index 6a1f4e95afe50c754a15959d7540f5fb07445b55..310d7bf3f17eaaa5b3dd121c8bca7217adb1b70f 100644 (file)
@@ -23,10 +23,10 @@ ShowMenuBarByDefault=false
 2 screens: Width=1916
 2 screens: XPosition=2
 2 screens: YPosition=2
-3840x2160 screen: Height=1718
-3840x2160 screen: Width=1276
-3840x2160 screen: XPosition=2562
-3840x2160 screen: YPosition=440
+3840x2160 screen: Height=2156
+3840x2160 screen: Width=3836
+3840x2160 screen: XPosition=2
+3840x2160 screen: YPosition=2
 DP-0=DP-0
 DP-1 eDP-1=DP-1
 DP-1-1 eDP-1=DP-1-1