3 ms·
Cool project, I wish we had more GUIs for these OS functions. How was your experience with GTK4 and Rust? And it's a bit sad that in the year of our lord 2025,
by BoppreH 11mo ago
Cool project, I wish we had more GUIs for these OS functions. How was your experience with GTK4 and Rust?
And it's a bit sad that in the year of our lord 2025, the best way to get such fundamental information is by using regexes to parse a table[1], generated by a 6000-line C program[2], which is verified by (I hope I'm wrong!) a tiny test suite[3]. OSQuery[4] is also pretty cool, but it builds upon this fragile stack.
That's something I miss from Windows, at least PowerShell has built-in commands that give you structured output.
[1] https://github.com/grigio/network-monitor/blob/9dc470553bfdd9e4690e38f8b170a306fb461eba/src/services/network.rs#L24 https://github.com/grigio/network-monitor/blob/9dc470553bfdd...
[2] https://github.com/iproute2/iproute2/blob/main/misc/ss.c https://github.com/iproute2/iproute2/blob/main/misc/ss.c
[3] https://github.com/iproute2/iproute2/blob/main/testsuite/tests/ss/ssfilter.t https://github.com/iproute2/iproute2/blob/main/testsuite/tes...
[4] https://osquery.io/ https://osquery.io/
- typpilol 11mo agoI am in the process of building myself a cross platform GUI for network monitoring. Simply because I need one for non-critical stuff and things like uptime robot are enterprise geared and too expensive for me to entertain. I wish there was an uptime robot for like 25 cents a monitor a month.
- tuergeist 10mo ago@typpilol And you'd like to pay from credits or on a pay-per-use basis?
- arcanemachiner 11mo agoUptime Kuma is FOSS, not sure if it is missing any features you might be expecting. Very easy to set up as well. https://github.com/louislam/uptime-kuma https://github.com/louislam/uptime-kuma
- tuergeist 10mo agoAnd you'd pay those 25ct/month? on a credit points base or per use?
- simoncion 11mo ago> It's a bit sad that [we're parsing output] ... generated by a 6000-line C program[2] ... > That's something I miss from Windows, at least PowerShell has built-in commands that give you structured output. It sure is something to disparagingly point to the LoC of 'ss' in one sentence, then pine for both PowerShell and the Windows infrastructure that supports it in the next. You mentioned processing the output with regexes. That's definitely a code smell, but this is one line of the data from the 'ss' command in question, with fancily-aligned header line included, but with vast tracts of whitespace removed. The regex you pointed out is processing the column whose comma-separated data is enclosed in parens: Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port Process tcp LISTEN 0 666 [::]:22 [::]:* users:(("sshd",pid=1337,fd=7)) ino:1338 sk:2024 cgroup:/openrc.sshd v6only:1 <-> They definitely didn't have to use a regex to process that, but chose to. You could argue that a system that let you write client code that goes something like socket[i].process.users[0].cmd, socket[i].process.users[0].pid, socket[i].process.users[0].fd is superior to one that requires writing something that makes use of the moral equivalent of 'cut'. I'd argue two things, one of them informed by my professional experience with PowerShell 1) What happens when the "structured" data you rely on changes shape? When that system that produces that "structured" data changes 'users' to 'user_list', 'cmd' to 'local_command', or deletes 'process' and moves 'users' up into its place, you're just as screwed as if 'ss' changed its output format in a way that wasn't backwards-compatible. 2) The core Microsoft tools might all produce "structured" data, but -in my professional experience- so, very, very little "community-provided" PowerShell code does. Why? I don't know for sure, but probably because it's notably more difficult to make a script or library produce that sort of data than it is to just emit regularly-formatted text.
- rickydroll 11mo ago> And it's a bit sad that in the year of our lord 2025, the best way to get such fundamental information is by using regexes to parse a table[1], Look at nutshell an see if that gives you what you are looking for https://www.nushell.sh/ https://www.nushell.sh/