GNU social JP
  • FAQ
  • Login
GNU social JPは日本のGNU socialサーバーです。
Usage/ToS/admin/test/Pleroma FE
  • Public

    • Public
    • Network
    • Groups
    • Featured
    • Popular
    • People

Notices by aliss (aliss@outerheaven.club), page 3

  1. Embed this notice
    aliss (aliss@outerheaven.club)'s status on Monday, 19-Sep-2022 08:40:09 JST aliss aliss
    in reply to
    • Hélène
    • Tosti ?
    @tost @helene except in rust land uwu
    In conversation Monday, 19-Sep-2022 08:40:09 JST from outerheaven.club permalink
  2. Embed this notice
    aliss (aliss@outerheaven.club)'s status on Monday, 19-Sep-2022 08:38:34 JST aliss aliss
    in reply to
    • Hélène
    • Tosti ?

    @tost @helene if only we had those shiny things in shell-land..

    u could do "$pattern"debian|"$pattern"fedora) in the switch case right tosti?

    In conversation Monday, 19-Sep-2022 08:38:34 JST from outerheaven.club permalink
  3. Embed this notice
    aliss (aliss@outerheaven.club)'s status on Monday, 19-Sep-2022 08:35:36 JST aliss aliss
    • Tosti ?
    @tost it also works!
    In conversation Monday, 19-Sep-2022 08:35:36 JST from outerheaven.club permalink

    Attachments


    1. https://outerheaven.club/media/735b9306-20bd-49c1-8a8d-961e4d0d33ab/Screenshot%202022-09-19%20at%2001.30.27.png
  4. Embed this notice
    aliss (aliss@outerheaven.club)'s status on Monday, 19-Sep-2022 06:59:12 JST aliss aliss
    in reply to
    • Tosti ?
    @tost i had no idea about this where can i read more about it :02think:
    In conversation Monday, 19-Sep-2022 06:59:12 JST from outerheaven.club permalink
  5. Embed this notice
    aliss (aliss@outerheaven.club)'s status on Monday, 19-Sep-2022 06:59:11 JST aliss aliss
    in reply to
    • Tosti ?
    @tost ah thx

    also, when running the tests i first noticed that because in yours debian came first of course some additional syscalls would be in place to test for the first grep, therefore i did `for i in fedora debian...` etc to make it fair
    In conversation Monday, 19-Sep-2022 06:59:11 JST from outerheaven.club permalink
  6. Embed this notice
    aliss (aliss@outerheaven.club)'s status on Monday, 19-Sep-2022 06:59:09 JST aliss aliss
    in reply to
    • Tosti ?
    • aliss

    @tost tosti tosti tosti i achieved to make mine shorter and beat yours for 18 characters ????

    mine:

    #!/bin/sh check_distro() { distro=$(sed -n 's/^\(ID\|ID_LIKE\)= *\([^ ]*\) */\2/p' /etc/os-release) case $distro in debian) : # do debian-based thing ;; fedora) : # do fedora-based thing ;; *) : # err distro not supported ;; esac } check_distro

    yours:

    #!/bin/sh check_distro() { for distro in debian fedora error do grep -qe $distro /etc/os-release && break done case $distro in debian) : # do debian-based thing ;; fedora) : # do fedora-based thing ;; *) : # err distro not supported ;; esac } check_distro
    In conversation Monday, 19-Sep-2022 06:59:09 JST from gnusocial.jp permalink
  7. Embed this notice
    aliss (aliss@outerheaven.club)'s status on Monday, 19-Sep-2022 06:17:44 JST aliss aliss
    in reply to
    • Tosti ?
    @tost so debian is not using newer glibc stuff therefore less syscalls?
    In conversation Monday, 19-Sep-2022 06:17:44 JST from gnusocial.jp permalink
  8. Embed this notice
    aliss (aliss@outerheaven.club)'s status on Monday, 19-Sep-2022 06:17:44 JST aliss aliss
    in reply to
    • Tosti ?
    @tost
    In conversation Monday, 19-Sep-2022 06:17:44 JST from outerheaven.club permalink

    Attachments


    1. https://outerheaven.club/media/b4b77d97-0304-4ad9-b258-e4a67c80ce3d/image.png
  9. Embed this notice
    aliss (aliss@outerheaven.club)'s status on Monday, 19-Sep-2022 06:17:42 JST aliss aliss
    in reply to
    • Tosti ?
    @tost im sorry master i always tend to do, i'll try to be better apprentice next time
    In conversation Monday, 19-Sep-2022 06:17:42 JST from outerheaven.club permalink
  10. Embed this notice
    aliss (aliss@outerheaven.club)'s status on Monday, 19-Sep-2022 06:17:40 JST aliss aliss
    in reply to
    • Tosti ?
    @tost oh, maybe u could shed me light into a question i have.. why fedora and debian syscall's total numbers are so different even for the same script?
    In conversation Monday, 19-Sep-2022 06:17:40 JST from gnusocial.jp permalink
  11. Embed this notice
    aliss (aliss@outerheaven.club)'s status on Monday, 19-Sep-2022 06:15:25 JST aliss aliss
    in reply to
    • Tosti ?
    • aliss
    @tost i have to confess, while your solution is 19 chars less..
    mine is 84 syscalls more efficient.. :acat_hearteyes: (only in fedora, in debian is only 1 syscall more efficient): https://pastebin.com/kn4tLtEX
    In conversation Monday, 19-Sep-2022 06:15:25 JST from outerheaven.club permalink

    Attachments

    1. Domain not in remote thumbnail source whitelist: pastebin.com
      # Straces## Debian```consoledebian-gnu-linux-11:~/Documents$ sudo stra - Pastebin.com
      Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
  12. Embed this notice
    aliss (aliss@outerheaven.club)'s status on Monday, 19-Sep-2022 05:19:07 JST aliss aliss
    in reply to
    • Tosti ?
    @tost u're so smart tosti h o w i've put many hours into shell when i grow up i want to be smart like u,,
    In conversation Monday, 19-Sep-2022 05:19:07 JST from gnusocial.jp permalink
  13. Embed this notice
    aliss (aliss@outerheaven.club)'s status on Monday, 19-Sep-2022 05:14:37 JST aliss aliss
    in reply to
    • Tosti ?
    @tost the switch case would have to be inside the loop right?
    In conversation Monday, 19-Sep-2022 05:14:37 JST from gnusocial.jp permalink
  14. Embed this notice
    aliss (aliss@outerheaven.club)'s status on Monday, 19-Sep-2022 05:14:35 JST aliss aliss
    in reply to
    • Tosti ?
    @tost omg i just realised in the shower that is genius!!!!
    lemme have dinner and i will explain im so!!!
    In conversation Monday, 19-Sep-2022 05:14:35 JST from gnusocial.jp permalink
  15. Embed this notice
    aliss (aliss@outerheaven.club)'s status on Monday, 19-Sep-2022 05:14:33 JST aliss aliss
    in reply to
    • Tosti ?
    • aliss
    @tost a i see you explained below also, still i will explain later im so excited aaaaaa
    In conversation Monday, 19-Sep-2022 05:14:33 JST from outerheaven.club permalink
  16. Embed this notice
    aliss (aliss@outerheaven.club)'s status on Monday, 19-Sep-2022 05:14:32 JST aliss aliss
    in reply to
    • Tosti ?
    • aliss

    @tost so, first: u’re amazing, can you believe i never thought before of doing it like this?

    the var is set after the loop finishes, so you can reuse it later!

    i was approaching it something like (1), where my thought process was: first i query the data, then i switch/case, decide what to do after

    but your approach (2) goes like the following: you make up a list of your own and run queries, if the query fails more things are queried, but if it goes okay you exit it and save it, you’re using the query as a control flow thing, and because the last success value will be stored in the var loop, you can parse with switch/case later! finally, there’s an extra element in the loop list to not always end with one of the true options!

    your (2) is very smart and creative! yes the thought process of it may not be as straightforward as “just query data then parse it”, and you’re using the querying line as something to control the loop but it’s amazing! ???

    it made me realise i barely ever use break statements smol brain :02think:

    thx a lot u’re great :02_cheer:

    (1):

    check_distro() { distro=$( grep -Po "(?<=^ID_LIKE=).+" /etc/os-release || grep -Po "(?<=^ID=).+" /etc/os-release ) case "$distro" in "debian"*) : # do debian-based thing ;; "fedora"*) : # do fedora-based thing ;; *) : # err distro not supported ;; esac }

    (2):

    check_distro2() { for distro in debian fedora error do grep -qe $distro /etc/os-release && break done case "$distro" in "debian"*) : # do debian-based thing ;; "fedora"*) : # do fedora-based thing ;; *) : # err distro not supported ;; esac }
    In conversation Monday, 19-Sep-2022 05:14:32 JST from gnusocial.jp permalink
  17. Embed this notice
    aliss (aliss@outerheaven.club)'s status on Monday, 19-Sep-2022 05:14:30 JST aliss aliss
    in reply to
    • Tosti ?

    @tost you’re right my bad!

    (3)

    check_distro3() { for distro in debian fedora error do grep -qe $distro /etc/os-release && break done case $distro in debian) : # do debian-based thing ;; fedora) : # do fedora-based thing ;; *) : # err distro not supported ;; esac }
    In conversation Monday, 19-Sep-2022 05:14:30 JST from gnusocial.jp permalink
  18. Embed this notice
    aliss (aliss@outerheaven.club)'s status on Monday, 19-Sep-2022 03:57:00 JST aliss aliss
    in reply to
    • Hélène
    • Tosti ?
    • marcille_ebooks ??:coffefiedred:

    @tost @schappi @helene

    funnily i had a very similar looking function in my own shell lib..

    has() { _cmd=$(command -v "$1") 2>/dev/null || return 1 [ -x "$_cmd" ] || return 1 }

    the earth (shell) is round truly

    In conversation Monday, 19-Sep-2022 03:57:00 JST from outerheaven.club permalink
  19. Embed this notice
    aliss (aliss@outerheaven.club)'s status on Monday, 19-Sep-2022 03:53:56 JST aliss aliss
    in reply to
    • Tosti ?
    @tost aaaa that's another way to solve it! skipping the grabbing the value entirely! :celredcrystalheart:
    In conversation Monday, 19-Sep-2022 03:53:56 JST from gnusocial.jp permalink
  20. Embed this notice
    aliss (aliss@outerheaven.club)'s status on Monday, 19-Sep-2022 02:43:29 JST aliss aliss
    in reply to
    • Tosti ?
    @tost yes but i need to grab the value from ID or ID_LIKE because im also probing for other families (like fedora-based)
    In conversation Monday, 19-Sep-2022 02:43:29 JST from gnusocial.jp permalink
  • After
  • Before

User actions

    aliss

    aliss

    she/herwitchvery reddemon of the best hell+18yes i rt my own stuffyes hiding repeats is a feature

    Tags
    • (None)

    Following 0

      Followers 0

        Groups 0

          Statistics

          User ID
          3982
          Member since
          8 Aug 2022
          Notices
          152
          Daily average
          0

          Feeds

          • Atom
          • Help
          • About
          • FAQ
          • TOS
          • Privacy
          • Source
          • Version
          • Contact

          GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.

          Creative Commons Attribution 3.0 All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.