X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=brc2;h=bad1194baf610135693989e4eb8da56efee403de;hb=768363d8771edb9d9ed82425fa772d77b90139c0;hp=1974c580b867ea432b9cff6b42664080888f9087;hpb=06a56540b041accaaff795ad57664e368cb07a10;p=distro-setup diff --git a/brc2 b/brc2 index 1974c58..bad1194 100644 --- a/brc2 +++ b/brc2 @@ -420,7 +420,7 @@ astudio() { # Convert brains file path to url and vice versa # usage: brains [URL_OR_PATH] brains() { - _iki-convert '(/a)?/f/brains' brains.fsf.org "$@" + _iki-convert '(/a)?/f/brains' brains.fsf.org/wiki "$@" } glue() { _iki-convert '(/a)?/f/gluestick' gluestick.office.fsf.org "$@" @@ -428,9 +428,9 @@ glue() { # usage: $0 REPO_PATH [URL_OR_PATH] _iki-convert() { - local url domain path input err repo_dir dir url_dir url + local url prefix path input err repo_dir dir url_dir url repo_dir="$1" - domain="$2" + prefix="$2" shift 2 err=false if $err; then @@ -443,7 +443,7 @@ _iki-convert() { fi case $input in http*) - path="$repo_dir/${input##http*://"$domain"/wiki/}" + path="$repo_dir/${input##http*://"$prefix"/}" if [[ $path == */ ]]; then path=${path%/}.mdwn fi @@ -452,7 +452,7 @@ _iki-convert() { *) path=$(fp "$input") url_dir=$(echo "$path" | sed -r "s,^$repo_dir/,,") - url="https://$domain/wiki/$url_dir" + url="https://$prefix/$url_dir" url="${url%.mdwn}/" j echo "$url" ;; @@ -1673,7 +1673,7 @@ bindpush() { dsign iankelling.org expertpathologyreview.com zroe.org amnimal.ninja lipush for h in li bk; do - m sl $h <<'EOF' + m sl $h.b8.nz <<'EOF' source ~/.bashrc m dnsup EOF @@ -2169,7 +2169,7 @@ hstatus() { wlog() { local day i days_back days_back=${1:-16} - for (( i=0; i=0; i-- )); do day=$( date +%F -d @$((EPOCHSECONDS - 86400*i )) ) date "+%a %b %d" -d @$((EPOCHSECONDS - 86400*i )) | tr '\n' ' ' /a/opt/timetrap/bin/t d -ftotal -s $day -e $day all -m '^w|lunch$' @@ -2780,6 +2780,12 @@ myirc() { } +allmyirc() { + local d + d=/var/lib/znc/moddata/log/iank/freenode + ssh root@iankelling.org "cd $d; find . -mtime -60 -type f -exec grep '\ 15 )); then + i=$(( logcount - 15 )) + else + i=0 + fi + min_date=$(date -d 'monday 2 weeks ago' +%s) + for (( ; i < logcount; i++ )); do + log=${logs[$i]} + d=$(date -d "$(head -n1 $log|awk '{print $1}')" +%s) + if (( d < min_date )); then + continue + fi + if awk '$3 == "iank:"' $log | sed -r 's/^(.{10}).(.{8})[^ ]+(.*)/\1_\2\3/' | grep .; then + hr + fi + done + popd } +# tail pms in the last day, for the case where we restart profanity and +# didn't check for pms beforehand. +profrecent() { + local d dates date files f + # consider making the day count passed by parameter. note: this works: $(date -d '2 day ago' +%Y_%m_%d) + dates=("$(date -d +%Y_%m_%d)" "$(date -d '1 day ago' +%Y_%m_%d)" ) + for d in /d/p/profanity/chatlogs/iank_at_fsf.org/!(rooms); do + files=() + for date in ${dates[@]}; do + f=$d/$date.log + if [[ -e $f ]]; then + files+=($f) + fi + done + if (( ${#files[@]} >= 1 )); then + cat ${files[@]} | tail + hr + fi + done +} + + # usage: debvm DEBIAN_VERSION RAM_MB debvm() { local ver ram fname src