• 1 Post
  • 52 Comments
Joined 2 years ago
cake
Cake day: July 24th, 2023

help-circle

  • In the end I’ve used the first command you wrote, because KISS, but I appreciate your explanation

    There’s no shame in combining multiple tools, that’s what pipelines are all about 😄.

    Also there’s a different tool that I would use if I want to output a specific column: awk

    df -h —output=avail,source | awk ‘/\/dev\/dm-2/ {print $1}’
    

    For lines matching /dev/dm-2 print the first column. awk splits columns on whitespace by default.

    But I would probably use grep+awk.

    Sed is definitely a very powerful tool, which leads to complex documentation. But I really like the filtering options before using the search/replace.

    You can select specific lines, with regex or by using a line number; or you can select multiple lines by using a comma to specify a range.

    E.g. /mystring/,100s/input/output/g: in the lines starting from the first match of /mystring/ until line 100, replace input with output


  • The easiest way is probably without sed, which you mentioned:

    df -h --output=avail /dev/dm-2| tail -n1
    

    But purely with sed it would be something like this:

    df -h --output=avail,source | sed -n ‘/\/dev\/dm-2/s!/dev/dm-2!!p’
    

    -n tells sed to not print lines by default

    /[regex]/ selects the likes matching regex. We need to escape the slashes inside the regex.

    s/// does search-and-replace, and has a special feature: it can use any character, not just a slash. So I used three exclamation points instead , so that I don’t need to escape the slashes. Here we replace the device with the empty string.

    p prints the result

    Check the sed man page for more details: https://linux.die.net/man/1/sed







  • Exactly, permissive licenses such as MIT allow for other people to do a rugpull and change the deal (pray I don’t alter it any further). With open source licenses the community can just fork.

    That’s why I always pick AGPL for my projects. Then I can be certain that the code can be freed from greedy hands, and the actual users get all the value of the effort I put in.

    VC funding really is making a deal with the devil, because you suddenly have a huge amount of cash, so the startup starts living large (hire more devs, run on expensive cloud infrastructure). But sooner or later they want their money back, plus interest; and few services are profitable, let alone that profitable. So the only thing that startups are usually capable of is to squeeze their users for all they’re worth.

    Take a look at all the big startups and see:

    • how long it took for them to be profitable
    • how much VC funding they got until then

    Companies need to pay that back and then some.

    And don’t forget that VC’s see this as a perpetual investment, so your revenue must grow year after year, even if you’ve saturated the market.





  • The details depend a bit on the audiostack of your distro, but they all have a cli program with which you can change inputs/outputs and volume; e.g. pactl for pulseaudio and wpctl for wireplumber.

    You’ll need a mechanism to find your triggers (I create a firefox tab with youtube/spotify, I have a music player active) and then you can act on it.

    Detecting voice in an audiostream is probably technically possible, but that sounds pretty hard to setup.








  • IIRC, within RHEL it goes fedora (next major) -> centos stream (next minor) -> RHEL (current major.minor).

    With Debian and its derivatives (e.g Ubuntu) this means that Debian-unstable corresponds to fedora, Debian-testing corresponds to CentOS stream and Debian-stable corresponds to RHEL. (Roughly of course).

    Ubuntu is based off of some flavor of Debian and is therefore downstream of it: Debian (unstable I think) -> Ubuntu -> Ubuntu LTS.

    But as far as which version has the newest packages then sure, your list is correct.