# * settings
-if [[ $HISTFILE ]]; then
+if [[ $LESSHISTFILE == - ]]; then
+ HISTFILE=
+ c() { cd "$@"; }
+elif [[ $HISTFILE ]]; then
HISTFILE=$HOME/.bh
fi
path-add --ifexists --end /a/work/libremanage
path-add --ifexists --end /a/opt/adt-bundle*/tools /a/opt/adt-bundle*/platform-tools
path-add --ifexists --end /a/opt/scancode-toolkit-3.10.
+path-add --ifexists --end /p/bin
case $HOSTNAME in
sy|bo)
s rsync -e "ssh -F /root/.ssh/confighome" "$@"
}
+zcheck() {
+ s ssh bow DISPLAY=:0 scrot /tmp/oegu.jpg
+ s scp bow:/tmp/oegu.jpg /t
+ s ssh bow rm /tmp/oegu.jpg
+ feh /t/oegu.jpg
+ }
slemacs() {
local arg rtime v
mnsnonet() {
ns=$1
+ lomh
if ! s ip netns list | grep -Fx nonet &>/dev/null; then
s ip netns add nonet
fi
arg+=(")")
dir=${1:-.}
# debug:
- #find $dir "${arg[@]}" -size +1M
- find $dir "${arg[@]}" -size +1M -exec mpv --profile=d '{}' +
+ #find $dir "${arg[@]}" -size +200k
+ find $dir "${arg[@]}" -size +200k -exec mpv --profile=d '{}' +
}
mpvs() {
mpv --profile=s "$@";
}
+r2e() { command r2e -d /p/c/rss2email.json -c /p/c/rss2email.cfg "$@"; }
# only run on MAIL_HOST. simpler to keep this on one system.
r2eadd() { # usage: name url
# initial setup of rss2email:
# get up to date and dont send old entries now:
r2e run --no-send $1
}
-r2e() { command r2e -d /p/c/rss2email.json -c /p/c/rss2email.cfg "$@"; }
rspicy() { # usage: HOST DOMAIN
# connect to spice vm remote host. use vspicy for local host
fi
}
-# alert when a page goes live. not urgent.
+# alert when a page goes live.
alert200() {
+ local quiet url tmpdir
+ quiet=false
+ case $1 in
+ # dont send a diff of the html. some html is not very readable
+ -q) quiet=true
+ shift
+ ;;
+ esac
url="$1"
tmpdir="$(mktemp -d)"
cd $tmpdir
while true; do
- if torsocks wget -q "$url"; then
- alertme $tmpdir
+ if wget -q "$url"; then
+ if $quiet; then
+ echo | daylert 200
+ else
+ alertme $tmpdir
+ fi
fi
- sleep $(( 600 + RANDOM % 300 ))
+ sleep $(( 120 + RANDOM % 300 ))
done
}
m sudo nsenter -t $pid -n -m sudo -u $USER -i bash
}
+sdnbashroot() { # systemd namespace bash
+ local unit pid
+ if (( $# != 1 )); then
+ echo $0: error wrong number of args >&2
+ return 1
+ fi
+ unit=$1
+ pid=$(servicepid $unit)
+ m sudo nsenter -t $pid -n -m bash
+}
+
+
sdncmd() { # systemd namespace cmd
local unit pid
if (( $# <= 2 )); then