iankelling.org
/
git
/
distro-setup
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d69c535
)
dns fix, some improvements
author
Ian Kelling
<ian@iankelling.org>
Wed, 24 Apr 2024 00:51:06 +0000
(20:51 -0400)
committer
Ian Kelling
<ian@iankelling.org>
Wed, 24 Apr 2024 00:51:06 +0000
(20:51 -0400)
brc
patch
|
blob
|
history
brc2
patch
|
blob
|
history
diff --git
a/brc
b/brc
index 5105c59611ac9f623471c6812bc27f9cc53eed75..4a6f67274a44f98b5be8b9b88b5e11fbf1327d6b 100644
(file)
--- a/
brc
+++ b/
brc
@@
-879,14
+879,14
@@
_khfix-common() {
fi
ll ~/.ssh/known_hosts
}
fi
ll ~/.ssh/known_hosts
}
-khfix-r() { # known hosts fix
+ root
+khfix-r() { # known hosts fix
without syncing to root user
_khfix-common "$@" || return 1
ssh $1 :
_khfix-common "$@" || return 1
ssh $1 :
- rootsshsync
}
khfix() {
_khfix-common "$@" || return 1
ssh $1 :
}
khfix() {
_khfix-common "$@" || return 1
ssh $1 :
+ rootsshsync
}
# copy path into clipboard
}
# copy path into clipboard
@@
-1672,9
+1672,9
@@
grr() { # grep recursive
# Don't return 1 on nonmatch because this is meant to be
# interactive, not in a conditional.
if [[ ${#@} == 1 ]]; then
# Don't return 1 on nonmatch because this is meant to be
# interactive, not in a conditional.
if [[ ${#@} == 1 ]]; then
- grep --exclude-dir='*.emacs.d' --exclude-dir='*.git' -riIP --color=auto "$@" . || [[ $? == 1 ]]
+ grep -
E -
-exclude-dir='*.emacs.d' --exclude-dir='*.git' -riIP --color=auto "$@" . || [[ $? == 1 ]]
else
else
- grep --exclude-dir='*.emacs.d' --exclude-dir='*.git' -riIP --color=auto "$@" || [[ $? == 1 ]]
+ grep -
E -
-exclude-dir='*.emacs.d' --exclude-dir='*.git' -riIP --color=auto "$@" || [[ $? == 1 ]]
fi
}
ccomp grep gr grr
fi
}
ccomp grep gr grr
@@
-3243,6
+3243,16
@@
if [[ $- == *i* ]]; then
# so I've thrown a bunch of things at the wall to speed it up.
prompt-command() {
local return=$? # this MUST COME FIRST
# so I've thrown a bunch of things at the wall to speed it up.
prompt-command() {
local return=$? # this MUST COME FIRST
+
+ # all usable colors:
+ # black
+ # green nonzero exit (pri 1)
+ # purple default
+ # purple bold
+ # red pwd different owner & group & not writable (pri 2)
+ # red bold pwd different owner & group & writable (pri 2)
+ # yellow
+
local ps_char ps_color
unset IFS
local ps_char ps_color
unset IFS
@@
-3250,22
+3260,21
@@
if [[ $- == *i* ]]; then
history -a # save history
fi
history -a # save history
fi
- case $return in
- 0) ps_color="$term_purple"
- ps_char='\$'
- ;;
- *) ps_color="$term_green"
- ps_char="$return \\$"
- ;;
- esac
+ ps_color="$term_purple"
+ ps_char='\$'
if [[ ! -O . ]]; then # not owner
if [[ -w . ]]; then # writable
ps_color="$term_bold$term_red"
else
if [[ ! -O . ]]; then # not owner
if [[ -w . ]]; then # writable
ps_color="$term_bold$term_red"
else
- ps_color="$term_
bold$term_green
"
+ ps_color="$term_
red
"
fi
fi
fi
fi
+ if [[ $return != 0 ]]; then
+ ps_color="$term_green"
+ ps_char="$return \\$"
+ fi
+
# faster than sourceing the file im guessing
if [[ -e /dev/shm/iank-status && ! -e /tmp/quiet-status ]]; then
eval "$(< /dev/shm/iank-status)"
# faster than sourceing the file im guessing
if [[ -e /dev/shm/iank-status && ! -e /tmp/quiet-status ]]; then
eval "$(< /dev/shm/iank-status)"
diff --git
a/brc2
b/brc2
index 5804466f05c8d243edc4f5dca748eef087a857ff..33384bcdd0a962c90a19242bbcfabf1aa3e4a4c3 100644
(file)
--- a/
brc2
+++ b/
brc2
@@
-1792,21
+1792,13
@@
bindpush() {
dsign iankelling.org expertpathologyreview.com zroe.org amnimal.ninja
lipush
for h in li bk; do
dsign iankelling.org expertpathologyreview.com zroe.org amnimal.ninja
lipush
for h in li bk; do
- e sshing $h
- ssh $h.b8.nz <<'EOF'
-source ~/.bashrc
-m dnsup
-EOF
+ m ssh $h.b8.nz dnsup
done
}
bindpushb8() {
lipush
for h in li bk; do
done
}
bindpushb8() {
lipush
for h in li bk; do
- e sshing $h
- ssh $h.b8.nz <<'EOF'
-source ~/.bashrc
-m dnsb8
-EOF
+ m ssh $h.b8.nz dnsb8
done
}
done
}
@@
-1817,8
+1809,18
@@
dnsup() {
dnsb8() {
local f=/var/lib/bind/db.b8.nz
m ser stop named
dnsb8() {
local f=/var/lib/bind/db.b8.nz
m ser stop named
- m sleep 1
- m sudo rm -fv $f.jnl $f.signed.jnl
+ # jbk is like a temp file. dunno if removing it helps
+
+ i=0
+ while pgrep '^named$' &>/dev/null; do
+ sleep .5
+ i=$(( i + 1 ))
+ if (( i > 100 )); then
+ echo "dnsb8: error: timeout waiting for named to exit"
+ return 1
+ fi
+ done
+ m sudo rm -fv $f.jnl $f.signed.jnl $f.jbk
m sudo install -m 644 -o bind -g bind /p/c/machine_specific/vps/bind-initial/db.b8.nz $f
m ser restart named
}
m sudo install -m 644 -o bind -g bind /p/c/machine_specific/vps/bind-initial/db.b8.nz $f
m ser restart named
}
@@
-2630,6
+2632,16
@@
wgkey() {
umask $umask_orig
}
umask $umask_orig
}
+host-info-all() {
+ host-info-update
+ bindpushb8
+ wrt-setup
+}
+
+
+# if you change a host's ip, then run
+# bindpushb8
+# wrt-setup
host-info-update() {
local -A vpn_ips host_ips host_macs nonvpn_ips
host-info-update() {
local -A vpn_ips host_ips host_macs nonvpn_ips
@@
-2673,8
+2685,6
@@
IdentityFile ~/.ssh/home
EOF
EOF
- grep -E '^[a-z0-9]+[[:space:]]' /p/c/machine_specific/vps/bind-initial/db.b8.nz | awk '{print $1,$3}'
-
local host ipsuf f files
sedi '/edits below here are made automatically/,$d' /p/c/machine_specific/li/filesystem/etc/wireguard/wgmail.conf
local host ipsuf f files
sedi '/edits below here are made automatically/,$d' /p/c/machine_specific/li/filesystem/etc/wireguard/wgmail.conf
@@
-2728,7
+2738,7
@@
EOF
echo 'local-data-ptr: "$l.'$ipsuf $host.b8.nz'"'
done
echo "EOF"
echo 'local-data-ptr: "$l.'$ipsuf $host.b8.nz'"'
done
echo "EOF"
- } | u /p/ptr-data
+ } | u /p/
c/
ptr-data
{
echo "cat <<EOF"
{
echo "cat <<EOF"
@@
-2737,7
+2747,7
@@
EOF
echo "dhcp-host=${host_macs[$host]},set:$host,\$l.$ipsuf,$host"
done
echo "EOF"
echo "dhcp-host=${host_macs[$host]},set:$host,\$l.$ipsuf,$host"
done
echo "EOF"
- } | u /p/dnsmasq-data
+ } | u /p/
c/
dnsmasq-data
{
for host in ${!nonvpn_ips[@]}; do
{
for host in ${!nonvpn_ips[@]}; do
@@
-4176,13
+4186,18
@@
monero() {
}
}
+# grep + find
+gef() {
+ faf | grep -E "$@" ||:
+ rgv "$@"
+}
+
# rg my main files
rgm() {
rg "$@" /p/w.org /a/t.org /a/work.org /b
}
# re all my files more expansively
# rg my main files
rgm() {
rg "$@" /p/w.org /a/t.org /a/work.org /b
}
# re all my files more expansively
-
rem() {
local paths
paths="/p/c /b/"
rem() {
local paths
paths="/p/c /b/"