Just in case Clownflare throws a couple of 5xx errors at your requests, I’m rebooting. See ya in a couple of seconds!
In fact I recommend this really, it’s just less “mucking around” and what we call “zero configuration”.
@off_grid_living@twtxt.net If you’d like to try something new (I know I know!); I just modified your site’s file a teeny weeny bit and got it working with FrankenPHP a nice little portable web server written in Go that “just works”™ that is able to handle and execute PHP for you and your site basically “just works”™ out of the box locally, run from any directory.
I mean if you didn’t really need PHP (I suspect you do?) you could run any ‘ol web server in the current directory where you have your site and just serve that straight up locally.
@off_grid_living@twtxt.net Normally, in the days when I used to run Linux on the Desktop and used Apache once upon a time, the default configuration would mean files served out of your public_html
directory in your home directory was the place where the web server looked for to serve files from. This would make something like http://localhost/~your_username work. But it’s been a while since I’ve done any of this myself…”
Dear OnlyDomains, part of Team Internet. Do you think you could stop being so incompetent when it comes to Domains, DNS and basic HTTP? I reported this to you on Friday, and you are still arguing with me over Support the legitimatecy of the claims? Seriously?! 😧
$ dig @1.1.1.1 +short onlydomains.com.au a
198.50.252.65
$ nc -vvv 198.50.252.65 443
nc: connectx to 198.50.252.65 port 443 (tcp) failed: Connection refused
Lucky you, @prologic@twtxt.net. Yeah, sounds like it. :-D
All sky covered in clouds, except to the East. No chance of witnessing the stars shooting around. Still 25°C. Bah.
And errors out expectedly using dash
or ash
, very nice POSIX Sh compliant shells:
$ ./foo.sh
./foo.sh: line 5: [: bar: integer expression expected
So the lessons here are twofold:
- Always use
shellcheck
to check your shell code
- Never use Bash or rely on Bash(isms). Always prefer POSIX Sh
Interesting! https://publicholidays.com.au/royal-queensland-show/ Enjoy your day off, @prologic@twtxt.net!
Which once fixed, removing the extra [
and ]
errors out with shellcheck
as expected:
Invalid number for -eq. Use = to compare as string (or use $var to expand as a variable). [SC2170]
I was/am right of course :D
In POSIX sh, [[ ]] is undefined. [SC3010]
Also, why isn’t shellcheck
being used here? It would have picked this (contrived) example up?
bar is referenced but not assigned. [SC2154]
@movq@www.uninformativ.de It did however rain all night here however 🤣 Perhaps they were right afterall, just wrong on the location? 😅
What a glorious morning for a public holiday 💪 What shall I do today? Hmmm 🧐
@movq@www.uninformativ.de I’m not looking forward to summer at all 🥵
@lyse@lyse.isobeef.org Probably used one of the filters? 🤔
This is why you stick to POSIX sh as @mckinley@twtxt.net points out 🤣 Prwtry sure this is a “Bashism” right?
@movq@www.uninformativ.de Same here. Nothing. Malicious deception!
This one got me. I try to stick to POSIX sh so I’m not super familiar with the behavior of [[]]
. I definitely should have gotten -eq
, though.
They promised rain. I ain’t seeing any rain so far. 🫤
@rrraksamam@twtxt.net So ready for winter. 🥵
@falsifian@www.falsifian.org Exactly! 🥳
So this works:
$ bash -c 'set -u; bar=1; foo=$bar; if [[ "foo" -eq "bar" ]]; then echo it matches; fi'
it matches
Without the misleading quotes:
$ bash -c 'set -u; bar=1; foo=$bar; if [[ foo -eq bar ]]; then echo it matches; fi'
it matches
As does this:
$ bash -c 'set -u; bar=1; foo=$bar; if (( foo == bar )); then echo it matches; fi'
it matches
What the person originally meant was what bender said:
$ bash -c 'set -u; foo=bar; if
@bender@twtxt.net Haha, no worries. I do like that you enjoyed your real life and not wasted it online. :-)
But I’m wondering how you discovered it a week later. Are you somehow regularly checking complete recent feed histories?
on_grid_living
. 😛
@bender@twtxt.net Hahaha, that’s a good one! :-D
Ready for Winter
@bender@twtxt.net @movq@www.uninformativ.de That’s a pity! :-( In the following half an hour, I only saw two more right of Ursa Major (the only constellation I recognize). Let’s see how cloudy it actually will get tonight. The forecast to be clear sky between 1 and 3am. But that’s a bit late.
@movq@www.uninformativ.de Variable names used with -eq in [[ ]] are automatically expanded even without $ as explained in the “ARITHMETIC EVALUATION” section of the bash man page. Interesting. Trying this on OpenBSD’s ksh, it seems “set -u” doesn’t affect that substitution.
yeah its the same dude.
This project is verrrry alpha. all the configuration is literally in the code.
@bender@twtxt.net So far, so good! And why did it complain about bar
being a variable?
@movq@www.uninformativ.de @bender@twtxt.net That’s what I thought while reading the code, too. I believe -eq
is for numerical comparation only. Weird error message, though. Tells something about the implementation.
@movq@www.uninformativ.de it should be:
bash -c 'set -u; foo=bar; if [[ "$foo" = "bar" ]]; then echo it matches; fi'
eq
is for numericals.
I love shell scripts because they’re so pragmatic and often allow me to get jobs done really quickly.
But sadly they’re full of pitfalls. Pitfalls everywhere you look.
Today, a coworker – who’s highly skilled, not a newbie by any means – ran into this:
$ bash -c 'set -u; foo=bar; if [[ "$foo" -eq "bar" ]]; then echo it matches; fi'
bash: line 1: bar: unbound variable
Why’s that happening? I know the answer. Do you? 😂
Stuff like that made me stop using shell scripts at work, unless they’re just 4 or 5 lines of absolutely trivial code. It’s now Python instead, even though the code is often much longer and clunkier, but at least people will understand it more easily and not trip over it when they make a tiny change.
@slashdot@feeds.twtxt.net And we are surprised why? 🤔
@lyse@lyse.isobeef.org for some reason I didn’t see this here on time. Thank you much mate! 😊
Woot! Need to change the nick now to on_grid_living
. 😛
Is that from the same guy who made Caddy? Name sounds familiar. It looks neat, let us know what you think of it when you have tried it. 😛
Jobhunters Flood Recruiters With AI-Generated CVs
About half of all job seekers are using AI tools to apply for roles, inundating employers and recruiters with low-quality applications in an already squeezed labour market. From a report: Candidates are turning increasingly to generative AI – the type used in chatbot products such as ChatGPT and Gemini to produce conversational passages of text – to assist them in writing th … ⌘ Read more
@lyse@lyse.isobeef.org Neato! Too bad they’re in the northern sky. Can’t see that from my bedroom. 😂
En cherchant des illustrations #solarpunk pour mes cours, je m’aperçois que c’est encore difficile à trouver
@bender@twtxt.net No bubbles burst 💥 hehe 😝 All good! 👍 I think I was aware of the search results and the lack of interactivity there, artifact of borrowed template code from the search engine 😢 Just need to refactor it to use the same template as the normal timeline, but also support highlights, something it doesn’t do now either.
@prologic@twtxt.net I didn’t mean to burst bubbles, by the way 😅. It is a baby step; we just need to refine it.
@bender@twtxt.net You are right. I’ll have to fix the later for sure, the finding “reading” in “foo-reading” is probably a behavior of the indexing and search library being used. It probably behaves that way.
@lyse@lyse.isobeef.org I envy you. Our always cloudy sky during summer has allowed me to see the grand total of zero. 😩
@prologic@twtxt.net couple of issues. That #reading tag also pulls #now-reading. It shouldn’t. Second, I can’t reply from the search results. If you click/tap on the tag, and get the list containing it, clicking/tapping reply on one of the results do nothing.
I like how tags like #reading now actually work correctly on Yarn pods 👌
Morphotrophic by Greg Egan is built around an idea for how life on Earth could have worked out differently. It gets increasingly strange and interesting as the story progresses. My partner and I finished it last night and thoroughly enjoyed it. The beginning is free online: https://gregegan.net/MORPHOTROPHIC/00/MorphotrophicExcerpt.html #scifi #reading
Heck yeah, I already saw three shooting stars in 10 minutes. Perseids are awesome! :-)
@johanbove@johanbove.info Allegedly it’s supposed to cool down mid-week, yeah. If we consider ~28°C “cool”, that is. 😅
Fan = Miefquirl. 😏
Kinda cool tool for bringing together all your timeline based data across socials.