Earlier quoted context omitted.
OK, for starter the while loop. Main rule of writing shell scripts is, Use The Shell, Luke. Don't start external programs, if your shell (which is already running) can do it. "while /usr/bin/true" is nonsense, every time an external program gets executed for nothing. There are plenty of bash (since this shell is used in the example) internals, which evaluate to true, like ":", "test 1", "(( 1 ))", maybe others too. S…
Thanks for the pointer about the useless use of true. Using builtins may be a security risk as they can be overloaded (hence the use of full paths everywhere). I did not know about bash's extension of printf to print a date. I need to use the builtin to use it though. But I've received good advice elsewhere on how to do that securely, so I'll do it and do a write-up because it's not information that's easy to come by…
Simple Unix Chat
161–170 of 175 posts
Re: Simple Unix Chat
#162Earlier quoted context omitted.
I couldn't make talk or wall work on a modern linux system. That's a shame.
Just a few years ago in university the lab computers were running debian 10 and the sysadmin would make announcements about linux-specific infra outages through a script that ssh'd into every machine and wall'd the outage message. We would often get people using lab computers remotely and you could talk or wall them to tell them you were rebooting soon. Good times.
Disclaimer: Have a "The Wall" account somewhere. What goes around, comes around ..
Re: Simple Unix Chat
#163Unfortunately I don't see any real way to avoid suid here, otherwise neat experiment. Posix ACLs might help, but the crucial part is prefixing the username to the message which requires privilege Lots of unix facilities are criminally underutilized in modern systems
Run a daemon with the right userid to do the writing, and have it make a pipe device for each user to write lines into. I don't know how much effort is meant to be put into securing this from impersonation, but info can be pulled out of /proc/ if the permissions are set up right.
Re: Simple Unix Chat
#164Earlier quoted context omitted.
If we really wanted MFA, we could roll a PAM module, and whatever pushes SSH authorized keys could also push MFA seeds. But IMO this would protect against very unusual attacks and annoy ssh agents users everywhere.
Doing MFA for ssh like that would satisfy some compliance issues, wherever that matters. Probably key+pass.
Re: Simple Unix Chat
#165I think the intuition would be that if a determined "core" feature set of something is so easily and trivially reproduced, then it's not the core/source of its value. Which makes me wonder: Just how much of UI development had software engineering had consumed and automated since 1980s, or is it still in the realm of pure human art?
This is correct. The core value-add of e.g. Slack is not actually "transmit messages between authenticated users." There were dozens of other applications, both commercial and open source, that already did exactly that when Slack came out and killed them all off. The core value proposition of Slack is next-level beyond that: it adds a visually appealing, highly intuitive UI/UX that almost anyone can sit down and imme…
And yet, there were dozens of other applications doing exactly that (Slack is a list of channels on the left, and the text of the channel in the center).
Re: Simple Unix Chat
#166Well, yeah, if I use a bunch of other programs to do a bunch of stuff, and then don’t include those lines in my total I can get pretty far too.
Re: Simple Unix Chat
#167What options are there and what are your experiences?
Re: Simple Unix Chat
#168Earlier quoted context omitted.
You said files, not inodes. Those are two files sharing one inode. If you want to count inodes, specify that in the question.
I'm not the one who posed the question. And: file, filename, inode, ...? What's what and what's exactly to be counted?
I think of it like an old-timey 'card catalog'. You have a bunch of tiny drawers filled with cards. Some of the cards are big and blank spacers with a prominent tab sticking above the normal top edges (Directory). Sometimes you have a card that points to another card elsewhere in the catalog (link). Sometimes you find the details of a specific book on a specific shelf (block data).
Point is, they are all cards. The comment essentially asked for a command to say 'how many cards between these two spacers'. It's a "trick" question as old as usenet to spring the distinction between link inodes and list of blocks inodes and say "Ah-HAH!! gotcha", but in reality it's a silly game of jumping levels, misdirecting semantics and prey upon the distribution of understanding in a forum for personal glory.
The inode is the item, it is the card that is being counted, no matter what is printed on it. imho.
Re: Simple Unix Chat
#169We all know "suc" is merely a tongue-in-cheek thought exercise. :) Good luck getting 100's of millions of Twitter/Bluesky/Threads users to even use Mastodon.
Nobody but geeks can use "suc", Mattermost can be used by a far larger proportion of people.
Good recently posted HN-linked article about how most users have a lot less skill than you think: "The Distribution of Users’ Computer Skills: Worse Than You Think": https://www.nngroup.com/articles/computer-skill-levels/
Re: Simple Unix Chat
#170This is different but I'm surprised it doesn't mention talk(1) https://man.netbsd.org/talk.1