1. 16

Definitely just asking out of curiosity and not fishing for new ideas of things to automate

  1.  

    1. 19

      About ten years ago I moved into an apartment building with one of those front-gate calling devices. Guests key in your apartment number, it calls your phone, then you press 9 to open the front gate. For some reason, the landlord would only allow local area codes in the directory. So I bought a number off Twilio and forwarded it to my cell phone, which solved the problem.

      At the same time I was also hosting a lot of huge dinner parties— like 15-20 guests huge. Dialing them all in was a pain, but hey, now I had a Twilio APIs! So I routed the number through the “party server”. Normally it went to my phone, but when “party mode” it would open the door automatically. I don’t remember if I just send back the keypress or if I had to record and play back the key frequency.

      1. 4

        Hillel what would you cook at your dinner parties

        1. 6

          He played back the food frequency

          1. 4

            the menu would be picked from an API of course.

            1. 3

              For large parties I used the slow cooker a lot, since it makes a lot of food and leaves you free to do other stuff. Usually it was based on a theme (corn, mutton, squash), so it’d be things like “pork houlder braised in a roasted corn puree”. One big success I remember was a beef heart bolognese with celery root.

              Vegetarian entree would be theme-dependent but also something I can make at scale: esquites, goat mac and cheese, pumpkin-tofu curry, stuff like that. Dessert usually a themed chocolate or candy.

              Some gimmicks broke the form. I did a pizza night once, which was a lot of fun but too much work to do again.

          2. 13

            At University we made an internet connected mirrorball. We strapped a dot matrix printer to a beam attached a mirror call to the end of the paper roller and wired up a network print server. At one point I had it connected to the CPU load average on our shared Unix server by sending blank lines at different rates for different loads. You could tell how busy the server was by how fast the reflections were spinning and decide whether to bother logging on or not.

            1. 9

              I needed a security camera in a building that did not have wifi. All of the popular commercial solutions for this require not only broadband, but also at least a $35/month subscription. So I’d be looking at a minimum of about $100/mo just to run the camera, not counting purchase price. (Broadband is expensive in my area.)

              I decided I didn’t need video, I only needed pictures and an immediate notification on my phone whenever something/someone stepped into frame. If someone broke in, I wanted photographic evidence for the police, and the ability to call 911 ASAP.

              This was a couple years ago so my memory is getting hazy, but this is how I set it up:

              1. I got a free T-Mobile hotspot from their “LTE broadband” trial program. You got free LTE internet for a month, but more importantly, you got a hotspot that you were supposed to in theory either use, return to T-Mobile, or give to a friend. But they didn’t enforce any of those.
              2. I purchased the cheapest T-Mobile plan with data. This was a $5/mo prepaid plan with 512MB data. Importantly, if you ran out of data, it didn’t shut off, it just got very slow. Since I was only using it to send small, low-res pictures, that was fine.
              3. A Raspberry Pi Zero W with a camera was connected to the hotspot to connect it to the Internet.
              4. The RPZero took a picture every second.
              5. Each picture was analyzed against the previous one and if there were any changes, it was saved to ramdisk. I used a slightly modified version of imgcomp for this.
              6. The ramdisk was synced to a directory on my VPS via SyncThing.
              7. I wrote a Python (or shell?) program to watch the picture directory on my VPS. When a new file was added, it sent a notification to my phone via Gotify.
              8. The notification contained a link to the picture, served from my VPS by Apache.

              It all worked surprisingly well for a couple years! The only spurious notifications I ever got were when bats got in, or a moth landed on the camera lens.

              1. 6

                At work I work with quite a wide range of things, you could say I wear many hats… So I made a small tool called Mad Hatter which changes my job title daily to a random one among ~20 different options, just for the fun of it.

                1. 6

                  A long time back, I set up an elaborate prank:

                  I set my computer to allow forwarding, set up ip tables on my router and my computer to forward traffic from the victim to my computer, and I ran a squid server, and an apache server. The squid server would execute a script against incoming web requests and serve up the results on apache.

                  The script would inject css into the html to cause any of a number of effects: the webpage could slowly rotate around,ending up completely upside down after a few hours, or the webpage could pulsate, or images could be rotated upside down, or all the fonts could be replaced with comic sans. I also would replace some images with an image of Nicholas Cage, and I would replace any youtube video with nyancat. Back then, although youtube served over https, the video itself was served over http. The upshot was, any video on youtube would look perfectly normal, until you click on it and get nyancat, every time. I affected their cellphone and laptop. He told me after that it even effected the appearance of some of his apps, even well after the prank concluded.

                  my inspiration for this prank was this, while the css was borrowed from this

                  1. 7

                    A long time ago, I worked at Shutterstock, and the president of the company at the time was notorious for “checking up” on the site all the time. Just whenever he wasn’t doing anything else he would go to shutterstock.com and search for something, or buy something, and get a feel for how it was working, and sometimes if there was an outage we would hear it from him before we heard from customer support — not a bad habit honestly, but we poked a bit of fun at just how diligent he was at it.

                    So anyway, this one year, in February or March we’d just finished up a little dismissible “notification banner” system that we could use to let people know about maintenance, or terms of service changes, or “stop using IE6”. And April 1st was coming up and a few of us got this idea in our heads, so we created a banner for “Shutterstock is proud to announce our acquisition by Getty Images”, with professional copy, and some logo work from our graphic designer, and everything. We set up a version of the site that would always display that banner on one of our CI instances, and roped one of the SREs into setting up a transparent proxy rule that would redirect shutterstock.com traffic to that version of the site, as long as it was coming from our own offices. We flipped the switch around 9:30am on the 1st, and sure enough, within minutes product managers’ phones started ringing… Mr. President was freaked out. He figured out that it was a joke, but he thought that it was going out to the entire world, and it was only devs and ops who were in on it, so it was quite some time before anyone could reassure him that we hadn’t been complete idiots. Once he realized it was aimed at him specifically he was pretty gracious (and relieved, I’m sure), but we got told not to pull any shit like that again without at least clearing it with a VP.

                  2. 6

                    Maybe not the weirdest but definitely among my favourites. I worked at a bank on IBM mainframes on the production team, monitoring batch jobs, writing JCL’s and Rexx. It was as shit as it sounds. Anyway one day a giant stack of change requests comes down for things that need to be updated in production JCL’s (scripts), real basic sed type stuff. For some reason the devs didn’t wanna do it on their end, they wanted us to do it. But we didn’t have access to source control, so we had to put each change through manually using this point-and-shoot ncurses lookin thing (ISPF for those who know). One at a time, search and replace, hundreds and hundreds of files.

                    Well anyway I automated that shit because obviously. On the back end the same devs who didn’t want to do it on their side had to manually approve hundreds and hundreds of pushes back to source control from our team.

                    Strangely, they asked us to stop and did it all themselves. /shrug

                    1. 5

                      I’m just starting on home automation stuff in my new house so I don’t have any good stories just quite yet.

                      One of the more interesting ones that I’ve done is a system that accepts a stripe webhook, parses a bunch of information out of a donation transaction or a bank account transfer transaction, reformats it into a ledger plain text accounting format, and then appends it to a ledger transaction record by downloading the file, adding the new transaction, and then re-uploading it. It then send a notification to Slack and then opens up a Gitlab merge request. I need only hit the merge button and a few seconds later, in slack, I’ll get the latest financial report for my non-profit organization.

                      1. 5

                        Some months ago I was asked to do a talk at the local Red Hat Summit: Connect 2024 event in Copenhagen, Denmark, where I live.

                        With the AI craze going strong I wanted to do something completely different. This being a Red Hat event I figured that I’d instead show how you can use Ansible Automation Platform (AAP) and Event-Driven Ansible (EDA) in unusual ways.

                        I ended up creating three different sets of automations.

                        In one the scenario was that my kids were playing Roblox too late in the day, and after I’d told them to quit, so naturally the goal was to throttle my kids’ internet connection. I hooked up my PiHole to Logstash and MQTT, so that whenever the PiHole got a request for resolving a domain that matched /roblox\.com$/ I’d put the request on MQTT. Using EDA I created a job that ingested these events, and if the time was past 20:00 it’d run an Ansible playbook that would log in to my UniFi controller web app, determine the device from the PiHole->Logstash->MQTT payload, and put the resulting device into a throttled group that limited speeds to 15 Kbps.

                        For another I decided to attack the common household problem of toilet paper rolls running out of paper and not getting replaced. I bought a cheap I2C RGB detector and with a NodeMCU, a 18650 Li-Ion cell holder and some ESPHome YAML and C++ I created a sensor that could be mounted on the wall behind a toilet paper roll, which would trigger depending on the amount of light reflected from the roll; if it was bright it meant it had paper, if it wasn’t it meant the roll needed changing. This was hooked up to EDA, which would fire a playbook that connected to Home Assistant and triggered a notification on my phone.

                        For the last one I dug out an automated drinks mixer I built 4 years ago with a few friends. Using Ansible job templates I created drinks both adult (alcoholic) and child-safe (virgin) drink menus in AAP. I then created an EDA job to listen to the Home Assistant websocket to look for my location, and when I came home on Fridays after a certain time it’d automatically make a drink.

                        For all of these I had live demos. The first time I presented it, at Red Hat Summit: Connect 2024, the drinks mixer demo didn’t work, but some quick live debugging took care of the issue and it succesfully produced a drink, to much applause.

                        I’ve since given the same presentation 2 more times, and the second time I had two sick kids at home. For the presentation I’d changed the “Roblox cut off time” so it’d work during the presentation, which meant that as soon as my laptop connected to the internet and started receiving events it throttled the kids at home – they were playing Roblox :)

                        The source and presentations are available at https://github.com/runejuhl/unusual-ansible/, the ESPHome Loo Roll Detector can be found at https://github.com/runejuhl/esphome-loo-roll-detector/ and the Ansible plugins I created for ingesting websocket and HTTP SSE are available at https://github.com/runejuhl/runejuhl.unusual_ansible/ .

                        1. 4

                          This made me ponder a bathroom that locks you inside until you change the toilet paper roll. A shitty escape room, if you will :D

                        2. 4

                          At one point I made a replica of my apartment in Minecraft… and then hooked up the lamp/TV in the Minecraft version to the lamp/TV in the the real apartment via Home Assistant. A small one, but fun and unusual :)

                          1. 4

                            In college, we lived in a suite that had a locked door separating it from the rest of the dorm. We wanted friends to be able to come over, so we hooked up a Rapberry Pi to a barcode scanner and a motor, pointed the scanner through the door window, and connected the motor to the door handle with string. When someone scanned a barcode we gave them, the motor would briefly pull the door handle up. Because of the way the door sat in the frame, it would pop out of the latch and unlock the door, allowing them to open it.

                            1. 4

                              When my sister was doing her PhD, she often had to come to campus to check on her cell counter (lab equipment that shows the growth of cells), sometimes late at night as she didn’t know how fast the cells would grow or she’d have to wait and come back if they weren’t growing quickly. I made a simple Python program (“robotic lab rat”) that would wait a few hours and then wake the screen up by “pressing” a keyboard key, waiting a few seconds, taking a screenshot and then emailing it to her.

                              1. 4

                                Microsoft gives each employee an Azure subscription with $150ish in credits to play around with. I used it to spin up a VM for a homelab service but the Azure subscription is set up to send a daily email where if you don’t click a link, the VM is shut down. So I wrote a Python script triggered by a daily cron job on a raspberry pi to fetch email from an inbox, parse it, find the link, start a headless browser driven by Selenium, and click the “do not shutdown” button in the linked page. This worked very well except for twice a year when daylight savings triggered a time change and the script run time was off by one hour. I was too lazy to figure out a fix for that last part.

                                Took two years to find out there is actually a setting buried in the Azure portal to disable these emails and keep the VM running. Oh well, it was neat learning how to script email and browsers.

                                1. 4

                                  Not all that weird but I was pretty proud of it.

                                  During the 2017 there was an effort to repeal the protections put in place by The Affordable Care Act, specifically the pre-existing conditions bits. These protections are something I cared deeply about, and in general the ACHA 2017 act was massively unpopular. It was so unpopular that a lot of senate offices left their phone off the hook, and more than one person resorted to ordering pizza to senate offices with protest messages.

                                  I had recently found out that USG hosted a GitHub page with all of the senate seat, district data, and contact infomation for the house and the senate. In that data every DC office listed a tax machine & twilio offers an inexpensive Fax API. Wrote a pretty quick app that would take your geolocation data, give you your representation in the house and senate, and let me send them a fax.

                                  1. 3

                                    Living in a mother-daughter home and the washer-dryer setup is across the entire house (both sides) so I setup a way for us to know when the washer/dryer was finished. Added smart outlets to the washer and dryer which have monitoring capabilities, connected that to home assistant (so I can trigger on power usage). And pushover on everyone’s devices so they can “subscribe” to the washer or dryer (separately) to get status updates (it sends when the device is on and off). But not everyone wanted to get the updates all of the time so I built an in home app for everyone to just go push “subscribe” which will remove the current subscriber and subscribe the logged in person. I also added unsubscribe so if we are diligent enough it also can show if the machine is available. Tailscale serve worked perfectly, I already wanted everyone to auth & for it not to be on the internet but it makes it easier with a header so the app has no login logic auto-auth. Kind of a Rube Goldberg machine but it’s actually very reliable for non-smart washer/dryer.

                                    1. 2

                                      Just this week I scripted up a key shortcut to do something weirdly basic.

                                      The goal is to help myself out with cleaning up open windows when I return to a computer I left messy a day or more ago. I habitually keep tidy the one computer I use the most, where my memory about open windows is relatively current. But lately I have three computers, and two of them easily fall into disarray.

                                      A state syncing strategy is off the table due to each computer’s focus on personal/employer/client domains. Virtual desktops just push the problem aside; soon I have ten similar-looking piles. Tiling is also not my jam—any given window has a best size.

                                      The script considers the frontmost window, and only if it’s a saved document, moves its file to the frontmost finder window’s folder, then closes it—or if it’s a browser, saves the active tab’s link to that folder and closes it. That’s it. I make a folder for a task, then use the script several times to put away the task’s materials. It goes in my project tree and I can resume it if I want.

                                      This is so simple to do by hand (once) that I’ve done it for years without thinking to automate it. But when I reach 20 open windows and 30 browser tabs that are several days old, it’s difficult. I’m likely to put off and let worsen. So I needed that case to be easy too.

                                      1. 2

                                        Haven’t made it but I just had a great idea for one: there are machines used for sorting fruit or garbage or other lightweight-but-irregular things that use a camera to classify objects as they fall down a chute, and then either mechanical flippers or puffs of compressed air to push selected items into a different chute. And my thought was that making a consumer-level one of those for sorting lego sounds awesome. Even if you can’t do THAT much image classification on simple hardware, being able to pour some mixed legos into a hopper and have it sort out selected colors or “bricks vs other” or “tall vs flat bricks” or something like that sounds useful, and probably pretty cool to watch.

                                          1. 2

                                            We have solar panels and I hate the fusionsolar app so I made an automation to send the production of the day through email to me and my father.

                                            A fully stateless selenium service that is scheduled to run every day.

                                            https://github.com/lucasew/fusionsolar-bot

                                            1. 2

                                              Not personally, but was involved with maintaining it.

                                              We paid for a nightly data dump and the only way to get it was with a Windows GUI Client, no API.

                                              I don’t remember which automation framework we used but it included making screenshots and telling it where to click and download to a network share (from a Window VM). This broke at least once per month and our on call had to fix it first thing in the morning they came in, at least it didn’t wake us up.

                                              1. 1

                                                One can script both LibreOffice and Firefox in a mostly reasonable mostly content-aware way, but for quite a few things writing a blind autoclicker and checking the result at the end is simpler… Has an additional benefit that a spreadsheet with stupid formatting (otherwise I would just generate a CSV and copy the data over!) getting filled at a superhuman but still legible speed just looks silly.

                                              2. 2

                                                All digital signage is expensive and error prone

                                                I set up a bunch of raspberry pi that would boot to mpv looping on a directory. This directory was synced with rclone. The designer was great at uploading a bunch of images and videos to a folder for each TV/campus in Dropbox. It was just effortless.

                                                1. 2

                                                  It always a bit annoying a find phone for 2FA authentication, so i made a script which intercepts internet traffic/URLs using Mitm proxy and generates a TOTP for one of the specified domains, and then have espeak repeat that totp 2 times in robotic voice ! It ran without hiccups but probably not a good idea to have your primary device generate TOTPs in the first place.

                                                  1. 2

                                                    A typical TOTP setup guide tells you to both print the last-resort recovery codes and put a copy of them into your password manager. So, as long as the TOTP secret lives encrypted-when-the-session-is-locked, local generation of TOTP does not change the threat model much. (And from the other side, password managers support TOTP generation).

                                                    I just have a script that I can tell to type the generated TOTP into a window (without going through the clipboard)

                                                    1. 1

                                                      Though i have these (totp) secrets in an encrypted volume using veracrypt, but i think once mounted any (bad) programme could read it! Also i keep forgetting if i have latest recovery codes, some domain would keep asking me if i have those..then i sometimes regenerate to be sure. Does you password manager handle this, or there is some version control ?

                                                      Also how does script writing to window work?

                                                      1. 1

                                                        For password management, I use a pass-like setup, but using age instead. Then wrap it in a FUSE filesystem so that .git-credentials cam be stored there. The encrypted files are all in version control, indeed (Monotone). xdotool is used to type stuff into windows (which is also how my pick-a-unicode-character binding works, as well as general canned phrase support binding)

                                                  2. 2

                                                    Not that interesting but in Danganronpa there’s a thing where you get coins you can spend to get items in a sort of gacha machine (think the statuue unlocks in Melee).

                                                    There’s this thing where you could spend more coins per go to increase the odds, but I had loads of coins and thought “I bet just spending one at a time is gonna give me more”. So I used (I believe) PyAutoGUI to just do single coin runs for a couple hours while I was in class. Felt unreasonably satisfied

                                                    1. 2

                                                      There were some strong differences of opinion about the music played on the office Sonos at one place I worked. To avoid debate, some people would just anonymously start cutting each other off after they felt a suitable time playing someone else’s playlist had passed. As the frequency of these abrupt switches between playlists increased, the appropriateness of the music declined. Things came to a head. I suggested we get rid of the Sonos, but I was in the minority. So I offered to write a Slack bot that would be the office DJ. If you wanted to play anything, you would go to a specific channel and tell it. By default the bot would queue requests, but there was a command to clear the playlist. My idea was that everyone could see who was playing what and we could debate each other directly instead of complaining at the rest of the office in general.

                                                      Writing the bot was fun. I used an old laptop and left it running on my desk. It’s been some years and I can’t remember which API I used—it might have been a third-party one that put a REST layer over something lower level—but it turned out to not be not very reliable. My colleagues were good natured enough to try my bot, but it didn’t work well at all. Imagine trying to ask Ash, the synthetic from the first Alien movie, to DJ for you while he was flopping around: Some requests would be fulfilled but the API did not always respond with an acknowledgement. Or the API would fulfill a request several minutes after it was made. Some requests were neither acknowledged nor fulfilled. Often, the queue returned by the API did not reflect what was actually in the queue. I think the Sonos even crashed. This confused the Slack half of my bot considerably and my colleagues even more.

                                                      The only positive to come out of it was that my feckless bot broke the tension amongst the humans. After I gave up on it, most of us just asked one guy most of us agreed had good taste to put something nice on.

                                                      1. 2

                                                        My friends’ program DisOrder was written to be an office jukebox https://www.greenend.org.uk/rjk/disorder/

                                                        1. 1

                                                          As the frequency of these switched increased, the appropriateness of the music declined.

                                                          You must have been tempted to write a bot that switched at times on the order of a millisecond, and then the switching itself could have played a nice tune.

                                                        2. 2

                                                          I made an automatic light turner onner. It used a BSd program to find the time of sunset, created an at job each day that would turn on and turn off the light at sunset and sunrise. The thing is is I did not use a photo sensor. I just use mathematical computations and my current latitude and longitude.

                                                          1. 1

                                                            I want to track my electricity consumption. However getting a smart meter or fully automated meter reading seems too complex.

                                                            So I now have the following chain:

                                                            • an iOS shortcut lets me input the current meter value (I do it manually every week)
                                                            • this value gets forwarded to the MQTTAnalyzer App
                                                            • which publishes this value on MQTT (server hosted on a RaspPi)
                                                            • there is another (Go) service listening to this topic, which forwards this value to VictoriaMetrics (both on the Pi)
                                                            • the resulting average daily consumption is computed on my Grafana dashboard (on the Pi as well)
                                                            1. 2

                                                              If your meter is digital but not quite “smart” enough to have its own connection and API, it might at least have an LED labelled “1000 imp/kWh” or similar. Then you can stick a photo diode on it with a raspi pico and go from there. I have it going into InfluxDB with a grafana dashboard. 1 Wh resolution is not perfect, but not terrible either.

                                                              1. 1

                                                                Yes, that would be a sensible solution (1Wh resolution is much better than my current 40kWh resolution:)

                                                                I have two issues:

                                                                • how to power the diode setup (either battery powered or setup a plug nearby)
                                                                • is the WiFi signal strong enough there?

                                                                Both not very hard, but requires some investment.

                                                            2. 1

                                                              Hmm, my weirdest automations that count as a single thing each are probably all work stuff, and also trying to falsely claim being perfectly normal toolchains for slightly inconvenient tasks.

                                                              You cannot do NLP with regular expressions, they said. Fortunately, I could just ask users «please be formulaic» and have a script converting email replies to users to executable code.

                                                              Or an data-normalisation-using-inference tool that outsmarted me by 80%-recovering from a presumably irrecoverable column marking error. Chasing that 20% failure rate across the inference code that was not the cause of it was not very productive.

                                                              1. [Comment removed by author]