Masthash

#POSIX

Felix Palmen 📯
17 hours ago

@alelab @stefano @Anniiii my 2¢ here (actually, indeed two remarks):

1. What's "wrong" with #csh is it's a non-standard shell, many things work differently than in a #POSIX-compliant (bourne) shell, sometimes in subtle and surprising ways. For me, this is just unnecessary friction, you'll always use a bourne shell for scripting, and I want my interactive shell to work exactly the same (plus extensions of course). Regarding this, #fish is even worse, while #zsh by default is (almost) #POSIX-compliant, can emulate a lot (including #csh) and is comfortable by extensions.

2. #FreeBSD offers "toor" as a second name for "root" with its own entry in the passwd database. If you activate it (by setting a password), you can change the shell of *one* of the accounts safely, as long as the *other* one keeps having the default shell from base.

:mima_rule: Mima-sama
2 days ago

Introducing Momiji: a Gopher interface for Fediseer!

gopher://geidontei.chaotic.ninja/1/usr/mima/momiji/

Since the official web GUI of
#Fediseer requires JavaScript (seriously what's up with that, is this a Lemmy thing lol :P), I thought I'd write something that uses Fediseer's API, and the interface wouldn't need JavaScript to be loaded from the website and can be viewed by any plaintext-friendly client. So I settled with #Gopher! ​:alice_wine:​

Currently you can only lookup some basic information per instance, and see all domains which they have endorsed, censured, hesitated, and guaranteed (and vice-versa) in a pure plain text format. I might write an interface for the whitelisted, suspicious, censured, and hesitated lists of instances too, but I'm not promising anything. :P As it stands, this simple Gopher CGI fits my needs for now.
​:kokoro_yes:​

Logging in with your
#API key is not supported (probably a bad idea anyway due to Gopher typically being unencrypted ​:satsuki_sadge:​), so you won't be able to see some domain lists of instances that have restricted the viewing of endorsements/censures/hesitations they give, or modify anything in Fediseer.

It's all written in
#POSIX #shell script, with the dcgi currently written with #Geomyidae's gophermap format in mind. You can see the source code (which you can treat as being in the public domain) in the URL I've given. Warning: It's pure shell script cancer! ​:kyou:​

@fediseer@lemmy.dbzer0.com

Screenshot of pony.social's page in Momiji, with Nazrin/OverbiteFF as the Gopher client. Note the missing "Endorsements given" link; that's because they have restricted its visibility to the public, therefore it wouldn't be any use producing a Gopher item for it.
Screenshot of lemmy.dbzer0.com's page in Momiji, with Nazrin/OverbiteFF as the Gopher client. The "Censures received", "Censures given", "Endorsements received", and "Hesitations given" items are toggled.
Screenshot of makai.chaotic.ninja's page in Momiji, with Nazrin/OverbiteFF as the Gopher client. The "Endorsements given", "Hesitations received", and "Guarantees" items are toggled.
Screenshot of makai.chaotic.ninja's page in Momiji, with lynx as the Gopher client.

#flake but for pure eval 1
more on #nix paths
in #python [ I ve no love left for this thing]

from pathlib import Path
p = Path('~').expanduser()
print(p)

for #nix in perticular 2 5 ( tilde exapnsion is a #shell function and not OS f.)
#POSIX , for the standard sh mandates echo a=~ to output a=~ (while it mandates ~ to be expanded in a=~ alone).

#zsh however has a magicequalsubst option which you can use for ~ to be expanded after = even if it's not in assigments or arguments to the export/typeset... pseudo-keywords. 3

Malinux
2 weeks ago

So I just managed to lose an hour because the #Gitlab CI lines are not #Posix compliant. Maybe I missed that in the docks. Maybe they thought it wasn't worth mentioning.

I felt that the error message 'unterminated quote string' could have been something more elucidating.

Ok i got my #Fish #FishShell completions running in #NuShell on #NixOS.
We will see if i adapt it as my daily driver, since i hardly use #posix stuff anyway.
If you were struggling like me to configure the completions with #HomeManager, let me know and i will share the config tomorrow.

Skye
2 weeks ago

