soc.octade.net is a Fediverse instance that uses the ActivityPub protocol. In other words, users at this host can communicate with people that use software like Mastodon, Pleroma, Friendica, etc. all around the world.
This server runs the snac software and there is no automatic sign-up process.
I wonder whether there are any opportunities (for me) to work with #activitypub and #fediverse. My background is in #PHP (decoupled #Drupal), but I am keen to diversify into other languages. I also have solid experience with #REST, #bash and CLI tools.
LOL, recursive script and sed = clobbered myself, ha ha. Who needs a malicious AI when you have a defective brain-to-fingers interface? 🤪 #bash
Here is a "sketch of concept".
I am not satisfied with it, but it may be better than nothing.
(Relying on a DEBUG trap isn't really a good thing here, in my view.)
(1) Example transcript:
$ echo hello
hello
Ready(0); E=0.00 s 10:21:42
$ sleep 1.5
Ready(0); E=1.50 s 10:22:06
$
Ready(0); E=1.50 s 10:22:07
$ false | sleep 3.456
Ready(1 0); E=3.46 s 10:22:47
$
Ready(1 0); E=3.46 s 10:22:50
$ :
Ready(0); E=0.00 s 10:22:55
$
Ready(0); E=0.00 s 10:23:01
(2) Bash source for the above:
### Print the elapsed time for the previous command before each bash prompt.
### Uses a DEBUG trap and the PROMPT_COMMAND variable.
prompt__elapsed_time=""; #Keeping state.
function prompt__print_prompt () {
declare -r s="${PIPESTATUS[*]}";
if [[ "${prompt__elapsed_time}" == "" ]]; then
## The prompt does not change on just pressing Return (no command).
prompt__elapsed_time="$(printf '%s - %s\n' "${EPOCHREALTIME}" "${prompt__start_time}" | bc)";
fi;
## Imitate IBM z/VM's CMS (partly: the latter prints user time and system time):
printf 'Ready(%s); E=%.2f s %s\n' "${s}" "${prompt__elapsed_time}" "$(date +%H:%M:%S)";
}
function prompt__set_time () {
if [[ "${BASH_COMMAND}" != "prompt__print_prompt" ]]; then
prompt__elapsed_time="";
prompt__start_time=${EPOCHREALTIME};
fi;
}
trap prompt__set_time DEBUG;
PROMPT_COMMAND=prompt__print_prompt;
In the #shell #functions I should have written years ago category...
function fedilinktousername {
grep -oE 'https?://[^/]+/@[^/ ]+' |sed -E 's|https?://|@|; s|/@|@|; s/(@[^@]*)(@[^@]*)/\2\1/'
}
function fediusernametolink {
grep -oE '(@[^@ ]+){2}' |sed -E 's|(@[^@ ]+)@([^@ ]+)|https://\2/\1|'
}
rld@Intrepid:~$ clipo
https://polymaths.social/@rl_dane/statuses/01KVJCAG6Y4C1KTGBDBECH2778
rld@Intrepid:~$ clipo |fedilinktousername
@rl_dane@polymaths.social
rld@Intrepid:~$ clipo |fedilinktousername |fediusernametolink
https://polymaths.social/@rl_dane
rld@Intrepid:~$
The mistake you maybe making is that you consider Firefox to be a browser.
A browser doesn't need hundreds and hundreds of Engineers to be maintained, a massive project with multiple use angles and cases does
Firefox does so many (bad) things you can almost consider it a mini operating system
A alpha level Operating System, riddled with security bugs
It's always fantastic to be able to go somewhere in dillo and just have fun, amazing yourself with a speed that pages load
Seriously, why didn't I put this in my ~/.bashrc like... YEARS ago? 😆
year=$( date +%Y)
month=$(date +%m)
day=$( date +%d)
So I DO love me some python, but I just want to say that #Bash is awesome.
I had no idea this was a thing:
echo "${variable/$inTheString/$replacesIt}"