Little programs or scripts or automations you’ve created ad-hoc to solve a particular single use case

I have lots of shortcuts i make on my phone and I have one i love that detects when bluetooth accidentally or purposefully disconnects from my speaker and reconnects it and fixes a playback glitch so its back to playing properly

  • Rose@slrpnk.net
    link
    fedilink
    arrow-up
    5
    ·
    7 days ago

    Dang, I really should write a programming portfolio page about all of the weird hacks I’ve made over the years. Other people link to their GitHub profiles in job applications and gesture non-specifically. I’d just point to my portfolio of weird hacks about weird problems I tried to solve weirdly. Anyway…

    An ancient one I made back in the day:

    I was listening to music while trying to sleep. I controlled the music player with infrared remote. Some mystery song starts playing and I have no idea what it’s called. Obviously, the monitor was far away and turned off so I couldn’t read.

    So I was like, dammit, why can’t I just push a button on the remote and have the computer say the name of the song?

    My previous project actually helped with that - I had previously made an extension for XMMS that allows other programs to read the song information via a named pipe. So I just whipped up a script that reads the song name and feeds it to Festival TTS, and hooked that up to the infrared daemon. And that was at like 3 AM, so I quickly got back to trying to sleep

    Some more recent ones:

    Long ago, I was using Adobe Photoshop Elements Organizer to import my photos from SD cards (etc) to my NAS. It was horrible. It sucked. So much that when I finally snapped and switched over to better software (read: stable version of digiKam for Windows came out), I never trusted the photo organiser to get this thing right. So for a while I used random hacks and a bunch of weird scriptery. Then I decided to turn it into a PowerShell script. That started to kinda suck, so I now have a massive overengineered Python script to import my photos. And it does exactly what I want it to do. And I’m finally happy. (Available here for what it’s worth)

    Another thingy: I have to set the clocks on some devices manually. Daylight saving time, clock drift, you name it. One of my recent old-lady whinges was “Why the hell doesn’t Windows even have an analog clock anymore?” I just prefer to have a clock that has both number display (to set the time) and analog clock face with a second hand so I can time the button press better visually. …so I made one. Because I’ve never written an analog clock before. First, I made one in Processing. Then, a second version, because I’m in process of learning Godot.

  • chunes@lemmy.world
    link
    fedilink
    arrow-up
    4
    ·
    7 days ago

    I write AHK scripts to make it possible to play certain games even though I can barely use my limbs. Often this means condensing a bunch of pointless inputs into one. Other times it means hacking controller support into a game so that I can use my preferred input devices.

    Even though I fucking hate AHK as a general language, it is easily the best language for such tasks.

  • jordanlund@lemmy.world
    link
    fedilink
    arrow-up
    34
    ·
    9 days ago

    I have a lot of comic book boxes:

    I created a script that lets me query the database to return the box numbers for certain content.

    I can search by writer, artist, title, character, notes, even down to issue number.

    What I’d LIKE to do is hook it into a voice recognition system and smart lights and get it to light up the boxes “Wheel of Fortune” style. But I’m aways off that yet.

  • baines@lemmy.cafe
    link
    fedilink
    English
    arrow-up
    19
    ·
    9 days ago

    i wrote a simple program to wiggle my mouse

    you can guess why

    it was a rip off from a coworker’s program

  • CanadaPlus@lemmy.sdf.org
    link
    fedilink
    arrow-up
    12
    ·
    edit-2
    9 days ago

    It’s not an answer, but I really hate how hard this is to do on Android, including it’s FOSS versions. You can root it and do something like that then, but that undercuts the whole system design and is a terrible hack.

    That’s like my main beef with the whole mobile ecosystem.

  • FancyPantsFIRE@lemmy.world
    link
    fedilink
    English
    arrow-up
    11
    ·
    9 days ago

    I built a script that runs on a raspberry pi with an nfc reader and speakers. It’s setup with nfc cards to play music for my kids. they don’t use it as much as they used to but it’s still going strong after four years!

  • jBoi@szmer.info
    link
    fedilink
    arrow-up
    7
    ·
    8 days ago

    I made a browser extension to make downloading Minecraft mods easier. It would scrape the curseforge page you’re visiting, search for the mod on modrinth, and redirect you if it found one. It was actually very useful when I needed it, I even put it on the extension stores and it gained some users.

    I also have a small collection of random python numpy and matplotlib utilities. I need to do some basic graphs and data analysis for uni, and this simplifies it a lot.

  • i_ben_fine@midwest.social
    link
    fedilink
    arrow-up
    8
    arrow-down
    1
    ·
    8 days ago

    A few years back, I made a python program that searched free-for-commercial-use Google Images and auto-adjusted them to fit Amazon Merch shirts and uploaded them to Amazon. This was, of course, a violation of their terms of service.

  • neidu3@sh.itjust.worksM
    link
    fedilink
    English
    arrow-up
    6
    ·
    edit-2
    9 days ago

    I mostly write utilities/tools like this. Some examples from my ~/bin/ folder:

    • A script that turns caps lock off and numlock on, and remaps caps lock to compose. I have this run by cron every minute.
    • A script that saves the current buffer of my continously running screen recorder to a file. Bound to the Lenovo coilot key.
    • A half-finished script that downloads and installs the latest version of discord, as Discord and ants me to manually upgrade it every time I start it.

    Edit: OH, and on my work laptop I have a script named Fnkeyfuckery. The keyboard layout is annoying in that I have to choose between Function keys or have Home+End.
    I want my function keys AND I want home+end. Luckily I don’t need F11 and F12 very often, so I’swapped around those two with their alternate function. That way I have F1 through F10, Home and End by default, and if I hold Fn I can have F11 and F12 too. It runs on startup.

    • Victor@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      8 days ago

      script that saves the current buffer of my continously running screen recorder to a file

      Curious to know why you are continuously recording your screen. Must fill up your hard drives really quickly?

      • neidu3@sh.itjust.worksM
        link
        fedilink
        English
        arrow-up
        2
        ·
        edit-2
        8 days ago

        Why: I case I want to show something unplanned to someone. Freak accident in a game, for example.
        Disk: It’s only keeping the latest 30 minutes in a buffer. Saving basically means copying that buffer to a different file.

        • Victor@lemmy.world
          link
          fedilink
          arrow-up
          1
          ·
          8 days ago

          Ah, cool.

          Sounds kind of like the Nvidia tool for Windows.

          Speaking of which, as well as your use case, I found this tool a while ago that looks and does pretty much the same thing: “GPU Screen Recorder”, found on flathub via “com.dec05eba.gpu_screen_recorder”.

          I hope it comes to use for anyone!

          • neidu3@sh.itjust.worksM
            link
            fedilink
            English
            arrow-up
            1
            ·
            edit-2
            8 days ago

            I based my setup around Replay Magic ReplaySorcery. I’m sure there are other packages too.

                • Victor@lemmy.world
                  link
                  fedilink
                  arrow-up
                  1
                  ·
                  edit-2
                  7 days ago

                  I read through the readme and the config file example. Looks pretty neat! I might take a look at that to see if I can use it too.

                  The last release talks about a future 1.0 release, and “experimental” stuff. But that was 4 years ago.

                  Is it inactive? 🫤

  • Björn Tantau@swg-empire.de
    link
    fedilink
    arrow-up
    6
    ·
    9 days ago

    One I miss the most is one I had on my Nokia N900. It would take a photo with both cameras, aquire the current GPS position and upload all those things to my server. Then it would check for a file on my server and if it existed would create an SSH tunnel, allowing me to SSH into the phone from my server.

    It was supposed to be an anti theft measure. Never needed it. Was still cool that the phone had this possibility.

  • stoy@lemmy.zip
    link
    fedilink
    arrow-up
    6
    ·
    edit-2
    8 days ago

    I have one deployed project using a raspberry pi.

    A water temp meter that reports the water temp at a local swimming hole to a private webpage. Built using a raspberry pi zero w, a timer, an MC battery, a DS18B20 sensor and a bash script running as a service on bootup.

  • pmk@lemmy.sdf.org
    link
    fedilink
    arrow-up
    5
    ·
    edit-2
    8 days ago

    Cowsay as a Service. A Go microservice that lets you send form or json http post with curl or whatever to an api over the internet and in return you get the cowsay ascii art you requested.

  • Muscle_Meteor@discuss.tchncs.de
    link
    fedilink
    arrow-up
    5
    ·
    9 days ago

    I’ve written an entire android app just for myself. I couldnt find anything with the features or widgets i wanted so i just made it myself. Presumably because widgets reduce the need to open the app and that reduces ad revenue.

    My userbase is currently me and one friend

  • mesa@piefed.social
    link
    fedilink
    arrow-up
    5
    ·
    8 days ago

    Back over 10+ years ago on the original raspberry pi, I made a butler program. Every hour on top of the hour, it would use espeak to say what my schedule was, the current internet usage (there was max usage of 100gb) and a couple of other things. It worked really well for years.

  • some_guy@lemmy.sdf.org
    link
    fedilink
    English
    arrow-up
    4
    ·
    8 days ago

    I wrote a coin flip script that randomly calls qlmanage -p tails.jpg / heads.jpg (Mac) to flip a virtual coin.