Does anyone want to know what I'm working on rn? Probably not, anyway
So yea, my current main project is this 'small' osdev project, to make something I'm terming "SynOS" (if you are fairly close to me and were also fairly close in april/may you'll know what the root of that name is)

This is made up of a couple of parts:
- Azuma:
Azuma is the kernel of this OS, and I'm designing it to be a pure microkernel, which currently is targeting ARM64 (aarch64, w/e), this is the part I've done all of the work up until now on. Naming wise, I stole the name from LNER Azuma (who could've guessed) for basically no reason other than it looking and sounding cool lol - maybe one day I can say that I called it that because it's supposed to be fast or smth but now is not that day. One key design point with this kernel is that, to allow it to function as a pure microkernel, it handles "permissions" on processes, which is essential for drivers. This should also make it more secure, since a driver can't go rogue and start accessing the FS if it only has permissions to talk to, say, the USB bus
- Userspace:
This is, well, the userspace, but operates using the permissions that I mentioned earlier. Hopefully I can make this fully POSIX compliant cos that just makes things easier development-wise (not for me tho
😅)

Anyway, I might post updates about this every so often, and here's the link to it:
https://codeberg.org/ExoSkye/SynOS

#osdev #aarch64 #arm64 #posix #microkernel #synos #azumakernel

Filip
2 weeks ago

Hear me out: #NuShell but #posixCompliant.

Jokes aside, there are so many #Posix non-compliant #shell implementations that are so cool, but almost any #shellScript expects a compliant env. It also does not seem to be too appealing of a skill to any employer :blobsad:

Anything out there like what I described that I'm missing maybe?

illiliti
3 weeks ago

Is there a way to get username from uid using only #POSIX utilities? If no, I'll think about sending a proposal to POSIX to add a new flag to id for that.

Todd A. Jacobs, CISM CISSP
3 weeks ago

@prstntrnr @postmodern This is likely specific to the #RubyLang implementation of character classes. If it's an actual #POSIX character class then it won't match, but Ruby tunes a lot of things under the hood so even if it supports this, it fails to communicate programmer intent properly.

Todd A. Jacobs, CISM CISSP
3 weeks ago

@postmodern I think there are still issues with the upstream emoji property in the #RubyLang regexp engine, but the general support for #Unicode when using character properties rather than #POSIX character classes is pretty amazing! Good call out.

LSM provides hooks only for access control
Systems like #grsecurity and RSBAC 1 need >just access
control. in Implementations like #AppArmor , LIDS 2 , #POSIX capabilitites ,Smack 3 ,TOMOYO 4 ,#SELinux, Stacking multiple security modules is problematic , LSM hooks expose kernel internal data structures as parameters, #Ethos is running inside the Xen Virtual Machine Monitor #VMM
#Xen Dom0 OS is typically Linux. #Virtualization allows to run Ethos alongside Linux. 4

when Dom0 receives a packet destined to an Ethos host, its routing/ARP tables allow it to deliver packet correctly.

(1) request was received on interface n’s partition,

(2) target address belongs to a host that exists on an interface
other than n.
(3) ensure Dom0 has ARP table entries for each Ethos host.

#Ethos immediately sends a packet to shadowdæmon upon booting, and shadowdæmon uses this
packet to update Dom0’s static ARP table
when Dom0 receives a packet destined to an Ethos host, its routing/ARP tables allow it to deliver the packet correctly.
e fileInformation system call is interesting in that Ethos supports file metadata typically
not present on Linux. Here shadowdæmon makes use of Linux’s getxattr/setxattr system calls
to store Ethos metadata along with the files it describes. Shadowdæmon is also responsible for
providing Ethos with random data using a Random RPC.
. Shadowdæmon is also responsible for providing Ethos with random data using a Random RPC
Ethos offers distributed types in the Etypes subsystem:
A notation, ETN, for specifying types, a machine-readable type description (“type graph”), A single wire format (ETE), Tools (userspace and kernelspace) to transform ETN into code that will encode, decode, and recognize types,Extensions to read and write system calls to check input and output,Programs specify what input types they allow,Validity of input (and outputs) enforced by OS
#Kerberos was motivated by the transition from single, time-sharing systems to distributed
networks of workstations
a Kerberos installation is made up of two services: an authentication service and a Ticket Granting Service(TGS).
X.509 added a graph-based trust model to its traditional hierarchical model [94], but
its design imposes a high performance overhead. SDSI [95] also provides a strong trust model,
but likewise does not perform well at Internet scale. Another alternative is the web of trust
used by #PGP
#SSH attempts to isolate private keys by protecting them
#Multics provides a hierarchical filesystem that is governed by access control lists. Processes
serve as subjects and can access objects in the storage system. Each subject has associated
with it a value called a principal identifier, which corresponds to the user on whose behalf the
process runs. Each object in the storage system has associated with it three modes, read, write,
and execute. For each mode, there exists a list of principal identifiers that may access the object
using the mode.
likewise #Unix authorization traditionally has been discretionary.
#Factotum acts as an authentication proxy.
Consider a POP email server that must implement the APOP authentication protocol. On
Plan 9, such an email server would receive requests from the network and process them. In the
case of authentication requests, the email server forwards the request to factotum. Factotum
then provides the email server with the response it should pass to the client. Never in this process are keys shared with the email server.
#HiStar’s flow controls contain effect of a compromised app , serving as a countermeasure to one of the facets of application based subversion. Even if an app is compromised, it cannot bypass the flow controls that HiStar imposes on it. bu An app that operates within its information-flow constraints could easily be programmed or misconfigured so that protections are missing.
on traditional Unix systems, still remain with HiStar’s Unix layer

orbifx
4 weeks ago

@der_istvan

I like https://en.cppreference.com/w/c

The standard #C library is minimal compared to other languages. The rest is filled by #POSIX, OS extensions and third-party libraries.

@mrtnsnp

Jamie Magee :unverified:
1 month ago

Long time user of #FishShell, but #NuShell is very tempting!

#POSIX #Shell #CLI #CommandLine

em
1 month ago

guys does #bash and #posix systems support emoji as filenames and functions ?

i wanna know if i can
> sudo 🎣 -f /etc/🌊/🐟 -o /usr/🪣

#salmon #drake #unix

John-Mark Gurney
1 month ago

@alfonsosiciliano

Is there a reason you didn't use syscall.master to parse instead? (Or maybe you did and the blog is slightly wrong?)

https://cgit.freebsd.org/src/tree/sys/kern/syscalls.master

#UNIX #POSIX #BSD #FreeBSD #coding #C #Opensource #OS #kernel #syscall

1 month ago

About locales and standards (e.g. environment variables LC_*), a rant:

https://github.com/mpv-player/mpv/commit/1e70e82baa9193f6f027338b0fab0f5078971fbe

#posix

Bahman M.
1 month ago

#TIL When in doubt about #POSIX compliance of a command, just use #Perl FTW.

Example: Asking `date` to produce nanoseconds doesn't work on #MacOS w/o #GNU coreutils installed.

So I simply switched to `perl -MTime::HiRes` and, well, problem was solved!

#programming #linux #devops #sysadmin

Markus Osterhoff
1 month ago

#ClearScreen in #ANSI #C with #POSIX:

printf("\e[1;1H\e[2J");

bit more complicated that the old

PRINT CHR$(147)
for the #C64, isn't it?

But still less bloat than including #ncurses

Kazinator
1 month ago

People #programming on #POSIX : do you know that there is an easy way to port programs to #Windows with native behaviors in key areas?

https://www.kylheku.com/cygnal/

#Cygnal is a slight fork of of the main #Cygwin DLL. When you slide it under a program built under Cygwin, you get a native Windows program you can redistribute.

Cygnal gets rid of /cygdrive and understands paths like C:\Users\bob. And other changes, which are documented in detail with links to git commits.

David Egts
2 months ago

"As the name implies, #smolOS is a small [#POSIX-like] operating system — small enough to run as a #MicroPython program on the low-cost Espressif #ESP8266 #microcontroller family" https://www.hackster.io/news/krzysztof-jankowski-s-micropython-based-smolos-puts-a-tiny-posix-like-environment-on-your-esp8266-0c776559152b

I had a long conversation with @requiem and he helped me be OK with admitting this to myself and others.

I think #POSIX sucks and we could do better if we moved on from it.

Matthew Slowe
2 months ago

Q: In your #POSIX compliant shell of choice, what #SpiceGirls song would be thinking of when combining stderr into stdout?

#GeekJokes #TerribleJokes

A: 2 Become 1

Rocky the Girl 🏳️‍⚧️
2 months ago

Using the shred utility from coreutils. This should take no time at all, right?

#posix #gnu #coreutils #archlinux

🕹️ jbz
2 months ago

「 The BSD portion of the OS X kernel is derived primarily from FreeBSD, a version of 4.4BSD that offers advanced networking, performance, security, and compatibility features. BSD variants in general are derived (sometimes indirectly) from 4.4BSD-Lite Release 2 from the Computer Systems Research Group (CSRG) at the University of California at Berkeley 」

https://developer.apple.com/library/archive/documentation/Darwin/Conceptual/KernelProgramming/BSD/BSD.html

#MacOS #FreeBSD #BSD #POSIX

Those who edited files on VT -200 at low baud rate
#posix

#POSIX spec still distinguishes between visual mode editors and line editors. This really mattered back in the days when cursor positioning over serial connections was hard (especially because of the speed of the serial connection).
https://unix.stackexchange.com/questions/4859/visual-vs-editor-what-s-the-difference/334022#334022

Linux Is Best
2 months ago

Did anyone know that posix does not like:

mkdir -p -m 755 /opt

I didn't know that. I learned something new today. Unless this validator is flawed (see URL) https://www.shellcheck.net

I needed to break it up to validate.

# Create /opt directory if it doesn't exist
mkdir -p /opt

# Set permissions for /opt
chmod 755 /opt

#POSIX #Bash #Code

Ben Clifford
2 months ago

Time to do battle with The Shared File System

#posix #performance

Ivan Enderlin 🦀
2 months ago

Testing sudo-rs and improving sudo along the way, https://ferrous-systems.com/blog/testing-sudo-rs/.

sudo-rs is a re-implementation of sudo in Rust. While testing sudo-rs, they have found several inconsistencies in the specification, and found 2 bugs in the original sudo implementation.

This test suite can run on both implementations.

Link to sudo-rs: https://github.com/memorysafety/sudo-rs.

#sudo #posix #unix #test #safety #security #RustLang

Vida Informática
2 months ago

Sabias que para el 19-01-2038 a las 03:14:07 (UTC) los contadores de la hora en sistemas POSIX de 32 bits llegara a su limite? Luego de eso, estos contadores se reiniciarían volviendo al año 1901. Puede traer problemas en maquinaria pesada, sistemas embebidos, aviones y muchos componentes. Por esto se tienen que actualizar a sistemas de 64 bits, retrasando este problema.

#VidaInformatica #Informatica #sistemas #32bits #limite #software #posix #64bits #linux #windows #unix #tecnologia

Paolo Redaelli
3 months ago

@nixCraft AFAIK
#Busybox were created to slim down disk occupation of basic #POSIX commands and it achieved this design goal very efficiently.
#Systemd has some controversial design choices but as others has already pointed out when used wisely is a good tool

mort
3 months ago

Does anyone know how you get `sort` to work the same on #Linux and #macOS? (and ideally other #POSIX / #UNIX like platforms)

Should `sort -f` to case-fold be enough? That seems to at least exist in both macOS and Linux.

I feel like ideally, I'd just have it sort "ASCIIbetical" order, i.e sort based on the byte values, like what `strcmp` would do. But there doesn't seem to be a standard flag for that.

I'm super impressed with `a-Shell` and `a-Shell mini` for #iOS. Having a POSIX shell environment on my iPad is amazing.

Several shell scripts I authored on my iPad using a-Shell's port of dash shell in POSIX mode worked as-is (sans the shebang line) when I ran them in bash on my Mac Mini.

🔜 trying out the #lua and #perl ports

https://holzschu.github.io/a-Shell_iOS/

https://github.com/holzschu/a-shell

#POSIX #Unix

[1] also:impressed "and by extension I'm impressed with WebAssembly. Wow."

mort
3 months ago

TIL: If you write to a closed socket in #posix, your process receives SIGPIPE, whose default action is to kill your process.

Why???? The write() call communicates failure by returning 0 or -1 or whatever. Does it really need to also abort the process?

@benjamineskola @unfortunateshort @josephholsten @fuchsiii I mean, I know that #zsh is seen as more or less "the best #POSIX #sh compatible shell there is"...

I think #fish really shines at the user experience when interacting directly with it.

@nixCraft that is actually true...

Unless someone provides a program with #root #privilegues it can only mess up the $HOME of the user account which it runs under.

This is why the default config for servers like #Apache and #PostgreSQL to literally be run as #daemons or rather #systemD services under dedicaded user accounts, so a webserver - even when hacked - can't f**k up the system.

It's part of the #KISS-Approach to #Users and #Groups in #POSIX and is supplemented with #AppArmour...

@machine so basic #POSIX-alike restrictions...

JdeBP
3 months ago

@snonux

Strictly speaking, the "silly things" example is wrong.

A double slash at the beginning of a pathname had a special meaning on some 1980s #Unix systems, and it was reserved with implementation-defined behaviour by #POSIX/the SUS.

A modified example with (say) /.////////etc///// would have avoided involving this extra wrinkle.

For those who use git and are tired of remembering the difference between POSIX regular expressions and Perl regular expressions:

git config --global grep.patternType perl

#git #regex #perl #POSIX

JdeBP
4 months ago

@leah @cks

In other popular non-SUS commands news there are jot, ifconfig, dnsqr, stat, fetch, less, and clear.

Do you think that the fgrep purists ought to not clear their screens, too? (-:

Or use any other name for their compiler than c99? (-:

Or be required to use only od to view non-text files? (-:

#POSIX #Unix

JdeBP
4 months ago

@cks

This is a perennial stupidity in the C and C++ worlds.

Because the C and C++ standards leave some things up to _other_ standards, including (ironically) #POSIX, the idea that one shouldn't talk about them in the comp.std.c and comp.std.c++ newsgroups mutated into a stupid dogma that C and C++ programs shouldn't rely upon anything from these other standards.

#fgrep and #egrep are in the SVID. (-:

#GNU #grep #Unix

🕹️ jbz
4 months ago

🤡 How NOT To Implement the POSIX Standard, Featuring Windows NT ...
@ncommander

#Microsoft #Antitrust #WindowsNT #POSIX
https://m.youtube.com/watch?v=BOeku3hDzrM&feature=youtu.be

Toasterson
4 months ago

Everybody: POSIX is to complicated we need Docker!

Later: Docker is to complicated we need WASM!

Now: WASM has not enough power we need #POSIX^H^H WASIX

https://wasmer.io/posts/announcing-wasix

Good old things go away last.

@antondollmaier or just use #Unixtime ffs since date %s provides that on basically all even remotely-#Posix compliant platforms.

scy
4 months ago

Oh wow, TIL: When you do input redirection from a file in #bash, e.g.

python whatever.py < foo.csv

the running command can actually stat() the stdin file descriptor and get the size of the input file! I would’ve expected that it’s more like “well, it’s your stdin, you can’t get the size for that, it’s a stream”.

And, to be fair, if you don’t directly associate the file to the command, it breaks. For example,

cat < foo.csv | python whatever.py

won’t supply a size.

#Unix #Linux #POSIX #shell

What's a useful way to get a inter-process time source?

My goal is to get the time when a packet was received in one process, and then once it was sent over to a second process I want to be able to know how long ago it was originally received.

Using the wallclock for that seems not very useful because that can be adjusted.

Is it, for example, guaranteed that the monotonic time returned from POSIX clock_gettime() is comparable in different processes?

I need a solution (or one per platform) that works on at least Linux/Android, *BSD, Windows, macOS.

Thanks for any pointers!

#Programming #Time #Clocks #Linux #Windows #POSIX