In case you're passing over this because it sounds like click bait (it KIND OF is), this was actually a good read to me. It goes over a utility called "suc" (Simple Unix Chat) that implements server functionalities from Slack, Discord, etc. using a very small codebase. The novel part is it leverages existing unix tools and methodology instead of re-inventing them. - Auth is handled by SSH. - Channels are just a file…
"Append-only files" would be a great fit here: to ensure regular users and bots don't modify others' posts. Sadly this Plan 9 functionality is not ported to Linux yet. That's a permission bit, similar to "read" or "write", but even more specific.
Simple Unix Chat
131–140 of 175 posts
Re: Simple Unix Chat
#132Earlier quoted context omitted.
So what do you do when your customers say "this is great, when are you adding screen sharing"? Where do voice calls fit into this architecture, do we just add another UNIX util and stream the bits over SSH? Furthermore, debugging may be "easier" insofar as the units are discrete (though any good modular architecture will have the same advantage), but what do you do when you find a bug? If you're running a business, y…
You can't fix bugs in Slack so that seems hardly comparable. Screen sharing and video calls can be handled by other apps like Zoom, Google Meet etc.
Re: Simple Unix Chat
#133In general, composing Unix commands is a very powerful means to construct complex applications... poorly, with no real pathways to fixing their shortcomings. I believe the traditional "Unix Way" is to gloss over said shortcomings and pretend they don't exist, and when that fails, move the goalposts and argue that they don't exist "in the real world". For example, what combination of shell commands can I use to output…
|For example, what combination of shell commands can I use to output the number of files in a directory? Hint: it probably isn't what you think it is, if it's even possible. `find . -type f | wc -l`
touch foo; ln foo bar
Is this one file or two "links" to the same file? ;-0
Re: Simple Unix Chat
#134In general, composing Unix commands is a very powerful means to construct complex applications... poorly, with no real pathways to fixing their shortcomings. I believe the traditional "Unix Way" is to gloss over said shortcomings and pretend they don't exist, and when that fails, move the goalposts and argue that they don't exist "in the real world". For example, what combination of shell commands can I use to output…
Oh.
Then it must be:
command ls -F directory | grep -v '[/@]$' | nl | tail -n 1 | cut -f 1
(-:Re: Simple Unix Chat
#135In general, composing Unix commands is a very powerful means to construct complex applications... poorly, with no real pathways to fixing their shortcomings. I believe the traditional "Unix Way" is to gloss over said shortcomings and pretend they don't exist, and when that fails, move the goalposts and argue that they don't exist "in the real world". For example, what combination of shell commands can I use to output…
find . -type f -depth 1 -print0 | tr -d -c '\000' | wc -c
GNU find has a -printf which would probably avoid the need to use tr. Personally, two hardlinks to the same underlying storage counts as two files to me, but I understand why you might disagree. I'd bet there's something out there that could give you only the count of unique storage areas, but I don't know how that interacts with deduplicating filesystems.Re: Simple Unix Chat
#136https://thegongshow.tumblr.com/post/345941486/the-spawn-of-c...
ftp/rsync => Dropbox
suc => Slack
...Re: Simple Unix Chat
#137Earlier quoted context omitted.
|For example, what combination of shell commands can I use to output the number of files in a directory? Hint: it probably isn't what you think it is, if it's even possible. `find . -type f | wc -l`
Good first attempt. But: counts two links to the same file twice. That is: touch foo; ln foo bar Is this one file or two "links" to the same file? ;-0
Re: Simple Unix Chat
#138Earlier quoted context omitted.
Good first attempt. But: counts two links to the same file twice. That is: touch foo; ln foo bar Is this one file or two "links" to the same file? ;-0
You said files, not inodes. Those are two files sharing one inode. If you want to count inodes, specify that in the question.
Re: Simple Unix Chat
#139Re: Simple Unix Chat
#140Chapter 8 of The Linux Programming Interface mentions that applications running on Linux have basically 2 options for authentication: * Roll it themselves, maintain the database and all that jazz * Delegate it to the (very robust, very mature) Linux user authentication stuff Ever since reading that I've found myself wondering why more apps don't simply use SSH keypairs for authentication, given that they're already s…