- commit
- 0606b46
- parent
- ed5289c
- author
- xxwhirlpool
- date
- 2025-06-10 10:20:00 -0400 EDT
more bashrc snippets
2 files changed,
+55,
-0
+17,
-0
1@@ -1,3 +1,5 @@
2+#!/bin/bash
3+
4 # from my laptop
5
6 alias nano=micro
7@@ -19,3 +21,18 @@ cdmess() {
8 mkdir -p "$today_tmpdir"
9 cd "$(mktemp -d -p "${today_tmpdir}" XXXX)"
10 }
11+
12+# don't log commands that start with a space
13+export HISTCONTROL=ignorespace
14+
15+# fuzzy find/search thru (recent) bash history
16+hist() {
17+ cat ~/.bash_history | fzf | sh
18+}
19+
20+# catppuccin colors for fzf
21+export FZF_DEFAULT_OPTS=" \
22+--color=spinner:#F2D5CF,hl:#E78284 \
23+--color=fg:#C6D0F5,header:#E78284,info:#CA9EE6,pointer:#F2D5CF \
24+--color=marker:#BABBF1,fg+:#C6D0F5,prompt:#CA9EE6,hl+:#E78284 \
25+--color=border:#414559,label:#C6D0F5"
+38,
-0
1@@ -0,0 +1,38 @@
2+#!/bin/bash
3+
4+cdmess() {
5+ # from this blog post:
6+ #
7+ # https://blog.larah.me/mess-directory/
8+ #
9+ today_tmpdir="${TMPDIR-/tmp}/${USER}_mess/$(date +%F)"
10+ mkdir -p "$today_tmpdir"
11+ cd "$(mktemp -d -p "${today_tmpdir}" XXXX)"
12+}
13+
14+# don't log commands that start with a space
15+export HISTCONTROL=ignorespace
16+
17+# fuzzy find/search thru (recent) bash history
18+hist() {
19+ cat ~/.bash_history | fzf | sh
20+}
21+
22+# catppuccin colors for fzf
23+export FZF_DEFAULT_OPTS=" \
24+--color=spinner:#F2D5CF,hl:#E78284 \
25+--color=fg:#C6D0F5,header:#E78284,info:#CA9EE6,pointer:#F2D5CF \
26+--color=marker:#BABBF1,fg+:#C6D0F5,prompt:#CA9EE6,hl+:#E78284 \
27+--color=border:#414559,label:#C6D0F5"
28+
29+# get a random free port. this is useful for my
30+# insane sysadmin website woman adventures
31+portfree() {
32+ while
33+ port=$(shuf -n 1 -i 49152-65535)
34+ netstat -atun | grep -q "$port"
35+ do
36+ continue
37+ done
38+ echo "$port"
39+}