ChanServ changed the topic of #kisslinux to: Unnofficial KISS Linux community channel | https://kisscommunity.bvnf.space | post logs or else | song of the day https://vid.puffyan.us/H7PvgY65OxA
phinxy has quit [Ping timeout: 264 seconds]
phinxy has joined #kisslinux
lanodan has quit [Quit: WeeChat 3.5]
lanodan has joined #kisslinux
<testuser[m]> Probably much faster to write it in awk
<testuser[m]> Hi
nullcoder has joined #kisslinux
<nullcoder> Hi
nullcoder has quit [Ping timeout: 265 seconds]
nullcoder has joined #kisslinux
<wael[m]> Hi
<virutalmachineus> <illiliti> "https://github.com/dylanaraps/..."; <- I just read sh bible and it change my life.
<wael[m]> illiliti: phoebos: phoebo's snippet ran 1% faster
<wael[m]> and then runs 5 times faster in some cases
<testuser[m]> Fake
<wael[m]> find ~/media/funny | longest-illiliti
<wael[m]> ignore that first mesage
<testuser[m]> wait does $(( do string comparison lol
<wael[m]> illiliti is using trentary or whatever it was called
<wael[m]> longest=$((len > longest ? len : longest))
<wael[m]> non-standard wc -L can do (on a stdin thats 491856 lines long) 480ms, while the shell will be 100000000% slower at 25 seonds
<wael[m]> i think ill stick to wc -L
<testuser[m]> Shell is slow as shit
<testuser[m]> No point in doing pure sh impl of anything unless the command to use is non portable
<testuser[m]> -L is non standard i think
<testuser[m]> Just write it in Awk
<wael[m]> i do not know awk testuser
<wael[m]> there is 'length > max_length { max_length = length; longest_line = $0 }
<wael[m]> END { print longest_line }
<wael[m]> which is about 20ms slower
zlg has quit [Ping timeout: 260 seconds]
zlg has joined #kisslinux
aelspire has joined #kisslinux
<wael[m]> why is kiss extracting a tarball incorrectly
<wael[m]> kiss fetching this tarball makes it only extract the src
<wael[m]> aka src/ directory
<wael[m]> but extracting with normal means gives the real result
<wael[m]> decompress() with normal means also gives the real result
<wael[m]> wtf is going on here
nullcoder has quit [Ping timeout: 260 seconds]
<wael[m]> testuser: can you recreate
<wael[m]> with that tarball and meson setup build should not error
<testuser[m]> wael[m]: That's a personal question
<wael[m]> ok hmmmmmmmm
<wael[m]> sh -x time
<wael[m]> yeah this is literally by design
<wael[m]> kiss assumes all tarballs have 1 root directory inside them
<wael[m]> and in this case the tarball does not have a root directory
<wael[m]> all the files are in the top level
<testuser[m]> Pretty sure this was fixed
<testuser[m]> Weird
<testuser[m]> I'll check
<wael[m]> kiss 5.6.4
<wael[m]> yeah looks like it wasn't fixed
<testuser[m]> I had the issue with chroma
<testuser[m]> Binary Randall
<testuser[m]> Tarball
<wael[m]> wen fix
<testuser[m]> never
<wael[m]> ok i will use
<wael[m]> 10 thousand bandwidth
<wael[m]> because of hyprland subproject
<phoebos> kiss only extracts directories in the top level
<phoebos> you need to ask the project to fix their tarball
<testuser[m]> how is it not a kiss bug tho
<wael[m]> phoebos: which is what i did
<wael[m]> but still this is sorta an inconvenience because kiss just doesnt check
<virutalmachineus> can we make to the switch to rust and call it riss?
<virutalmachineus> s/to//
<phoebos> because tarballs conventionally have everything under a dir which has the name of the project or something
<wael[m]> :thumbs_up:
<phoebos> tarballs with everything in the top are considered unfriendly
<phoebos> perhaps kiss could check if there's just one directory in the top level, then go into it, otherwise extract the top level?
<testuser[m]> ye
nullcoder has joined #kisslinux
nullcoder has quit [Read error: Connection reset by peer]
nullcoder has joined #kisslinux
<wael[m]> holy shit hyprland's meson and makefile shit is so fucking messy
<testuser[m]> hmm hotplug doesnt work with pipewire
<testuser[m]> illiliti: any clues for debugging?
<testuser[m]> it doesnt detect my mic unless i restart the service
sam_sepi0l has quit [Quit: Textual IRC Client: www.textualapp.com]
<illiliti> did it work before?
aelspire has quit [Quit: aelspire]
<midfavila> testuser[m]: shell is good for prototyping or commands that won't be used often, or that would be too cumbersome to write in C
<midfavila> also, update on fetch, feature parity with hurl has just about been reached
<midfavila> supports HTTP, TLS and Gopher atm
<midfavila> in 1/4 the lines of C and 1/2 the binary size :D
<midfavila> a lot of the former is redundant though, I need to write a couple of abstraction functions
<midfavila> HTTP response header stripping over TLS is also kind of buggy
<midfavila> but otherwise I've been using it as my primary file transfer utility over the past few days and there don't seem to be many implementation errors aside from what was already mentioned
<phoebos> :D do push it to your git server
<midfavila> will uwu
<midfavila> main is still kinda crappy, but it's also still beta-quality, so, meh
<illiliti> btw fetch is a terrible name
<midfavila> it's a great name
<midfavila> illiliti is a terrible name
<midfavila> >:c
<illiliti> there's already fetch available
<testuser[m]> illiliti: never tried it before
<testuser[m]> only once few months back
<testuser[m]> weeks*
<midfavila> yeah I saw it the other day
<testuser[m]> didnt work then either
<midfavila> a clojure library or whatever
<midfavila> idc about it
<illiliti> consider taking a different name before it's too late
<midfavila> that's lame
<midfavila> i wanted a fetch library of my own
<midfavila> thesaurus time
<illiliti> libfetch already exists too
<midfavila> yeah i saw
<midfavila> in the manpage
<midfavila> apportate it is
<midfavila> as usual, no claims about quality
<midfavila> oh but the makefile works this time so that's good i guess
nullcoder has quit [Ping timeout: 255 seconds]
<illiliti> buflen must be size_t
<illiliti> actually any *len must be size_t by convention
<illiliti> malloc+memset could be replaced with calloc
<midfavila> why? is size_t a more opaque type?
<midfavila> the calloc thing, fair enough. i don't use it very often so i keep forgetting it exists
<illiliti> because that's what malloc accept
<illiliti> using int you're imposing non-portable limitations
<illiliti> if(!strcmp("http", urip->proto)
<midfavila> fair enough i suppose, although none of gcc, tcc, or splint give me errors
<illiliti> i would not do this with strcmp
<illiliti> strcmp return value is int!
<illiliti> it isn't bool
<midfavila> bools and ints are functionally equivalent in C
<illiliti> !strcmp is actually confusing
<midfavila> not really
<illiliti> strcmp() == 0 is better
<illiliti> it makes things explicit
<illiliti> do not abuse C pls
<midfavila> i'm not abusing C
<midfavila> bools are literally a subtype of ints
<illiliti> you are missing my point
<midfavila> no, I get your point, I just disagree with it in this context
<midfavila> your other complaints were valid, but I'm not going to use strcmp() == 0 instead of !strcmp
<illiliti> it doesn't matter that bools are interchangeable with ints
<illiliti> in this case
<midfavila> the only time legibility would be impacted by that would be if you've never read the strcmp manpage
<illiliti> ok you want to obfuscate you code and make it more confusing, do it
<illiliti> oh it's not limited to strcmp
<illiliti> you are doing it everywhere
<illiliti> if(connect(sd, ainfo->ai_addr, sizeof(struct sockaddr)))
<illiliti> if( !(sd = socket(AF_INET, SOCK_STREAM, 0)))
<illiliti> this is wrong
<illiliti> 0 is a valid file descriptor
<illiliti> -1 is invalid
<midfavila> 0 should be reserved for one of the standard IO streams
<illiliti> no
<midfavila> but that's actually fair
<midfavila> considering it does deviate from spec
<illiliti> 0 can be closed
<midfavila> never is, and never should be
<illiliti> process can be started with 0 closed
<illiliti> it is possible
<midfavila> on what system, and how?
<illiliti> you can do it on your system
<midfavila> my understanding is that all processes start under a Unix environment with FDs 0, 1, and 2 reserved for standard IO channels
<illiliti> these can be closed
<illiliti> you just close them and start a process
<illiliti> that process will not have them
<illiliti> it is not good idea to assume that 0 is always present
<illiliti> especially doing that:
<illiliti> if( !(sd = socket(AF_INET, SOCK_STREAM, 0)))
<illiliti> 0 is valid number for file descriptor
<midfavila> i'll take it into consideration, but i don't think a sane individual would ever close 0, 1 and 2 before executing apport. if they do, there are bigger concerns than a failed socket()
<illiliti> this 'if' implies that it isn't
<illiliti> this is wrong and bad
<midfavila> wrong, in theory. in practice, the worst thing that would happen is apport aborts.
<phoebos> either way, you're currently testing for 0 or nonzero, which isn't the difference between success and failure of socket
<illiliti> yeah
<midfavila> yeah, and that's fair.
<illiliti> you just need to stop assuming that everything returns a bool
<phoebos> ideally you'd also not assume AF_INET
<midfavila> UNSPEC or whatever, right?
<phoebos> UNSPEC for getaddrinfo, then getaddrinfo tells you what to use
<midfavila> aah, fair enough
<phoebos> like you do in connect; socket should also come after getaddrinfo
<illiliti> i think i see a potential fd leak
<illiliti> you too?
<illiliti> due to early returns
<illiliti> sd will be leaked
<midfavila> i should probably rewrite dial at some point soon. was one of the earlier functions, wrote it when i was pretty braindead
nullcoder has joined #kisslinux
<midfavila> fd leak... should definitely be addressed, but it's also not a problem in practice
<midfavila> at least in this specific case
<phoebos> you can also freeaddrinfo
<illiliti> gopher.c:13
<illiliti> i think you need another byte for NUL
<midfavila> yeah, there are a few calls to malloc, getaddrinfo and etc that could and probably should have cleanup in main, before a stable release
<illiliti> cuz REQ_GOPH contains newline
<illiliti> oh wait no
<illiliti> no it should be fine
<midfavila> yeah i was gonna say
<illiliti> but you would add assert just in case
<illiliti> I*
<illiliti> assert for sprintf return value
<illiliti> ret == buflen
<illiliti> to confirm that your calculation is correct
<midfavila> ret+1, but fair enough
<phoebos> why do you close(sd) when doing tls?
<midfavila> so I can use tls_connect
<midfavila> plan is/was to upgrade the socket
<midfavila> but I wanted TLS working as soon as possible and tls_connect is easier to use
<phoebos> ah
<midfavila> otherwise a spare socket is floating around for the lifetime of the program
<illiliti> main.c:179
<midfavila> also re: assert I'm fairly certain that the program would abort long before dial() if an error occurs that would render the total string length calculation erroneous
<midfavila> (strlen(N_REQ) + strlen(path) + 1) only assumes that path is a string -- but considering dial() is called after uri_parse, which validates and breaks apart input, it's never passed anything that isn't a string
<illiliti> i would use memmem here
<illiliti> memmem will be posix
<midfavila> if it's not in posix, i won't use it
<illiliti> it's in draft
<midfavila> it could be in draft for years
<illiliti> ok
<midfavila> if i define my own version and then say i'll clean up later, versus using functions that are already in posix, there's no chance of spontaneous breakage
<midfavila> i've encountered a huge number of programs that do this
<illiliti> make sure that recvbuf is nul-terminated then
<midfavila> recvbuf is because it's bufsiz+1 and the for loop continously memsets it to null, but recv/tls_read calls only accept BUFSIZ bytes
<illiliti> ok
<illiliti> assert wouldn't hurt here too
<kqz> <testuser[m]> "it doesnt detect my mic unless i..." <- i have the same issue with pipewire and mdevd/libudev-zero, haven’t been able to find a solution
<illiliti> same question: did it work for you before?
<kqz> nope, works when I switch to eudev though so not sure if mdevd config issue or libudev zero incompatibility with pipewire
<illiliti> pipewire is from community, right?
<wael[m]> es
<kqz> yeah
<kqz> seems racy too, every now and again it’ll detect it without me having to restart pipewire
<illiliti> hmm
<illiliti> someone need to debug this
<illiliti> i doubt it will be me cuz i don't use pipewire
<illiliti> i would recommend starting with bisecting spa/plugins/alsa/alsa-udev.c
<kqz> i can investigate some more and see, not sure if any specific release or commit broke it though I’ve noticed the issue for a while
wael_ has quit [Quit: Bridge terminating on SIGTERM]
konimex has quit [Quit: Bridge terminating on SIGTERM]
testuser[m] has quit [Quit: Bridge terminating on SIGTERM]
virutalmachineus has quit [Quit: Bridge terminating on SIGTERM]
wael[m] has quit [Quit: Bridge terminating on SIGTERM]
psydroid has quit [Quit: Bridge terminating on SIGTERM]
kqz has quit [Quit: Bridge terminating on SIGTERM]
macslash1[m] has quit [Quit: Bridge terminating on SIGTERM]
saturn[m] has quit [Quit: Bridge terminating on SIGTERM]
saturn[m] has joined #kisslinux
testuser[m] has joined #kisslinux
psydroid has joined #kisslinux
virutalmachineus has joined #kisslinux
konimex has joined #kisslinux
wael[m] has joined #kisslinux
wael_ has joined #kisslinux
macslash1[m] has joined #kisslinux
kqz has joined #kisslinux
<wael[m]> why did dylan make the decision to switch to wayland?
<midfavila> probably because from an engineering standpoint wayland is significantly simpler than X11
<wael[m]> yeah idk why i need dbus or pipewire or tons of dependencies for screensharing
<wael[m]> maybe the engineering standpoint sure but theres no control in the wayland standards and i just find what weird
* midfavila shrugs
<midfavila> i'm still using x11 and i'll continue to until mgr or some similar display system is brought up
<midfavila> what wayland does is of no consequence to me
<wael[m]> maybe it needs bloated garbage like dbus and pipewire for ''''''''''''''security'''''''''''''''' but idk
<wael[m]> i wish there was a XCB/Xlib to wayland, one library that just does wayland stuff. but unfortunately wayland is more of a specification protocol
<testuser[m]> wael: actually none of that shit is technically needed for screen sharing
<testuser[m]> Like wf-recorder works just fine
<noocsharp> nothing about wayland forces dbus or pipewire, it's just that that's become the standard for screensharing
<testuser[m]> But it's used as an abstraction over various compositors
<testuser[m]> U can fork webrtc to add non pipewire back end
<wael[m]> but why did it have to be like this tho
<testuser[m]> Because everyone uses dbus
<noocsharp> go write the patches to fix it wael[m]
<wael[m]> maybe if i knew C or Rust i would
<testuser[m]> Ye
<testuser[m]> Then learn
<testuser[m]> No point in shitting on things you can't provide an alternative for
<midfavila> that's fallacious,
<midfavila> but the underlying message is sound
<midfavila> something something be the change you want to see in the world
<wael[m]> testuser[m]: xorg
<wael[m]> idk wayland is like the new thing and many things are switching to it
<midfavila> then just don't use those things
<testuser[m]> midfavila: i mean shitting on stuff without suggesting ways to improve / suggesting an alternative that already exists
<testuser[m]> Like u can say this dish sucks
<testuser[m]> But why does it
<testuser[m]> and how to fix
<midfavila> plenty of software and documentation exists for X wael[m]
<wael[m]> eh ur right
<wael[m]> but is there any advantage to wayland other than security?
<testuser[m]> And package/dependency count is meaningless
<testuser[m]> You could have a program that's super fat with no external deps
<wael[m]> i got out of that mindset
<wael[m]> what it depends on kinda matters more
<testuser[m]> And a smaller one which has many deps but combined they're still lless complex than that one package
<midfavila> it's not entirely meaningless, but it's only part of a larger equation
<wael[m]> testuser[m]: aka flatpak lol
<testuser[m]> if you were to unbundle every single bundled library from chromium it would add to like 30 packages
<testuser[m]> Or something
<noocsharp> the core wayland protocol is smaller than X, the downside is that it doesn't include everything everyone would want out of a window compositing protocol
<noocsharp> the upside is your can choose what you care about
<wael[m]> so from an engineering standpoint wayland is much easier to implement yes?
<wael[m]> which is why i assume dylan chose it
<midfavila> isn't wayland also largely linux specific?
<wael[m]> no
<midfavila> i know fBSD has their own compositor that they're working on, but I've not seen it be adopted much outside Linux
<midfavila> i already mentioned that
<wael[m]> but still, again, but is there any advantage to wayland other than security?
<midfavila> uh, it's conceptually simpler and it's free of cruft
<wael[m]> aaand?
<midfavila> that's really all it needs
<noocsharp> it's easier to debug and fix
<midfavila> if all you want is to dump windows on a framebuffer wayland will get you there faster than X
<midfavila> of course, X has peripheral support, flexibility and legacy compat on its side
<noocsharp> wdym peripheral support?
<midfavila> X still has the ability to handle things like monochrome displays and other less common interface devices
<midfavila> of course, that's not suuuuper relevant in today's world
<midfavila> but being able to choose four-bit color instead of 32-bit on my e-reader and the inverse on my desktop is a very nice feature to have
<midfavila> i'm sure a wayland compositor could do the same, but... well, it would only be one wayland compositor
<wael[m]> hm
<noocsharp> 32-bit color would still work on eink, right? just a waste of computation?
<midfavila> yes
<noocsharp> waste of computation when rendering at 32-bit instead of 4 that is
<midfavila> and a massive waste of memory
<wael[m]> because its 38 years old.
<noocsharp> ah
<midfavila> and considering it's a mobile device, memory usage and energy usage are fairly important
<midfavila> also jfc why is android so shit
<midfavila> there are no half-decent standalone ftp clients
<testuser[m]> ftp deprecated broo
<noocsharp> sftp
<testuser[m]> midfavila: use termux
<midfavila> sftp is gay and i'm already using termux
<midfavila> it's just a pain in the ass having to tap out individual letters using my styli
<wael[m]> youre gay
<midfavila> uwu~
<wael[m]> what the fu
Glitch[m] has joined #kisslinux
<Glitch[m]> wael: helow awael
<wael[m]> hello glitch
<Glitch[m]> im use burger linu x\
<testuser[m]> Wat
<Glitch[m]> best dsitro
<Glitch[m]> bruegrign l;uinuxes
Glitch[m] has left #kisslinux [#kisslinux]
<wael[m]> never come back
<testuser[m]> Tf is buger linux
<wael[m]> he is doing a little bit of trolling
<midfavila> yeah i have no clue how people can tolerate using android...
<midfavila> even just transferring a file is painful
<midfavila> i guess if you used webshit it would be tolerable
<testuser[m]> That's literally what it's meant for
<midfavila> hell
<midfavila> can't wait until pmos can be flashed to the pine note
<illiliti> > isn't wayland also largely linux specific?
<illiliti> yes, absolutely
<illiliti> don't even mention freebsd support
<illiliti> it is joke
<wael[m]> aw
<illiliti> everytime people say that wayland supports freebsd, i cringe
<illiliti> i mean look at what freebsd did to get this "support"
<illiliti> instead of forcing wayland to use freebsd native interfaces, they forced freebsd to implement linuxism
<illiliti> libudev, evdev, libinput, epoll and other crap
<illiliti> i would not call this support
<illiliti> it's rather shim programming that a proper support
<illiliti> proper support is when software relies on OS's native interfaces
<illiliti> what wayland did is ridiculous
<phoebos> lol xcb and Xlib are different libraries using the same protocol
<phoebos> hi noocsharp
<midfavila> fwiw xlib just sits on top of xcb these days
<noocsharp> hi phoebos
<noocsharp> illiliti: and when a system implements an interface it becomes native
<testuser[m]> phoebos: but there could be an xz that doesn't even use -d/-c for (de)compression
<testuser[m]> The file format is well specified
<testuser[m]> But not any utility
<testuser[m]> Should be trivial to stub -T for any dev
<testuser[m]> For compression xz definitely benefits a lot from threads
<illiliti> of course, if said system is a linux puppet it will implement all shims and all interfaces
<illiliti> no matter how bad they are and no matter that system already have similar interface
<illiliti> only matter is result, right?
<phoebos> testuser[m]: if we find an xz that doesn't implement -d then we'll work around it
<phoebos> but there is one that doesn't support -T
<phoebos> however, i'll send them a message to see if they'll stub it
nullcoder has quit [Ping timeout: 256 seconds]
Torr has joined #kisslinux
nullcoder has joined #kisslinux
nullcoder has quit [Ping timeout: 252 seconds]
nullcoder has joined #kisslinux
nullcoder has quit [Ping timeout: 268 seconds]
nullcoder has joined #kisslinux
nullcoder has quit [Ping timeout: 268 seconds]
nullcoder has joined #kisslinux
da5id has joined #kisslinux
<da5id> trying to install kiss for the first time and noticed that the official repo is outdated. Im on the step for listing all of the /var/db/kiss/installed and building them all but zlib gets a 404 for version 1.2.11 is there a newer repo to point to that im not aware of?