#!/bin/sh
# Validate environment
if ! command -v msgbus > /dev/null; then
printf "missing msgbus command. Use: go install git.mills.io/prologic/msgbus/cmd/msgbus@latest"
exit 1
fi
if ! command -v salty > /dev/null; then
printf "missing salty command. Use: go install go.mills.io/salty/cmd/salty@latest"
exit 1
fi
if ! command -v salty-keygen > /dev/null; then
printf "missing salty-keygen command. Use: go install go.mills.io/salty/cmd/salty-keygen@latest"
exit 1
fi
if [ -z "$SALTY_IDENTITY" ]; then
export SALTY_IDENTITY="$HOME/.config/salty/$USER.key"
fi
get_user () {
user=$(grep user: "$SALTY_IDENTITY" | awk '{print $3}')
if [ -z "$user" ]; then
user="$USER"
fi
echo "$user"
}
stream () {
if [ -z "$SALTY_IDENTITY" ]; then
echo "SALTY_IDENTITY not set"
exit 2
fi
jq -r '.payload' | base64 -d | salty -i "$SALTY_IDENTITY" -d
}
lookup () {
if [ $# -lt 1 ]; then
printf "Usage: %s nick@domain\n" "$(basename "$0")"
exit 1
fi
user="$1"
nick="$(echo "$user" | awk -F@ '{ print $1 }')"
domain="$(echo "$user" | awk -F@ '{ print $2 }')"
curl -qsSL "https://$domain/.well-known/salty/${nick}.json"
}
readmsgs () {
topic="$1"
if [ -z "$topic" ]; then
topic=$(get_user)
fi
export SALTY_IDENTITY="$HOME/.config/salty/$topic.key"
if [ ! -f "$SALTY_IDENTITY" ]; then
echo "identity file missing for user $topic" >&2
exit 1
fi
msgbus sub "$topic" "$0"
}
sendmsg () {
if [ $# -lt 2 ]; then
printf "Usage: %s nick@domain.tld <message>\n" "$(basename "$0")"
exit 0
fi
if [ -z "$SALTY_IDENTITY" ]; then
echo "SALTY_IDENTITY not set"
exit 2
fi
user="$1"
message="$2"
salty_json="$(mktemp /tmp/salty.XXXXXX)"
lookup "$user" > "$salty_json"
endpoint="$(jq -r '.endpoint' < "$salty_json")"
topic="$(jq -r '.topic' < "$salty_json")"
key="$(jq -r '.key' < "$salty_json")"
rm "$salty_json"
message="[$(date +%FT%TZ)] <$(get_user)> $message"
echo "$message" \
| salty -i "$SALTY_IDENTITY" -r "$key" \
| msgbus -u "$endpoint" pub "$topic"
}
make_user () {
mkdir -p "$HOME/.config/salty"
if [ $# -lt 1 ]; then
user=$USER
else
user=$1
fi
identity_file="$HOME/.config/salty/$user.key"
if [ -f "$identity_file" ]; then
printf "user key exists!"
exit 1
fi
# Check for msgbus env.. probably can make it fallback to looking for a config file?
if [ -z "$MSGBUS_URI" ]; then
printf "missing MSGBUS_URI in environment"
exit 1
fi
salty-keygen -o "$identity_file"
echo "# user: $user" >> "$identity_file"
pubkey=$(grep key: "$identity_file" | awk '{print $4}')
cat <<- EOF
Create this file in your webserver well-known folder. https://hostname.tld/.well-known/salty/$user.json
{
"endpoint": "$MSGBUS_URI",
"topic": "$user",
"key": "$pubkey"
}
EOF
}
# check if streaming
if [ ! -t 1 ]; then
stream
exit 0
fi
# Show Help
if [ $# -lt 1 ]; then
printf "Commands: send read lookup"
exit 0
fi
CMD=$1
shift
case $CMD in
send)
sendmsg "$@"
;;
read)
readmsgs "$@"
;;
lookup)
lookup "$@"
;;
make-user)
make_user "$@"
;;
esac
;-) I seem to remember there being g a script that checks for 1.17. Maybe that is only on make preflight
@prologic@twtxt.net yarn builds in 1.18!
Off to my first health check-up in 3 ½ years. I’m almost 40 pounds lighter than I was back then, so I hope this goes well.
I prefer ::1
Wow. I’m paying about 100 USD for my cable internet. Hard to estimate since its part of a tvd bundle. But it is 1.2Gbit down and 40Mbit up. And speed tests at that on the regular. The new house will have FTTH gigabit for 80ish.
Do they have Starlink beta down there yet?
Only 1 day of activity so far, but I’ve started a new project log for whatever the heck I end up doing to this Monroe 425 I got. http://a.9srv.net/monroe425
@fastidious@arrakis.netbros.com +1 …Now just a way to come up with the $20 per twt to store the data.
This pi will now boot directly to ed if the gpio pin is grounded at boot time. ed(1)term v1. :-) http://txtpunk.com/edterm/
@lyse ed(1) is the standard editor. ;-)
I fork bombed my computer! With ed(1)!!! Haven’t done that in a while.
On the blog: Real Life in Star Trek, The Slaver Weapon, part 1 https://john.colagioia.net/blog/2021/11/18/slaver.html #scifi #startrek #closereading
@fastidious@arrakis.netbros.com (#twksmyq) IPv6 because localhost -> ::1 is preferred on linux over ol’ 127.0.0.1
Now this is very useful.. it means when yarn is doing an HTTP request to itself its not closing the connection. that could mean a http.Response Body is not getting closed.
On the blog: Free Culture Book Club — if then else, part 1 https://john.colagioia.net/blog/2021/11/13/else.html #freeculture #bookclub
@darch@twtxt.net
Getting this when trying to use it:
error executing template timeline: template: timeline:131:43: executing "twt" at <formatForDateTime>: wrong number of args for formatForDateTime: want 2 got 1
+1
My nutritional supplements aim should be:
- 1 or 1.5 cups of lentils (or any beans you might like better).
- 2 or 2.5 cups of bitter greens.
- 1 cup of your favourite protein (or an egg), grilled, or fried with a little of olive oil.
- 1 or 2 tomatoes, or a handful if of the cherry type.
- No added sugars. If it is sweet, make it have fibre.
- No added salt (or very little and ionised), as salt is everywhere.
Related, I tried wild rice for the first time yesterday. It was different, in a good way.
Standby BIG-IP F5s upgraded to TMOS 16.1 (LTS). All their pairs (now on standby) will be upgraded on Wednesday. Just giving the TMOS some time to settle down, and feel at home. Hahahaha!
On the blog: Free Culture Book Club — Occupy This Novel!, Part 1 https://john.colagioia.net/blog/2021/10/23/occupy1.html #freeculture #bookclub
@stigatle@twtxt.net
You can get an Air for $1,000 (or $1,200 with 16GB). I have used it (with 8GB), and that machine flies. I can’t imagine how fast one with an M1MAX will feel.
An estimated 6.8 million fewer female births will be recorded across India by 2030 because of the persistent use of selective abortions, researchers estimate. — The Guardian
And from the same article:
India’s skewed ratio of men to women – currently between 900-930 females per 1,000 males – reflects India’s ingrained attitude towards girls. Boys are seen as breadwinners while girls are seen as a burden across every social class. Boys are more likely to receive more nutritious food and better medical care than girls.
That is just beyond sad.
So, first multi-line test, because I coudn’t wait. 😄
- One line - Two lines - Three lines
And:
- One line 2. Two lines 3. Three lines
How would jenny handle multiline twts? Let’s find out! - One - Two - Three And: 1. One 2. Two 3. Three
On the blog: Free Culture Book Club — Lightbringer, Part 1 https://john.colagioia.net/blog/2021/10/09/lightbringer.html #freeculture #bookclub
a simple Makefile for forwarding internet to your local machine:
SSH_HOST=https://xuu.me
PRIV_KEY=~/.ssh/id_ed25519
forward:
LOCAL_PORT=$(HOST_PORT); sh -c "$(shell http --form POST $(SSH_HOST) pub=@$(PRIV_KEY).pub | grep ^ssh | head -1 | awk '{ print "ssh -T -p " $$4 " " $$5 " -R " $$7 " -i $(PRIV_KEY)" }')"
On the blog: Free Culture Book Club — Affair, Part 1 https://john.colagioia.net/blog/2021/09/11/affair1.html #freeculture #bookclub
@niplav@niplav.github.io bigwor~1
On the blog: Free Culture Book Club — Typhoon, Part 1 https://john.colagioia.net/blog/2021/08/07/typhoon1.html #freeculture #bookclub
On the blog: Free Culture Book Club — Headshot, part 1 https://john.colagioia.net/blog/2021/07/17/headshot.html #freeculture #bookclub
On the blog: Free Culture Book Club — Solitudes and Silence, ch 1-4 https://john.colagioia.net/blog/2021/06/19/solitudes1.html #freeculture #bookclub
@prologic@twtxt.net @jlj@twt.nfld.uk @movq@www.uninformativ.de
/p/tmp > git clone https://www.uninformativ.de/git/lariza.git Mon May 24 23:48:18 2021
Cloning into 'lariza'...
/p/tmp > tree lariza/ 12.5s  Mon May 24 23:48:32 2021
lariza/
├── BUGS
├── CHANGES
├── LICENSE
├── Makefile
├── PATCHES
├── README
├── browser.c
├── man1
│  ├── lariza.1
│  └── lariza.usage.1
├── user-scripts
│  └── hints.js
└── we_adblock.c
2 directories, 11 files
On the blog: Free Culture Book Club — Moses und Aron, ch 1-3 https://john.colagioia.net/blog/2021/04/17/moses1.html #freeculture #bookclub
On the blog: Free Culture Book Club — The Spiraling Web, Part 1 https://john.colagioia.net/blog/2021/02/27/spiraling1.html #freeculture #bookclub
I was reading dd(1), where it is mentioned in passing, obliquely. Then stty(1) has more info.
@prologic@twtxt.net That is strange.. i wonder if there is another change that is causing it. Benchmarks are thinking the other way :|
BenchmarkAll/retwt-16 1 4940172200 ns/op 587319376 B/op 2587159 allocs/op
BenchmarkAll/lextwt-16 1 775764020 ns/op 9223088 B/op 197557 allocs/op
BenchmarkParse/retwt-16 1 591158277 ns/op 67539096 B/op 230841 allocs/op
BenchmarkParse/lextwt-16 1 716961837 ns/op 5450448 B/op 130290 allocs/op
BenchmarkOutput/retwt-html-16 1 8358103017 ns/op 918709168 B/op 4692292 allocs/op
BenchmarkOutput/lextwt-html-16 1 822033267 ns/op 14280112 B/op 261795 allocs/op
BenchmarkOutput/retwt-markdown-16 1 8114225415 ns/op 929928384 B/op 4693004 allocs/op
BenchmarkOutput/lextwt-markdown-16 1 806554306 ns/op 14332608 B/op 270905 allocs/op
BenchmarkOutput/retwt-text-16 1 8098215897 ns/op 923862192 B/op 4684739 allocs/op
BenchmarkOutput/lextwt-text-16 1 745064673 ns/op 12689784 B/op 252476 allocs/op
BenchmarkOutput/retwt-literal-16 1 4068799822 ns/op 409517880 B/op 2372471 allocs/op
BenchmarkOutput/lextwt-literal-16 1 754793627 ns/op 9834520 B/op 214931 allocs/op
Are you able to coax your webserver to add the charset to the content type header? Browsers are having a hard time thinking you are sending latin-1
content-type: text/plain; charset=utf-8
@lyse@lyse.isobeef.org @prologic@twtxt.net @vain@www.uninformativ.de A penny saved is a penny depreciating at a rate of 1.4% per annum.
On the blog: Free Culture Book Club — Biodigital, ch 1–13 https://john.colagioia.net/blog/2020/12/26/biodigital.html #freeculture #bookclub
On the blog: Free Culture Book Club — Pepper & Carrot, ep. 1–6 https://john.colagioia.net/blog/2020/12/19/pepper.html #freeculture #bookclub
@xuu@txt.sour.is Not too happy with WKD’s use of CNAME over SRV for discovery of openpgpkey.. That breaks using SNI pretty quick. I suppose it was setup as a temporary workaround anyhow in the RFC..
On the blog: Free Culture Book Club — Pratham Books, Part 1 https://john.colagioia.net/blog/2020/11/28/pratham.html #freeculture #bookclub
On the blog: Free Culture Book Club — Where Are the Joneses? Part 1 https://john.colagioia.net/blog/2020/09/26/joneses1.html #freeculture #bookclub
On the blog: Free Culture Book Club — Bookdash Books, Part 1 https://john.colagioia.net/blog/2020/09/12/bookdash.html #freeculture #bookclub
On the blog: Real Life in Star Trek, Season 1 Summary https://john.colagioia.net/blog/2020/08/06/season1.html #scifi #startrek #closereading
On the blog: Free Culture Book Club - Magnificent Mechanical Man §1–12 https://john.colagioia.net/blog/2020/07/11/manuel.html #freeculture #bookclub
Posted to Entropy Arbitrage: Real Life in Star Trek, The Menagerie, Part I https://john.colagioia.net/blog/2020/03/26/trek-menagerie-1.html #scifi #startrek #closereading