1. 4

    Check UPDATE 1 to my blog post about ZSH shell setup here:

    https://vermaden.wordpress.com/2021/09/19/ghost-in-the-shell-part-7-zsh-setup/

    You can actually make zsh(1) to behave like fish(1) shell.

    I like fish(1) shell bit I often use POSIX syntax for loops for various things and it really breaks my way of work.

    Regards.

    1. 2

      has a USB dongle so Bluetooth is not needed

      Why? Bluetooth is built into pretty much any laptop / tablet / phone and a lot of desktops. For the few where it isn’t there already, a USB Bluetooth dongle is dirty cheap (I have three sitting unused in a box next to me). With Bluetooth, I don’t need to worry that the manufacturers managed to actually make a secure protocol (historically, on average, they haven’t) or that it won’t interfere with other 2.4 GHz things (again, historically, they have) and I don’t need a dongle if my laptop does have Bluetooth. Most of the mice that you buy these days that do come with a USB dongle are just Bluetooth ones where they bundle a Bluetooth USB dongle because they cost next to nothing.

      1. 1

        This is because Bluetooth is too power-heavy, almost all bluetooth HIDs go into sleep mode fairly aggressively, and take a noticeable and infurating amount of time to wake back up and re-negotiate the handshake. Probably getting better these days with BTLE, but I’ve yet to find a BT keyboard that didn’t take an annoying time to wake up.

        1. 1

          The Bluetooth is ‘first class citizen’ in an Android world but definitely not in the UNIX world. Sometimes Bluetooth just enabled in BIOS (and not used) can break the suspend/resume on FreeBSD. The OpenBSD has removed all Bluetooth support long ago. This is why I demand from a mouse to have a tiny physical USB dongle. To not rely on Bluetooth protocol. I may use that Bluetooth for additional devices to easy switch between my UNIX system and therm - but I do not prefer sitting in a command line to pair Bluetooth devices on UNIX.

          1. 2

            The Bluetooth is ‘first class citizen’ in an Android world but definitely not in the UNIX world

            The only certified UNIX I’ve used recently is macOS, and it has fantastic Bluetooth support. In open source *NIX world, FreeBSD’s Bluetooth support is not as polished in terms of UI but I had no problems setting up a Bluetooth keyboard and mouse the last time I tried.

            Sometimes Bluetooth just enabled in BIOS (and not used) can break the suspend/resume on FreeBSD

            I used an external USB dongle, so the BIOS isn’t involved at all, but if it breaks suspend and resume then that seems like a bug that could be fixed, rather than giving up on a widely deployed technology. 15-20 years ago, exactly the same was true on FreeBSD and Linux with USB keyboards and mice instead of PS/2 ones and it was generally a good idea to set the BIOS to emulate PS/2 rather than expect a USB HID to work. Today, that would be a ludicrous idea but only because people filed bug reports and helped identify the root cause of problems with USB HIDs on *NIX.

        1. 1

          … but given the fact that Logitech MX Master mouse also has micro USB port at its front for charging I would suspect that battery time is also not that great.

          That is not my experience, I use a MX Master 3 on a daily basis for hours and rarely, every 2-3 weeks, have to charge it.

          1. 1

            2 weeks is quite short for me …

            1. 1

              Honestly, it could also be 4-6 weeks. I did no accurate book-keeping. The point is, it is so seldom that it do not notice it. Also it’s pretty fast charged and I can use the mouse while the cord is plugged in.

          1. 3

            What makes a mouse a “UNIX” mouse ?! A good mouse is good no matter the OS you use it with.

            1. 1

              That depends.

              If you would be able to set some of the mouse features only with Windows only application - then it would definitely will not be a good UNIX mouse, wouldn’t it? :)

            1. 4

              Love the tank mouse.

              Switches end up failing over decades of use, but they’re standard: Just solder new ones.

              1. 2

                Yeah, they just do not know how to die :)

                I have also seen modifications of it into the ‘laser’ mouse :)

              1. 1

                I used to use the MX Master 1 at work and liked it so much that I got an MX Master 2 (which is essentially the same product) at home. The USB port is nice because you can charge it easily and continue to use it while doing so (looking at you Apple) but I go months between charging it. So no, the presence of the port does not mean bad battery life.

                1. 1

                  Thanks for sharing that, maybe MX Master 3 will be my next mouse then :)

                  1. 1

                    I loved my MX Master. Slinging the scroll wheel around was quite rewarding. I’ve switched to a Kensington Expert Mouse trackball for now. I was disappointed the logitech vertical and trackball mice had such inferior scroll wheels.

                  1. 21

                    I always wonder why people still repeat all these ZFS myths like the need for ECC or lots of RAM - its really silly.

                    About ECC … lets make something clear … ALL filesystems benefit from having ECC memory but if you do not have ECC memory the ZFS filesystem is the SAFEST to use on such systems.

                    About RAM … if you have small about of RAM the only thing you will lack is ZFS cache in RAM. Nothing more. Of course a lot RAM is needed if you want to use ZFS with deduplication but that is useful only in very special cases. Most people do not use/enable deduplication on ZFS - sometime only for several datasets. You do not have to enable deduplication for entire pool.

                    I have used 2 x 2 TB ZFS mirror with 512 MB RAM on FreeBSD along with serving there a lot of other services then just SAMBA or NFS. It also server Syncthing, KODI and other services and the only time when it got rebooted was when there was power outage (lack of electricity) as this system did not had UPS emergency power.

                    I now run 2 x 5 TB ZFS mirror with 4 GB RAM and 2 GB still remains free. I could run that 2 x 5 TB also with only 512 MB of RAM but I got that 4 GB RAM stick for free with motherboard so I use it here.

                    Also all ‘bad’ or ‘tragic’ stories on ZFS I know are on Linux systems. I have never heard any such stories on FreeBSD.

                    If you want to read more about storage on FreeBSD then check this: https://is.gd/bsdstg

                    Regards.

                    1. 6

                      I have used 2 x 2 TB ZFS mirror with 512 MB RAM on FreeBSD along with serving there a lot of other services then just SAMBA or NFS

                      On what kind of storage, over what kind of network? ZFS’ copy-on-write nature leads to a lot of on-disk fragmentation and the persistence model causes write amplification. This means RAM is useful for two things:

                      • More RAM lets ZFS buffer writes so that it can handle bursty loads better. In very write-heavy workloads you’ll often see things freeze periodically as ZFS gets to the point where it must flush buffers and back pressure propagates through the system. You can alleviate this a lot with a separate log device on fast flash. This should be large enough that it can handle as much data as your pool can write in a 10-second burst write.
                      • More RAM lets it avoid needing to do fragmented reads to recover files, because more of the working set can fit in RAM.

                      If you’re using a relatively slow network (e.g. 100Mb/s) then even a fairly modest pair of drives should be able to keep up with reads. ZFS is very good at read-ahead on predictable workloads so if you’re mostly streaming files from disk then the RAM requirement is related to be bandwidth delay product of the disks and so can be pretty small. If you’re doing a lot of random reads and your pool is spinning rust then that can dominate performance unless most reads are satisfied from the ARC (in which case it will still dominate your performance, just much later).

                      If your pool is on SSDs, then the ARC is much less important. A typical cheap SSD can do around 30MiB/s of random reads and with a ZFS mirror can read from both disks in parallel, so you can probably handle serving read-heavy workloads over gigabit ethernet without the ARC mattering too much. If you’re on spinning rust then the ARC lets it burst read large contiguous chunks of files and keep them in cache while a lot of other things are being fetched.

                      TL;DR: ZFS doesn’t stop working if you have less than the rough guidelines for the amount of RAM it needs, it just gets slower. Whether this slowdown matters depends a lot on whether your network or your disks are the bottleneck. Most of the advice on RAM:Disk ratios is written by people building out large multi-user file servers over very fast networks.

                    1. 2

                      Nice guide, thanks for sharing it.

                      I currently use 10 years old ThinkPad W520 and I will use it for several years more as replacements does not exist. Maybe I will be able to get ThinkPad T25 (Anniversary) but I haven’t seen one on auction since about a year …

                      I also own X220 (not X230) because I did not wanted to waste time with keyboard modifications. I got 1366x768 IPS panel instead of TN one so colors and brightness are great. Maybe I will put FullHD 1920x1080 somewhere in the future as its the only thing I maybe miss from my ThinkPad W520 :)

                      Regards.

                      1. 3

                        Is this Linux? The website doesn’t seem to have any substantive documentation

                        1. 5

                          I get the impression that Elementary’s view of itself is that it’s Linux in the same way macOS is BSD.

                          1. 7

                            It’s literally just Ubuntu with a different window manager and some first party apps. The previous release was built on 18.04 LTS and the new one 20.04 LTS. You can even run lsb_release -a

                            1. 4

                              Hence why I said “view of itself” and not “is actually.” :)

                              1. 2

                                Not disagreeing with you; just providing context on why that’s a ridiculous view.

                            2. 1

                              I’d be interested reading more about that without having to read the source as the very first step

                            3. 5

                              Elementary OS is based on Debian/Ubuntu Linux.

                              1. 1

                                Our platform itself is entirely open source, and it’s built upon a strong foundation of Free & Open Source software (like GNU/Linux). Plus, we actively collaborate within the ecosystem to improve it for everyone.

                                on the homepage: https://elementary.io/

                                1. 1

                                  Right but it’s all puff. I can’t find any technical documentation

                                  1. 2
                              1. 4

                                This post obliquely hints at two of my pet peeves with ZFS:

                                • The ZFS kernel interface allows you to atomically create a set of snapshots. This is fantastic for package updates if you want, for example, to keep /usr/local/etc and /usr/local/ in separate datasets so that you can back up the config files easily but not bother backing up the whole thing. This feature is so useful that the authors of the zfs command-line tool decided not to expose it to users.
                                • The allow mechanism is incredibly coarse-grained. If I want to say ‘my backup user can create snapshots and delete them, but can’t delete snapshots that it didn’t create’ then I’m out of luck: that’s not something that the permissions model can express. Snapshots don’t come with owners. My backup system should be trusted with preserving the confidentiality of my data (it can, after all, read the data unless I’m backing up encrypted ZFS datasets directly) but it shouldn’t have the ability to destroy the datasets that it’s backing up. Yet that’s not something that zfs allow can express.
                                1. 3

                                  Snapshotting /usr/local or /usr/local/etc can be sometimes useful but ZFS Boot Environments is whole a lot better - securing entire system and also both /usr/local and /usr/local/etc - more on that here:

                                  https://vermaden.files.wordpress.com/2018/11/nluug-zfs-boot-environments-reloaded-2018-11-15.pdf

                                  1. 1

                                    Snapshotting /usr/local or /usr/local/etc can be sometimes useful but ZFS Boot Environments is whole a lot better

                                    These solve different problems. BEs clone the base system. I want to snapshot /usr/local so that I can roll back if pkg upgrade goes wrong. I want a BE so that I can roll back if an upgrade of the base system goes wrong (and it’s super useful - I’ve occasionally made changes to libc that work fine in some tests, done a make installworld and after a reboot discovered that I broke something that init needs - being able to switch back to the old BE from loader is fantastic).

                                    You’ll note from that presentation that beadm is written in shell and uses zfs snapshot. This means that, as with the /usr/local/etc case, beadm requires zpool/ROOT to be either a single dataset or a tree of datasets. A BE doesn’t contain /usr/local. bectl is part of the base system and is actually written in C as a thin wrapper around libbe (also in the base system). This actually could snapshot multiple independent filesystems atomically (it uses libzfs, which wraps the ZFS ioctls, which take an nvlist of filesystems to snapshot), it just doesn’t.

                                    If you do bectl list -a then it will show exactly which filesystems are snapshotted. If you then compare this against the output of mount then you’ll see that there are a lot that are not in the tree of any BE. This is usually a useful feature: you can use BEs to test the same set of packages against different base system versions, you don’t normally want to roll back home directories if you discover problems in an update, and so on.

                                    1. 3

                                      These solve different problems. BEs clone the base system. I want to snapshot /usr/local so that I can roll back if pkg upgrade goes wrong. I want a BE so that I can roll back if an upgrade of the base system goes wrong (and it’s super useful - I’ve occasionally made changes to libc that work fine in some tests, done a make installworld and after a reboot discovered that I broke something that init needs - being able to switch back to the old BE from loader is fantastic).

                                      The default FreeBSD installation on ZFS INCLUDES also /usr/local for the BE. This is what I am trying to tell you.

                                      You’ll note from that presentation that beadm is written in shell and uses zfs snapshot. This means that, as with the /usr/local/etc case, beadm requires zpool/ROOT to be either a single dataset or a tree of datasets. A BE doesn’t contain /usr/local. bectl is part of the base system and is actually written in C as a thin wrapper around libbe (also in the base system). This actually could snapshot multiple independent filesystems atomically (it uses libzfs, which wraps the ZFS ioctls, which take an nvlist of filesystems to snapshot), it just doesn’t.

                                      I know because I am the author of beadm(8) command.

                                      Both bectl(8) and beadm(8) require zpool/ROOT approach … and yes BE by default contains /usr/local directory. The beadm(8) uses zfs snapshot -r command that means that it does RECURSUVE snapshot. The same is done in bectl(8). Does not matter that bectl(8) uses libbe. They work the same.

                                      If you do bectl list -a then it will show exactly which filesystems are snapshotted.

                                      Please see the presentation again - especially the 42/43/44 pages which tell you exactly the info you need. The /usr/local IS INCLUDED in BE with the default FreeBSD install on ZFS.

                                      1. 1

                                        The default FreeBSD installation on ZFS INCLUDES also /usr/local for the BE. This is what I am trying to tell you.

                                        The default ZFS install doesn’t put /usr/local in a separate ZFS dataset. This is one of the first things that I need to fix on any new FreeBSD install, before I install any packages. In the vast majority of cases, I don’t want /usr/local to be in my BE because if I change something in a package config and then discover I need to roll back to a prior BE then I’d lose that change. In my ideal world, /etc would not contain system-provided rc.d scripts, defaults, or any of the other system-immutable things that have ended up there and /etc would be omitted from the BE as well so that I didn’t lose config changes on BE rollback, but that’s not possible while /etc needs to be mounted before init runs and while it contains a mix of user- and system-provided things.

                                  2. 1

                                    Newish ZFS user here.

                                    What do you mean by:

                                    The ZFS kernel interface allows you to atomically create a set of snapshots.

                                    Specifically, what is a “set of snapshots”?

                                    1. 2

                                      Not really a ZFS thing, actually - more of an ACID or data integrity concept. Each ZFS volume is a completely separate entity; it is configured separately, managed separately, and even has its own isolated IO (you have to copy-and-delete the entirety of a file to copy it to a different dataset even if it’s on the same zpool).

                                      A regular snapshot doesn’t make any atomicity guarantees with regards to a snapshot of a different ZFS dataset: if your app writes to a ZFS dataset at /var/db/foo.db and logs to the separate ZFS dataset at /var/log/foo, if you snapshot both “regularly” and then restore, you might find that the log references data that isn’t found in the db, because the snapshots weren’t synchronized. An atomic set of snapshots would not run into that.

                                      (But I thought recursive snapshots of / would give you atomic captures of the various child datasets, so it’s exposed in that fashion, albeit in an all-or-nothing approach?)

                                      1. 1

                                        I want to do zfs snapshot zroot/usr/local@1 zroot/usr/local/etc@1 zroot/var/log@1 or similar. It turns out I can do this now. Not sure when I was added, but very happy that it’s there now.

                                      2. 1

                                        This feature is so useful that the authors of the zfs command-line tool decided not to expose it to users.

                                        Is that not what zfs snapshot -r does? (note the -r). I think it’s supposed to create a set of snapshots atomically. Granted, they all have to be descendants of some dataset, but that’s not necessarily a big issue because the hierarchy of ZFS datasets need not correspond to the filesystem hierarchy (you can set the mountpoint property to mount any dataset in whatever path you want).

                                        Also, I think ZFS channel programs also allow you to do that atomically, but with a lot more flexibility (e.g. no need for the snapshots to be descendants of the same dataset, and you can also perform other ZFS administration commands in-between the snapshots if you want), since it basically allows you to create your own Lua script that runs at the kernel level, atomically, when ZFS is synchronizing the pools. See man zfs-program (8).

                                        1. 1

                                          -r creates a set of snapshots of a complete tree. It doesn’t allow you to atomically create a set of snapshots atomically for datasets that don’t have a strict parent-child relationship. For example, with Boot Environments, / is typically zroot/ROOT/${current_be_name} and /usr/local is zroot/usr/local so you can’t snapshot both together with the command-ine tool.

                                          The ioctl that this uses doesn’t actually doesn’t do anything special for recursive snapshots. It just takes an nvlist that is a list of dataset names and snapshots them all. When you do zfs -r, the userspace code collects a set of names of datasets and then passes them to the ioctl. This is actually racy because if a dataset is created in the tree in the middle of the operation then it won’t be captured in the snapshot, so a sequence from another core of ‘create child dataset’ then ‘create symlink in parent to file in child’ can leave the resulting snapshots in an inconsistent state because they’ll capture the symlink but not the target. In practice, this probably doesn’t matter for most uses of -r.

                                          Channel programs do allow this, but they don’t compose well with other ZFS features. In particular, they’re restricted to root (for good reason: it’s generally a bad idea to allow non-root users to run even fairly restricted code in the kernel because they can use it to mount side-channel attacks or inject handy gadgets for code-reuse attacks. This is why eBPF in Linux is so popular with attackers). This means that you can’t use them with ZFS delegated administration. It would be a lot better if channel programs were objects in some namespace so that root could install them and other users could then be authorised to invoke them.

                                          On the other hand, the kernel interface already does exactly what I want and the libzfs_core library provides a convenient C wrapper, I’m just complaining that the zfs command-line tool doesn’t expose this.

                                          1. 3

                                            Actually, it looks as if I’m wrong. zfs snapshot can do this now. I wonder when that was added…

                                            1. 1

                                              It would be a lot better if channel programs were objects in some namespace so that root could install them and other users could then be authorised to invoke them.

                                              Can’t you create a script as root and then let other users invoke it with doas or sudo?

                                              1. 1

                                                Not from a jail, no (unless you want to allow a mechanism for privilege elevation from a jail to the host, which sounds like a terrible idea). In general, maybe if you wanted to put doas or sudo in your TCB (I’d be more happy with doas, but sudo‘s security record isn’t fantastic). But now if a program wants to run with delegated administration and provide a channel script it also needs to provide all of this privilege elevation machinery and there are enough fun corner cases that it will probably get it wrong and introduce new security vulnerabilities. Oh, and the channel program code doesn’t know who it’s running as, so you end up needing some complex logic to check the allow properties there to make sure that the channel program is not run by a user who shouldn’t be allowed to use it.

                                                I’d love to see installing and running channel programs completely separated so that only unjailed root could install them (though they could be exposed to jails) and then any user could enumerate them and invoke them with whatever parameters they wanted, but the channel program then runs with only the rights of that user, so they couldn’t do anything with a channel program that delegated administration didn’t let them do anyway.

                                        1. 25

                                          Fascinating read. Audio was the thing that made me switch from Linux to FreeBSD around 2003. A bit before then, audio was provided by OSS, which was upstream in the kernel and maintained by a company that sold drivers that plugged into the framework. This didn’t make me super happy because those drivers were really expensive. My sound card cost about £20 and the driver cost £15. My machine had an on-board thing as well, so I ended up using that when I was running Linux.

                                          A bit later, a new version of OSS came out, OSS 4, which was not released as open source. The Linux developers had a tantrum and decided to deprecate OSS and replace it with something completely new: ALSA. If your apps were rewritten to use ALSA they got new features, but if they used OSS (as everything did back then) they didn’t. There was only one feature that really mattered from a user perspective: audio mixing. I wanted two applications to be able both open the sound device and go ‘beep’. I think ALSA on Linux exposed hardware channels for mixing if your card supported it (my on-board one didn’t), OSS didn’t support it at all. I might be misremembering and ALSA supported software mixing, OSS only hardware mixing. Either way, only one OSS application could use the sound device at the time and very few things had been updated to use ASLA.

                                          GNOME and KDE both worked around this by providing userspace sound mixing. These weren’t great for latency (sound was written to a pipe, then at some point later the userspace sound daemon was scheduled and then did the mixing and wrote the output) but they were fine for going ‘bing’. There was just one problem: I wanted to use Evolution (GNOME) for mail and Psi (KDE) for chat. Only one out of the KDE and GNOME sound daemons could play sound at a time and they were incompatible. Oh, and XMMS didn’t support ALSA and so if I played music the neither of them could do audio notifications.

                                          Meanwhile, the FreeBSD team just forked the last BSD licensed OSS release and added support for OSS 4 and in-kernel low-latency sound mixing. On FreeBSD 4.x, device nodes were static so you had to configure the number of channels that it exposed but then you got /dev/dsp.0, /dev/dsp.1, and so on. I could configure XMMS and each of the GNOME and KDE sound daemons to use one of these, leaving the default /dev/dsp (a symlink to /dev/dsp.0, as I recall) for whatever ran in the foreground and wanted audio (typically BZFlag). When FreeBSD 5.0 rolled out, this manual configuration went away and you just opened /dev/dsp and got a new vchan. Nothing needed porting to use ALSA, GNOME’s sound daemon, KDE’s sound daemon, PulseAudio, or anything else: the OSS APIs just worked.

                                          It was several years before audio became reliable on Linux again and it was really only after everything was, once again, rewritten for PulseAudio. Now it’s being rewritten for PipeWire. PipeWire does have some advantages, but there’s no reason that it can’t be used as a back end for the virtual_oss thing mentioned in this article, so software written with OSS could automatically support it, rather than requiring the constant churn of the Linux ecosystem. Software written against OSS 3 20 years ago will still work unmodified on FreeBSD and will have worked every year since it was written.

                                          1. 8

                                            everything was, once again, rewritten for PulseAudio. Now it’s being rewritten for PipeWire

                                            Luckily there’s no need for such a rewrite because pipewire has a PulseAudio API.

                                            1. 1

                                              There was technically no need for a rewrite from ALSA to PulseAudio, either, because PulseAudio had an ALSA compat module.

                                              But most applications got a PulseAudio plug-in anyway because the best that could be said about the compat module is that it made your computer continue to go beep – otherwise, it made everything worse.

                                              I am slightly more hopeful for PipeWire, partly because (hopefully) some lessons have been drawn from PA’s disastrous roll-out, partly for reasons that I don’t quite know how to formulate without sounding like an ad-hominem attack (tl;dr some of the folks behind PipeWire really do know a thing or two about multimedia and let’s leave it at that). But bridging sound stacks is rarely a simple affair, and depending on how the two stacks are designed, some problems are simply not tractable.

                                              1. 2

                                                One could also say that a lot of groundwork was done by PulseAudio, revealing bugs etc so the landscape that PipeWire enters in 2021 is not the same that PulseAudio entered in 2008. For starters there’s no Arts, ESD etc. anymore, these are long dead and gone, the only thing that matters these days is the PulseAudio API and the JACK API.

                                                1. 3

                                                  I may be misremembering the timeline but as far as I remember it, aRts, ESD & friends were long dead, gone and buried by 2008, as alsa had been supporting proper (eh…) software mixing for several years by then. aRts itself stopped being developed around 2004 or so. It was definitely no longer present in KDE 4, which was launched in 2008, and while it still shipped with KDE 3, it didn’t really see much use outside KDE applications anyway. I don’t recall how things were in Gnome land, I think ESD was dropped around 2009, but pretty much everything had been ported to canberra long before then.

                                                  I, for one, don’t recall seeing either of them or using either of them after 2003, 2004 or so, but I did have some generic Intel on-board sound card, which was probably one of the first ones to get proper software mixing support on alsa, so perhaps my experience wasn’t representative.

                                                  I don’t know how many bugs PulseAudio revealed but the words “PulseAudio” and “bugs” are enough to make me stop consider going back to Linux for at least six months :-D. The way bug reports, and contributors in general, technical and non-technical alike were treated, is one of the reasons why PulseAudio’s reception was not very warm to say the least, and IMHO it’s one of the projects that kickstarted a very hostile and irresponsible attitude that prevails in many Linux-related open-source projects to this day.

                                            2. 4

                                              I might be misremembering and ALSA supported software mixing, OSS only hardware mixing.

                                              That’s more like it on Linux. ALSA did software mixing, enabled by default, in a 2005 release. So it was a pain before then (you could enable it at least as early as 2004, but it didn’t start being easy until 1.0.9 in 2005)… but long before godawful PulseAudio was even minimally usable.

                                              BSD did the right thing though, no doubt about that. Linux never learns its lesson. Now Wayland lololol.

                                              1. 4

                                                GNOME and KDE both worked around this by providing userspace sound mixing. These weren’t great for latency (sound was written to a pipe, then at some point later the userspace sound daemon was scheduled and then did the mixing and wrote the output) but they were fine for going ‘bing’.

                                                Things got pretty hilarious when you inevitably mixed an OSS app (or maybe an ALSA app, by that time? It’s been a while for me, too…) and one that used, say, aRTs (KDE’s sound daemon).

                                                What would happen is that the non-aRTs app would grab the sound device and clung to it very, very tight. The sound daemon couldn’t play anything for a while, but it kept queuing sounds. Like, say, Gaim alerts (anyone remember Gaim? I think it was still gAIM at that point, this was long before it was renamed to Pidgin).

                                                Then you’d close the non-aRTs app, and the sound daemon would get access to the sound card again, and BAM! it would dump like five minutes of gAIM alerts and application error sounds onto it, and your computer would go bing, bing, bing, bang, bing until the queue was finally empty.

                                                1. 2

                                                  I’d forgotten about that. I remember this happening when people logged out of computers: they’d quit BZFlag (yes, that’s basically what people used computers for in 2002) and log out, aRTs would get access to the sound device and write as many of the notification beeps as it could to the DSP device before it responded to the signal to quit.

                                                  ICQ-inspired systems back then really liked notification beeps. Psi would make a noise both when you sent and when you received a message (we referred to IM as bing-bong because it would go ‘bing’ when you sent a message and ‘bong’ when you received one). If nothing was draining the queue, it could really fill up!

                                                  1. 1

                                                    Then you’d close the non-aRTs app, and the sound daemon would get access to the sound card again, and BAM! it would dump like five minutes of gAIM alerts and application error sounds onto it, and your computer would go bing, bing, bing, bang, bing until the queue was finally empty.

                                                    This is exactly what happens with PulseAudio to me today, provided the applications trying to play the sounds come from different users.

                                                    Back in 2006ish though, alsa apps would mix sound, but OSS ones would queue, waiting to grab the device. I actually liked this a lot because I’d use an oss play command line program and just type up the names of files I want to play. It was an ad-hoc playlist in the shell!

                                                  2. 4

                                                    This is just an example of what the BSDs get right in general. For example, there is no world in which FreeBSD would remove ifconfig and replace it with an all-new command just because the existing code doesn’t have support for a couple of cool features - it gets patched or rewritten instead.

                                                    1. 1

                                                      I’m not sure I’d say “get right” in a global sense, but definitely it’s a matter of differing priorities. Having a stable user experience really isn’t a goal for most Linux distros, so if avoiding user facing churn is a priority, BSDs are a good place to be.

                                                      1. 1

                                                        I don’t know; the older I get the more heavily I value minimizing churn and creating a system that can be intuitively “modeled” by the brain just from exposure, i.e. no surprises. If there are architectural reasons why something doesn’t work (e.g. the git command line), I can get behind fixing it. But stuff that just works?

                                                    2. 4

                                                      I guess we can’t blame Lennart for breaking audio on Linux if it was already broken….

                                                      1. 7

                                                        You must be new around here - we never let reality get in the way of blaming Lennart :-/

                                                        1. 2

                                                          Same as with systemd, there were dozens of us where everything worked before. I mean, I mostly liked pulseaudio because it brought a few cool features, but I don’t remember sound simply stopping to work before. Sure, it was complicated to setup, but if you didn’t change anything, it simply worked.

                                                          I don’t see this as blaming. Just stating the fact that if it works for some people, it’s not broken.

                                                        2. 3

                                                          Well, can’t blame him personally, but the distros who pushed that PulseAudio trash? Absolutely yes they can be blamed. ALSA was fixed long before PA was, and like the parent post says, they could have just fixed OSS too and been done with that before ALSA!

                                                          But nah better to force everyone to constantly churn toward the next shiny thing.

                                                          1. 4

                                                            ALSA was fixed long before PA was, and like the parent post says, they could have just fixed OSS too and been done with that before ALSA!

                                                            Huh? I just setup ALSA recently and you very much had to specifically configure dmix, if that’s what you’re referring to. Here’s the official docs on software mixing. It doesn’t do anything as sophisticated as PulseAudio does by default. Not to mention that on a given restart ALSA devices frequently change their device IDs. I have a little script on a Void Linux box that I used to run as a media PC which creates the asoundrc file based on outputs from lspci. I don’t have any such issue with PulseAudio at all.

                                                            1. 3

                                                              dmix has been enabled by default since 2005 in alsa upstream. If it wasn’t on your system, perhaps your distro changed things or something. The only alsa config I’ve ever had to do is change the default device from the hdmi to analog speakers.

                                                              And yeah, it isn’t sophisticated. But I don’t care, it actually works, which is more than I can say about PulseAudio, which even to this day, has random lag and updates break the multi-user setup (which very much did not just work). I didn’t want PA but Firefox kinda forced my hand and I hate it. I should have just ditched Firefox.

                                                              Everyone tells me the pipewire is better though, but I wish it could just go back to the default alsa setup again.

                                                              1. 6

                                                                Shrug, I guess in my experience PulseAudio has “just worked” for me since 2006 or so. I admit that the initial rollout was chaotic, but ever since it’s been fine. I’ve never had random lag and my multi-user setup has never had any problems. It’s been roughly 15 years, so almost half my life, since PulseAudio has given me issues, so at this point I largely consider it stable, boring software. I still find ALSA frustrating to configure to this day, and I’ve used ALSA for even longer. Going forward I don’t think I’ll ever try to use raw ALSA ever again.

                                                            2. 1

                                                              I’m pretty sure calvin is tongue in cheek referencing that Lennart created PulseAudio as well as systemd.

                                                          2. 3

                                                            I cannot up this comment more. The migration to ALSA was a mess, and the introductions of Gstreamer*, Pulse*, or *sound_daemon fractured the system more. Things in BSD land stayed much simpler.

                                                            1. 3

                                                              I was also ‘forced’ out of Linux ecosystem because of mess in sound subsystem.

                                                              After spending some years on FreeBSD land I got hardware that was not FreeBSD supported at that moment so I tried Ubuntu … what a tragedy it was. When I was using FreeBSD I got my system run for months and rebooted only to install security updates or to upgrade. Everything just worked. Including sound. In Ubuntu land I needed to do HARD RESET every 2-3 days because sound will went dead and I could not find a way to reload/restart anything that caused that ‘glitch’.

                                                              Details here:

                                                              https://vermaden.wordpress.com/2018/09/07/my-freebsd-story/

                                                              1. 1

                                                                From time to time I try to run my DAW (Bitwig Studio) in Linux. A nice thing about using DAWs from Mac OS X is that, they just find the audio and midi sources and you don’t have to do a lot of setup. There’s a MIDI router application you can use if you want to do something complex.

                                                                Using the DAW from Linux, if it connects via ALSA or PulseAudio, mostly just works, although it won’t find my audio interface from PulseAudio. But the recommended configuration is with JACK, and despite reading the manual a couple times and trying various recommended distributions, I just can’t seem to wrap my head around it.

                                                                I should try running Bitwig on FreeBSD via the Linux compatibility layer. It’s just a Java application after all.

                                                                1. 7

                                                                  Try updating to Pipewire if your distribution supports it already. Then you get systemwide Jack compatibility with no extra configuration/effort and it doesn’t matter much which interface the app uses. Then you can route anything the way you like (audio and MIDI) with even fewer restrictions than MacOS.

                                                                  1. 1

                                                                    I’ll give that a try, thanks!

                                                              1. 2

                                                                I still use fish. It does the autocomplete part very well which is 90% what I need from a shell. I do not have time to go through gazillion lines of shell configuration to get the same in zsh. I do not want to maintain this much configuration. My fish config is 40 lines. Most of it is git related.

                                                                1. 2

                                                                  I really like fish(1) interactive mode and its really a decent shell. I would say that currently zsh(1) and fish(1) are the best currently available interactive shells.

                                                                  I tried to use it for a while (not forcing myself - just trying it) and I REALLY miss that I can not use these one liners/typical loops or pipes that I have been using for more then a decade in the fish(1) shell - like those:

                                                                  # for I in *.mp4; do ff.mp3.320.sh "${I}"; done
                                                                  # find . -type f -iname \*.jpg | while read I; do echo -n "${I} "; identify -format %Q; echo; done
                                                                  

                                                                  I really can not understand why the fish(1) developers would NOT implement POSIX /bin/sh syntax and invent their own one … its really a NO GO for me.

                                                                1. 1

                                                                  Can I get some remedial explanation for this line to convert hex to decimal:

                                                                  SIZE=$( printf “%d\n” 0x${SIZE} )

                                                                  Why add the newline to the format?

                                                                  Shouldn’t we quote “0x${SIZE}”? I guess it works for me in without it, but it makes me nervous for some reason.

                                                                  1. 3

                                                                    Newline or not does not matter, as it is automatically stripped anyway.

                                                                    0x${SIZE} without quotes is safe if you know it does not contain glob (like *) or IFS characters (like spaces, usually). In this case, we know it does not contain IFS characters (as the read command splits on IFS), and we can be relatively certain it won’t ever contain a glob character.

                                                                    Still not best practice, though, as we ultimately do not control the value ourselves.

                                                                    1. 2

                                                                      You are right the ‘\n’ newline is not needed there, but does not hurt as it seams.

                                                                      As for the quoting - its always a good idea to quote variable - which I sometimes forgot - but in that case the size is without spaces so it works without a problem.

                                                                      Regards.

                                                                      1. 3

                                                                        I can add that printf '%s\n' is such a common pattern that it is probably a good idea to include the newline even when it is unnecessary, because it is necessary when piping the result, which is what is usually done:

                                                                        printf '%s\n' "$x" | ...
                                                                        
                                                                    1. 1

                                                                      It doesn’t really need to fork/exec a sub shell, {} would do instead of ().

                                                                      1. 1

                                                                        There were many code listings, please tell me which one You are addressing :)

                                                                      1. 1

                                                                        Telegram appears to available in ports: https://www.freshports.org/net-im/telegram-desktop/ is there a benefit to running the Linux version?

                                                                        1. 2

                                                                          I am not running the Linux version.

                                                                          Quote from the article:

                                                                          Telegram – the other secure messenger – is available in the FreeBSD Ports tree and packages.

                                                                          Netflix (using Chrome) and Signal are run using Ubuntu compat layer. Telegram is run ‘natively’.

                                                                          Hope that helps.

                                                                          1. 2

                                                                            Oh wow sorry, I read all the details about running Signal and Chrome via Linux company then got to Telegram, skimmed and assumed it was the same.

                                                                            1. 4

                                                                              No problem, you are probably not the only one that made that assumption.

                                                                              My fault that I did not specified it more clearly :)

                                                                        1. 4

                                                                          First the ‘Compact’ layout been removed.

                                                                          Now its PITA to change back to ‘normal’ tabs style - it should be in one switch - not a several points howto …

                                                                          Pity to watch Firefox starts to decline …

                                                                          1. 3

                                                                            The Proton UI is now normal. The rest is unsupported legacy code artifacts that will eventually stop working. I think it’s already non-functional in upcoming Firefox 91.

                                                                            1. 2

                                                                              The Proton UI is now default, and standard. It’s a different kind of normal.

                                                                          1. 1

                                                                            Still no icons on the desktop …

                                                                            1. 17

                                                                              What do you mean “still”? This is obviously a design decision, not just something they couldn’t yet find time to get to.

                                                                              1. 6

                                                                                They’re onto something. My Mac desktop is perpetually full of random disorganized files that I occasionally dump into “old” folders, creating sediment layers of garbage.

                                                                                1. 4

                                                                                  It’s one of those things that either work for you or they don’t. And it looks like there’s enough people in both camps to not let there be one correct solution.

                                                                                  My desktop is basically a temp/work/todo space with a handful of things that never get out of control. A matter of habit.

                                                                                  1. 2

                                                                                    Yeah, I really hate the forced no-desktop design of some DEs (GNOME & Pantheon). Why can’t they just have an option to enable/disable the desktop like in Windows? I also like to drag temporary files to my desktop and I pretty consistently tidy them up. I find not being able to use a desktop really hinders my workflow

                                                                                    1. 1

                                                                                      It’s one of those things that either work for you or they don’t.

                                                                                      Funny that you say that. I used to be 100% strict “desktop is clean and minimal” for like 20 years, and only in the last few years it’s been a dump of temp things and screenshots. Only on Windows (private, games) though, where I don’t have a shell open all day like on a work machine

                                                                                    2. 1

                                                                                      I like to make the desktop icons uncomfortably large. It motivates me to clean them up.

                                                                                      1. 1

                                                                                        On the first of the month, I try to go through and clean up my desktop, downloads folder, and tabs. It’s better than before but still inconsistent.

                                                                                    3. 2

                                                                                      For a desktop system that seems the most stupid decision you can make …

                                                                                      I have tried to put elementaryOS on my buddy’s laptop - he really liked it but really missed the icons on the desktop - so I installed caja and thunar to enable them by hand. The whole ‘experience’ went to trash as caja or thunar ‘desktop icons’ are not well integrated into elementaryOS DE …

                                                                                      I have put Ubuntu Mate with ‘Cupertino’ layout to him instead and e could not be happier.

                                                                                      I am not a ‘target’ for elementaryOS so I do not care that much but IMHO they lose a lot of ‘typical’ desktop users that have used icons on the desktop since decades.

                                                                                      Just my $0.02 here.

                                                                                    1. 4

                                                                                      Gmail email size is silly today.

                                                                                      Their 25MB per email limit is so 1999 …

                                                                                      1. 2

                                                                                        As its open source I really wish author would ‘port’ it to Linux/FreeBSD.

                                                                                        SumatraPDF is so good that I use it daily on FreeBSD using WINE instead of some ‘native’ PDF viewer - I use mupdf for ‘fast’ displaying the PDF file but when I want to read a lot then sumatraPDF is the way.

                                                                                        I do not like the newer versions tho - stayed at SumatraPDF 2.5.2 - works best for me.