WTF Bites



  • @HardwareGeek Pft. On x86 (not-64), you already have so few registers, so might as well use those that you got. Also spilling to the stack is slow, so what do you need to keep a stack pointer around for? :half-trolleybus-l:



  • @Steve_The_Cynic said in WTF Bites:

    @Tsaukpaetra said in WTF Bites:

    if the Live Wallpaper crashes

    This is :trwtf: in all this. Live Wallpaper? :wtf: is that about? It's the pretty coloured thing behind all the icons, right? What are you doing there, running Leo Christopherson's Dancing Demon(1) or something?

    I don't use a Live Wallpaper myself, but I have seen others showing the weather and a fish tank.



  • @Tsaukpaetra said in WTF Bites:

    It's a tiny little app that displays stars streaking across the screen.

    but_why.gif



  • Because he got tired of the running cat?



  • @Zerosquare Do you think that @Tsaukpaetra also crash when the wallpaper crash?



  • Hmmm. Let's try this out.

    @Tsaukpaetra, what do you think of this picture?
    https://www.extremetech.com/wp-content/uploads/2020/06/1.jpg


  • Notification Spam Recipient

    @TimeBandit said in WTF Bites:

    @Tsaukpaetra said in WTF Bites:

    It's a tiny little app that displays stars streaking across the screen.

    but_why.gif

    Because back when almost all of my apps were transparent it was a really cool effect. :mlp_shrug:

    Sadly, Google has made transparent apps basically impractical so it's just my background I see on occasion.


  • Notification Spam Recipient

    @Zerosquare said in WTF Bites:

    Hmmm. Let's try this out.

    @Tsaukpaetra, what do you think of this picture?
    https://www.extremetech.com/wp-content/uploads/2020/06/1.jpg

    I don't think much about it at all.


  • Discourse touched me in a no-no place

    @topspin said in WTF Bites:

    The only thing I don't get was that, iirc, the code still used something like: trivial version for very short blocks, AVX stuff for medium blocks, rep instructions for long blocks, as the special instruction had a too high warm-up overhead. Why not include that in the micro-code and make the easiest solution always the fastest?

    Very short memcpy()s (up to the size of two machine words, and between memory already cached) tend to come up quite a lot in code generated by the compiler when it can't quite figure out if it's allowed to do something better. Commonly a later stage optimise can clear that mess out, but very much not always. In those cases, just doing the setup for calling memcpy() is close to as expensive as doing the copies themselves.



  • @Zerosquare said in WTF Bites:

    Hmmm. Let's try this out.

    @Tsaukpaetra, what do you think of this picture?
    https://www.extremetech.com/wp-content/uploads/2020/06/1.jpg

    Terribly unnatural colors. Must vomit.
    🤢
    🤮



  • @Zerosquare said in WTF Bites:

    what do you think of this picture? <snip />

    It makes me wish there were mountains nearby. 😢


  • BINNED

    @Tsaukpaetra said in WTF Bites:

    back when almost all of my apps were transparent

    WHAT. THE. FUCK?! :wtf_owl:

    Why are you always going out of your way to make the user experience as bad as possible?!


  • Discourse touched me in a no-no place

    @Zerosquare said in WTF Bites:

    what do you think of this picture?

    Is that sunrise or sunset? (I've seen light like that on a number of occasions; the sun is coming in at an angle so that it is catching the underside of the clouds.)


  • 🚽 Regular

    @Tsaukpaetra said in WTF Bites:

    @Zerosquare said in WTF Bites:

    Hmmm. Let's try this out.

    @Tsaukpaetra, what do you think of this picture?
    https://www.extremetech.com/wp-content/uploads/2020/06/1.jpg

    I don't think much about it at all.

    Well, you've upvoted it. Surely that means something.



  • And he didn't crash...


  • Notification Spam Recipient

    @topspin said in WTF Bites:

    @Tsaukpaetra said in WTF Bites:

    back when almost all of my apps were transparent

    WHAT. THE. FUCK?! :wtf_owl:

    Why are you always going out of your way to make the user experience as bad as possible?!

    Hello there! Nice to meet you, I'm Tsaukpaetra! I give best scritches, ask any of my bitches.



  • @Zecc said in WTF Bites:

    Well, you've upvoted it. Surely that means something.

    YMBNH!

    edit: inb4 :thats_the_joke:



  • @Zerosquare

    Also good news: this bug will not be an issue once Android 11 lands later this year.

    That's quite optimistic


  • Fake News

    @hungrier INB4 "Google kills the phone background image" - fixed, no longer an issue.



  • I was doing some scripting with Ansible today, and needed to use the primary IP address of the target system. Well, when ansible starts, it first collects all sorts of useful info about the target, so that should be easy. The documentation here has an example of the collected data:

    {
        …
        "ansible_default_ipv4": {
            "address": "REDACTED",
        …
    

    That's strange, it said before that it's in variable ansible_facts. Let's check by running the setup by hand:

     ansible -i inventory.yaml target -m setup
    
    {
        "ansible_facts": {
            …
            "ansible_default_ipv4": {
                "address": "REDACTED",
        …
    

    Oh, it is. Fine, let's write the template

          value: "{{ ansible_facts.ansible_default_ipv4.address }}"
    

    um… no, no such variable? :wat:? So how the hell do I debug it. Oh, I put in a

    tasks:
      - debug: var=ansible_facts
    

    and run with ansible-playbook -i inventory.yaml target playbook.yaml and, voila

    {
        "ansible_facts": {
            …
            "default_ipv4": {
                "address": "REDACTED",
        …
    

    :wat:? How is the same variable called ansible_default_ipv4 when run as a single command, but default_ipv4 when run from a playbook? It's supposed to be one and the same setup module…

    Yes, {{ ansible_facts.default_ipv4.address }} does work. But :wtf:.



  • The other part of the same issue. Well, I was setting up microk8s. Now it mostly sets itself up without intervention, but if you want to access it from another computer, you must tweak the certificate it creates for the API server. There is a template in /var/snap/microk8s/current/certs/csr.conf.template and you have to add the external hostname and IP address there. The template looks like:

    …
    [ req_ext ]
    subjectAltName = @alt_names
    
    [ alt_names ]
    DNS.1 = kubernetes
    DNS.2 = kubernetes.default
    DNS.3 = kubernetes.default.svc
    DNS.4 = kubernetes.default.svc.cluster
    DNS.5 = kubernetes.default.svc.cluster.local
    IP.1 = 127.0.0.1
    #MOREIPS
    …
    

    Great. It's INI, so I can use the Ansible's INI editor…

        - name: fix the api server certificate
          ini_file:
            path: /var/snap/microk8s/current/certs/csr.conf.template
            section: 'alt_names'
            option: DNS.6
            value: "{{ inventory_hostname }}"
    

    Except, OOPS, that just adds

    [alt_names]
    DNS.6 = target
    

    at the end. Because it does not expect spaces in the []. Fortunately

            section: ' alt_names '
    

    does work. But why the F do openssl configs have spaces inside the square brackets‽ (Yes, the default one in /etc/ssl/openssl.conf does as well).



  • And the third :wtf:. The target system does have a DNS record. So :wtf: does it have this in /etc/hosts

    127.0.0.1 localhost
    127.0.1.1 target
    

    That way even though there is a correct search domain.company.com stanza in /etc/resolv.conf, the hostname -f does not find the full hostname, because the bare hostname is in /etc/hosts and thus it looks no further. It either must not be there – which is the appropriate approach if the DNS does know the host – or must be there also fully qualified – which is more appropriate for computers that either don't have DNS or have transient network connection.

    Also, I actually found this last point some time ago when I was helping a colleague install something else also with Ansible and in that particular script broke if the hostname resolved to different IP on the host and externally, so in that case 127.0.1.1 was a problem even if it did include the qualified version.


  • Notification Spam Recipient

    Status: I love how this about-to-be-published game has a project folder name of "GamePrototype" and the main (and only) scene is named SampleScene.


  • Notification Spam Recipient

    Status: I am floored.

    ebca7890-a145-4806-a8ed-e5533498288a-image.png

    "We need to wait for X to be online. Let's ping Y 20 times as a delay!"

    For that matter, ping a guaranteed-non-responding IP with a specified timeout (and send the output to nul, natch)!



  • @Tsaukpaetra said in WTF Bites:

    Let's ping Y 20 times as a delay!

    Unfortunately, there is no WAIT command in windows batch. So typically you ping some other machine for a number of times instead...
    You're right, that's
    :trwtf:


  • Considered Harmful

    @BernieTheBernie said in WTF Bites:

    Unfortunately, there is no WAIT command in windows batch.

    There is, although only since Windows 7. It's called timeout.



  • @Applied-Mediocrity said in WTF Bites:

    There is, although only since Windows 7.

    Nobody expected Microsoft to add anything to the shell in Windows 7, so most never noticed.



  • @BernieTheBernie said in WTF Bites:

    @Tsaukpaetra said in WTF Bites:

    Let's ping Y 20 times as a delay!

    Unfortunately, there is no WAIT command in windows batch. So typically you ping some other machine for a number of times instead...
    You're right, that's
    :trwtf:

    No, :trwtf: is using WIndows batch file for AWS EC2 deployment. Seriously, this is front-page material.



  • @Kamil-Podlesak said in WTF Bites:

    No, is using WIndows batch file for AWS EC2 deployment. Seriously, this is front-page material.

    What would be your suggestion?

    And quite seriously, I am doing some deployments (Azure and on-prem, but I don't think the basic tools should be different) and so far I am finding that I always end up having to glue bunch of different tools with some shell (unix one in my case, but that's still shell).


  • Discourse touched me in a no-no place

    @Bulb said in WTF Bites:

    I always end up having to glue bunch of different tools with some shell

    We have a separate repository of little glued together tools for testing and deployment. Much easier than trying to keep copies of the tools in sync all over the place.


  • Grade A Premium Asshole

    @Applied-Mediocrity Thanks. TIL.

    :trwtf: is the German localization of that command, however.

    Here's the original documentation:

    C:\>timeout /?
    
    TIMEOUT [/T] Zeitlimit [/NOBREAK]
    
    Beschreibung:
        Dieses Dienstprogramm verwendet einen Zeitlimitparameter, so dass
        der angegebene Zeitraum (in Sekunden) verstreicht oder eine Taste
        gedrückt wird. Außerdem ignoriert der Befehl den Tastendruck durch
        eine Parametereingabe.
    
    Parameterliste:
        /T        Zeitlimit     Bestimmt die Wartezeit in Sekunden.
                                Gültiger Bereich: -1 bis 99999 Sekunden.
    
        /NOBREAK                Ignoriert gedrückte Tasten und wartet laut
                                dem angegebenen Zeitraum.
    
        /?                      Zeigt diese Hilfe an.
    
    HINWEIS: Ein Zeitüberschreitungswert von -1 bedeutet, dass unendlich
             lang auf einen Hauptprozess gewartet wird.
    
    Beispiele:
        TIMEOUT /?
        TIMEOUT /T 10
        TIMEOUT /T 300 /NOBREAK
        TIMEOUT /T -1
    
    

    My attempt at translating this back into English:

    TIMEOUT [/T] time_limit [/NOBREAK]
    
    Description:
        This service program uses a time limit parameter, so that the
        specified time span (in seconds) passes or a key is pressed. Aside
        from that the command ignores the keypress through a parameter
        input.
    
    Parameter list:
        /T        time limit     Determines the waiting time in seconds.
                                 Valid range: -1 to 99999 seconds.
    
        /NOBREAK                 Ignores pressed keys and waits, according
                                 to the specified time span.
    
        /?                       Displays this help.
    
    NOTE: A time exceedance value of -1 means waiting infinitely long for
          a main process.
    
    Examples:
        TIMEOUT /?
        TIMEOUT /T 10
        TIMEOUT /T 300 /NOBREAK
        TIMEOUT /T -1
    

    Ah, yes. I feel enlightened.



  • @BernieTheBernie said in WTF Bites:

    @Tsaukpaetra said in WTF Bites:

    Let's ping Y 20 times as a delay!

    Unfortunately, there is no WAIT command in windows batch. So typically you ping some other machine for a number of times instead...
    You're right, that's
    :trwtf:

    Why not pung the actual machine it's waiting for?


  • Grade A Premium Asshole

    Employee of client is currently emailing Helpdesk because she has pictures from some conference on her phone and wants to print them in the office. Her printer at home can print via Bluetooth and it seems to be blowing her mind that the large professional Kyocera workstation printers in the office can't do that. We're up to 12 replies. I noticed it around reply #10.

    My guy has offered plenty of alternatives. Upload to any file sharing service and download, download the files via USB, etc.

    A lot of the time stuff like this might not be a separate billable item. I sent him a chat message to make goddamned sure that it was and to include a link to the support transcript in the line item.



  • @dkf said in WTF Bites:

    @Bulb said in WTF Bites:

    I always end up having to glue bunch of different tools with some shell

    We have a separate repository of little glued together tools for testing and deployment. Much easier than trying to keep copies of the tools in sync all over the place.

    I am also putting into a repository and trying to be consistent and all that stuff. But it's still a ball of mud tools glued together with duct tape and spit shell that tends to break when you look at it wrong.



  • @bugmenot Some time ago someone at Microsoft concluded that now they have Bing Translate, they don't need to spend more money on translating documentation and started feeding the documentation through the automated translation instead. I thought the German, being closer to English, would fare a bit better, but apparently Bing Translate is still that big PoS.


  • Notification Spam Recipient

    @hungrier said in WTF Bites:

    @BernieTheBernie said in WTF Bites:

    @Tsaukpaetra said in WTF Bites:

    Let's ping Y 20 times as a delay!

    Unfortunately, there is no WAIT command in windows batch. So typically you ping some other machine for a number of times instead...
    You're right, that's
    :trwtf:

    Why not pung the actual machine it's waiting for?

    My guess is that it has a dynamically-assigned public IP that is not guaranteed to be consistent, and I guess DNS isn't a thing so it's impossible to get that information at any point before the machine is up and running.

    Or so my brainworms are telling me.


  • Notification Spam Recipient

    Status: Trying to sign in to my account from another PC.

    bc7eeec2-fe00-4ab7-879c-84d5ba8fda70-image.png

    What the fuck. This worked on the other one!?!



  • @Bulb said in WTF Bites:

    @Kamil-Podlesak said in WTF Bites:

    No, is using WIndows batch file for AWS EC2 deployment. Seriously, this is front-page material.

    What would be your suggestion?

    And quite seriously, I am doing some deployments (Azure and on-prem, but I don't think the basic tools should be different) and so far I am finding that I always end up having to glue bunch of different tools with some shell (unix one in my case, but that's still shell).

    Yes, unix shell is usually what I do in most cases, too. I suppose powershell would be good option for Windows platform.
    I personally like ansible, but it's limited by selection of good modules (and AWS modules are quite.... not good). Recently (last year) we did some complicated automated AWS management (deployment, un-deployment, etc) in typescript and it worked quite well (the aws library is pretty good).

    But batch file? Yes, it's shell, I suppose. And chicken is a dinosaur.


  • Banned

    @Tsaukpaetra said in WTF Bites:

    @hungrier said in WTF Bites:

    @BernieTheBernie said in WTF Bites:

    @Tsaukpaetra said in WTF Bites:

    Let's ping Y 20 times as a delay!

    Unfortunately, there is no WAIT command in windows batch. So typically you ping some other machine for a number of times instead...
    You're right, that's
    :trwtf:

    Why not pung the actual machine it's waiting for?

    My guess is that it has a dynamically-assigned public IP that is not guaranteed to be consistent, and I guess DNS isn't a thing so it's impossible to get that information at any point before the machine is up and running.

    Or so my brainworms are telling me.

    The script is pinging Google. It's clear as day that the author spent exactly 0 milliseconds thinking this through.


  • Discourse touched me in a no-no place

    @Zerosquare said in WTF Bites:

    We didn't consider that the custom location chosen by players could also have files belonging to other programs in it.

    Late to this one. ISTR some (un)installer or somesuch that failed to check for empty variables and ended up deleting a tad more than it should have done (entire $HOME directory if memory serves.)

    Google-foo's deserted me for it though.

    Think of something like this one-man FUBAR..

    But by a software/game company rolling it out to quite a few punters..





  • Oh, and it appears you can have fun under Windows, too:

    The uninstallation process deletes the folder Steam was installed to to ensure it is fully uninstalled. If you accidentally installed Steam to a folder containing other data, for example C:\Program Files\ instead of C:\Program Files\Steam, STOP! Do not run the uninstaller and instead carefully follow the instructions below for Manually Removing Steam, except only delete Steam-related files in step 3.

    Because documenting is better than fixing this "feature".


  • Discourse touched me in a no-no place

    @dkf said in WTF Bites:

    The code in question is packing values into a buffer that's going to be sent out on the network (with a defined format) and the idiots who defined the protocol made it that in some configurations (not all, but actually the ones that come up most often in practice) you end up having to stuff 32-bit integers at half-word boundaries.

    @dkf said in WTF Bites:

    If only there was a good way to declare a type as being a "pointer to a 32-bit unsigned integer with half-word alignment”

    Since, surprisingly, no-one appears to have picked up on this,

    I have a question.....

    Why are pointers going over a network?


    And apart from that question - did no one think of this?:



    Anyway, elsethread...

    @Bulb said in WTF Bites:

    Getting the base-64 strings without their padding is the :wtf: here.

    Oh yes. I created a library a while back to deal with base64 and siblings. According to their RFC's. Tests and everything. I was almost proud of myself for the tests bit. (Slow week - I was able to do things properly for once.)

    I had need of that library outside of that environment and copied it wholesale to the new environment (think plucking about 4 files out of a gargantuan 10-yr old svn repo for a whole OS, over to a small git project producing one binary.)

    Compiled fine. Tests worked.

    Then attempted to use them against JWT.

    Fail.

    3 hours later...; :headdesk: ...

    And I quote:

    Base64url Encoding For the purposes of this specification, this term
    always refers to the URL- and filename-safe Base64 encoding
    described in RFC 4648 [RFC4648], Section 5, with the (non URL-
    safe) '=' padding characters omitted
    , as permitted by Section 3.2.
    (See Appendix C of [JWS] for notes on implementing base64url
    encoding without padding.)

    How stupid of me to not bother reading the rather specific JWT RFC's, when writing a generic library to handle base$X encoding...


  • Discourse touched me in a no-no place


  • Discourse touched me in a no-no place

    @Zerosquare said in WTF Bites:

    Syncing clocks is hard, let's go fining people!

    Or firing them.

    https://what.thedailywtf.com/post/1683909 (Lounge)



  • @PJH said in WTF Bites:

    Why are pointers going over a network?

    Isn't @dkf working on a machine where "network" is means "communication with other nodes of the same machine"?


  • Discourse touched me in a no-no place

    This post is deleted!

  • Discourse touched me in a no-no place

    @Zerosquare said in WTF Bites:

    Isn't @dkf working on a machine where "network" is means "communication with other nodes of the same machine"?

    Generically (specific situations, which is what I'm asking about will differ):

    Only useful if you have sufficient control over the environment that you can guarantee one executable on one box has the same memory mapping as that of another machine.

    Machine A: Here, have some data $X and store it in $ADDR.

    Machine B: OK, I'll go stick it in $ADDR

    Unless it's a very controlled environment, I can't see how that's even a.. thing?



  • My understanding is that @dkf's target hardware precisely matches the "very controlled environment" statement.

    In general cases, yeah, it makes no sense.


  • BINNED

    @PJH said in WTF Bites:

    @dkf said in WTF Bites:

    The code in question is packing values into a buffer that's going to be sent out on the network (with a defined format) and the idiots who defined the protocol made it that in some configurations (not all, but actually the ones that come up most often in practice) you end up having to stuff 32-bit integers at half-word boundaries.

    @dkf said in WTF Bites:

    If only there was a good way to declare a type as being a "pointer to a 32-bit unsigned integer with half-word alignment”

    Since, surprisingly, no-one appears to have picked up on this,

    I have a question.....

    Why are pointers going over a network?

    I don't see anywhere that he said they are.
    Packed structs are going over the network, not pointers. The struct members are misaligned, so handling them natively doesn't work and he casts misaligned pointers to 32-bit ints to aligned pointers to 16-bit ints.


Log in to reply