Skip Navigation

Posts
5
Comments
271
Joined
3 yr. ago

Interests: programming, video games, anime, music composition

I used to be on kbin as e0qdk@kbin.social before it broke down.

  • Here's one of mine. I got annoyed at the complexity of other command line spellcheckers I tried and replaced them with this simple python script for when I just want to check if a single word is correct:

     
            #!/usr/bin/env python3
    
        import sys
    
        try:
          query = sys.argv[1].lower()
        except Exception:
          print("Usage: spellcheck <word>")
          exit(1)
    
        with open("/usr/share/dict/words") as f:
          words = f.readlines()
    
        words = [x.strip().lower() for x in words if len(x.strip()) > 0]
    
        if not query in words:
          print("Not in dictionary -- probably a typo")
          exit(1)
        else:
          print("OK")
          exit(0)
      
  • Deleted

    Permanently Deleted

    Jump
  • No; I don't use AI at all for programming currently.

  • I just ssh in and use the remote computer's shell (typical bash on the remote side via gnome-terminal on my local Mint system) or mount a remote directory (via sftp) if I want to use a GUI editor. Not sure what hoops you have to jump through on Mac since I don't use it these days. I'd assume you can ssh into a remote system from Mac's default terminal app still? (I learned a bunch of Unix basics on OS X in a class ~20 years ago; it worked back then, at least...)

  • Ecclesiastes surprised me though - that one was interesting.

    Same. That's one of a few parts I'm planning to go back and re-read eventually. I don't know if I have a favorite part, but that definitely grabbed my attention.

    In general, I'd say the parts worth my time, in addition to Ecclesiastes, were the first 5 books of the Old Testament (Torah equivalent), some of the histories, and the Gospels. I didn't really care for the seemingly endless letters of Paul et al, the Psalms, Proverbs, or the prophets generally. It's possibly I didn't have the right perspective/context to appreciate them. I did find the fact that there are words -- like "selah" -- which we don't actually know the meaning of to be interesting though, and, of course, seeing names and the sources for references I've encountered in other media was also interesting. (e.g. the title "Malachi" of the last book of the Old Testament jumped out at me because of Futurama even though the book itself didn't leave a strong impression when I read it.)

  • It's an imitation xkcd -- from here.

  • I thought I wanted to be a game developer back then and was making a bunch of hobby projects with Game Maker, had taught myself C++ (to a mediocre level), was writing (not very good) music, and generally burning myself the fuck out. -.-

    The programming turned into a career (not in gamedev though). Everything else turned into an anxiety disorder.

  • Indeed -- it is out of copyright. KJV is available for free here: https://www.gutenberg.org/ebooks/10 (among other places)

    I've read it cover-to-cover (excepting some parts like the census results in Numbers that I skimmed) despite not being a Christian. It is a rather challenging read.

  • I'm a kitty cat

    and I have a

    box box box

    in my

    box box box 🎶️

  • Adding onto this: 3D TVs

  • Really?

    No. The link is to a ~6 year old advertisement. The author interviewed was using weird American culture war bullshit from 2019 to try to get you to buy their book.

    Nuts to that. History belongs to all of us, and anyone can poke fun at the Romans if they want to.

  • Any clocks that aren't synchronized periodically will diverge... but I honestly have no idea why the clocks in computers drift as quickly as they do.

  • To be clear, I didn't make the community! I just make a lot of silly drawings in response to posts... :3

  • If it doesn't connect to the internet, it should be able to just keep doing what it's doing indefinitely. You will eventually get a significant amount of clock drift if it can't update the time from the network but you can manually set the time once in a while to fix that.

  • The bathroom. Better to go before you go!

  • the amd ai max+ 395 PCs that are out

    Most of these are SFF and don't have much (if any) capability to fit HDDs inside. They're not the right choice if you want a lot of bulk storage in a single box.

  • Deleted

    Permanently Deleted

    Jump
  • There are parasitoid wasps that lay eggs inside other species of insect and have a symbiotic relationship with polydnaviruses that suppress the host's immune system so it doesn't attack the wasp eggs.

    Basically, if you're an unlucky caterpillar, ant, or whatever, a wasp may come along, penetrate you with its girldick (ovipositor), and give you insect AIDS so that its young can hatch inside you and eat your still living flesh...

  • There's something else going on there besides base64 encoding of the URL -- possibly they have some binary tracking data or other crap that only makes sense to the creator of the link.

    It's not hard to write a small Python script that gets what you want out of a URL like that though. Here's one that works with your sample link:

     
            #!/usr/bin/env python3
    
        import base64
        import binascii
        import itertools
        import string
        import sys
    
        input_url = sys.argv[1]
        parts = input_url.split("/")
          
        for chunk in itertools.accumulate(reversed(parts), lambda b,a: "/".join([a,b])):
          try:
            text = base64.b64decode(chunk).decode("ascii", errors="ignore")
            clean = "".join(itertools.takewhile(lambda x: x in string.printable, text))
            print(clean)
          except binascii.Error:
            continue
    
    
      

    Save that to a file like decode.py and then you can you run it on the command line like python3 ./decode.py 'YOUR-LINK-HERE'

    e.g.

     
            $ python3 ./decode.py 'https://link.sfchronicle.com/external/41488169.38548/aHR0cHM6Ly93d3cuaG90ZG9nYmlsbHMuY29tL2hhbWJ1cmdlci1tb2xkcy9idXJnZXItZG9nLW1vbGQ_c2lkPTY4MTNkMTljYzM0ZWJjZTE4NDA1ZGVjYSZzcz1QJnN0X3JpZD1udWxsJnV0bV9zb3VyY2U9bmV3c2xldHRlciZ1dG1fbWVkaXVtPWVtYWlsJnV0bV90ZXJtPWJyaWVmaW5nJnV0bV9jYW1wYWlnbj1zZmNfYml0ZWN1cmlvdXM/6813d19cc34ebce18405decaB7ef84e41'
        https://www.hotdogbills.com/hamburger-molds/burger-dog-mold
    
    
      

    This script works by spitting the URL at '/' characters and then recombining the parts (right-to-left) and checking if that chunk of text can be base64 decoded successfully. If it does, it then takes any printable ASCII characters at the start of the string and outputs it (to clean up the garbage characters at the end). If there's more than one possible valid interpretation as base64 it will print them all as it finds them.

  • Nginx is running in Docker

    Are you launching the container with the correct ports exposed? You generally cannot make connections into a container from the outside unless you explicitly tell Docker that you want it to allow that to happen... i.e. assuming you want a simple one-to-one mapping for HTTP and HTTPS standard ports are you passing something like -p 80:80 -p 443:443 to docker run on the command line, adding the appropriate ports in your compose file, or doing something similar with another tool for bringing the container up?