top | item 31018836

Ask HN: Have you created programs for only your personal use?

423 points| smarri | 3 years ago

Curious to know if anyone has written programs for their own, regular, & personal use. And if so what they are? E.g. A colleague of mine tracks all of his homes energy use through a custom program which disaggregates the energy consumption per device and outputs a report to a tablet.

651 comments

order
[+] LeoPanthera|3 years ago|reply
Hundreds! Doesn't everyone? Most of them are just bash scripts, many of which have now reached a complexity so high that I wish I'd started writing them in a different language but it's too late now. The majority of the rest are Python.

Off the top of my head, the most used ones are:

* A replacement front-end for "tar" and various compressors

* A script to synchronize my music library to a compressed version for playing in my car

* A secure-but-readable password generator

* A system to batch compress folders full of video files. (For ripped blu-ray discs, mostly.)

* A replacement front-end for "ffmpeg", see above

* A "sanity check" program for my internet connection to see if the problem is me, or Comcast

* A front-end for "rm" that shows a progress bar when deleting thousands of files. (Deletes on ZFS are unusually slow.)

And lots more tiny things.

[+] lq0000|3 years ago|reply
> * A replacement front-end for "ffmpeg", see above

I have one of these too... It's kind of frightening how hard ffmpeg is to use without some kind of custom frontend. I have probably dozens of bash/python scripts to invoke ffmpeg for different common tasks.

- One to extract audio

- One to extract all the individual streams from a container

- A couple different transcoding scripts

- One specifically for gifs

- One to crop video

- A few that I can't remember the purpose of... and can't tell from reading the source

[+] pdonis|3 years ago|reply
> Hundreds! Doesn't everyone?

I certainly have. Interestingly, one was the same "sanity check" program for my internet connection, because of the same ISP you mention. Amazing coincidence...I don't think. :-)

[+] ahmedalsudani|3 years ago|reply
> Hundreds! Doesn't everyone?

Raising my hand in agreement!

A couple highlights:

- Video syncing library before those became cool (2014). Originally built on top of firebase; now rewriting with my own backend. Very slow going :)

- Twilio server + interface. I'm my own service provider (thanks to Twilio)

[+] ajkjk|3 years ago|reply
It's cool that you do that, but "Doesn't everyone?" implies to me that you might be a bit out of touch. This is common among a certain type of person and unheard of for everybody else.
[+] tailspin2019|3 years ago|reply
> A "sanity check" program for my internet connection to see if the problem is me, or Comcast

It's funny, I've never thought of doing this, but now realise it would be quite handy. Not just for connectivity but also some quick bandwidth/latency tests, and perhaps even a few basic internal network checks too.

The number of times I'm trying to troubleshoot Zoom calls these days... it would be handy to have a little bash script to run to rule out obvious issues.

For my specific use case, a big one would also be a quick automated check for whether my primary network connection is Wifi or Ethernet since I swap between the two and often forget which I'm currently using (which can impact connection quality if it's not the one I intended).

[+] jonplackett|3 years ago|reply
Yes. And it’s a strange one.

I made a program to gender swap any text you put into it and then got a book deal to rewrite and illustrate Fairy Tales. It’s been published around the world.

https://genderswappedfairytales.com

The idea is to shine a light on the original versions but it also creates a lot of never-written-before characters. A lot of brave princesses and lady-beasts, but also men desperately wanting children and being rewarded for kindness.

I wrote the gender swap algorithm in Swift. It seemed like it would just be a simple auto replace type thing when I started but there’s some weird things in English, for example with his/him/her/hers where they don’t swap back and forth sensibly and you have to understand the context.

It was his > it was hers.

It was his sword > it was her sword

So I ended up down this rabbit hole of natural language processing to break up each sentence into verbs, nouns etc to work out the correct words to use. Even tried training an AI to do it based on the finished swapped text but a whole bunch of rules worked more reliably.

[+] conductr|3 years ago|reply
Sounds like an interesting challenge although I’ll admit on this one I would have just went to fiver and hired someone to edit the existing text. My guess is under and week and a couple hundred bucks at most and you’d be set.
[+] HellsMaddy|3 years ago|reply
This is so cool! I think I'm going to gift your book to my niblings next Christmas. Thank you for sharing!
[+] camgunz|3 years ago|reply
Wow this book is beautiful! Thank you for sharing.
[+] vax425|3 years ago|reply
I made myself a Chrome extension called Headlamp that puts a red dot by each link, button, text box, etc., and clears them as I click or type while I’m testing a web app.

When I hand off a build to a client, if all the red dots are gone, I know I’ve at least TOUCHED everything.

If I’m working with another engineer, we can both see the dots in our browser and collaborate to clear them all while we test.

[+] Trufa|3 years ago|reply
Nice! Can you share it?
[+] primitivesuave|3 years ago|reply
I created a program that prints QR codes onto sheets of peel-and-stick labels. When someone scans the code, they are directed to a simple web app that manages food sharing with my four roommates.

We noticed that we buy a lot of the same things (bananas, avocados, eggs, etc), so we implemented a system where anyone can stick a QR code onto something they want to share, and anyone else can scan it to record what they took. For example, this morning I pulled a carton of eggs out of the fridge, scanned it, recorded that I took 3, and a Splitwise expense was automatically updated between me and the person who bought the eggs (much easier and less awkward than handing someone 75 cents). Everyone is logged into the application via Splitwise OAuth, and all products/expenses/debts are automatically simplified within Splitwise and updated via the API - so the app is pretty much a wrapper over Splitwise specifically for granular sharing of food.

[+] tdhz77|3 years ago|reply
It’s like Web 3.0 for your fridge… make a market for anything.

A roommate taking 3 eggs from me doesn’t bother me. Firing off a text, “Hey, I took 3 eggs” is all I need.

We really just don’t like to share these days. That’s the problem we are now solving it appears.

[+] Karrot_Kream|3 years ago|reply
What label printer do you use and did you end up automating the printing process or just the QR code generation process?
[+] chayleaf|3 years ago|reply
I chose a different system, you can buy something for yourself or you can buy something for everyone in which case the price is shared between everyone. Is it less fair? Perhaps the unfairness does accumulate (for example, I'm the only vegetarian here, but meat still gets added to the shared budget, but in exchange I eat more non-meat than others), but it would be really inconvenient to have, say, 3 packs of cheese (you can't just take an entire pack of cheese, so it can't be shared with your system). Also I don't need any labels!
[+] a_chris|3 years ago|reply
You are living the future my friend
[+] conductr|3 years ago|reply
Are you maintaining a per item price list? Is is generic or updated after each trip to the market?

0.25 per egg assumed the dozen cost $3 but what happens when I go to a value brand and my cost is $2 or the fancy $5 dozen eggs. Does the roommate have to update the price per item for everything they buy?

How do things like a bag of chips work? Cost per weight probably makes the most sense but the overhead of such a system seems enormous.

Also, what happens when your roommate gets mad at you because they bought those eggs for a specific meal they planned on cooking for dinner and now have to go to the store for more or change their plan? This is the main reason I most had a no sharing rule with my roommates.

[+] yellowapple|3 years ago|reply
Congrats! You've invented a very bare bones inventory management system :)
[+] linsomniac|3 years ago|reply
Decades ago I had a friend that needed to scan his CD cover to start selling it online. I only had a Linux machine. So I looked up the documentation for the HP scanners, found it was well documented at the protocol level, so I bought one.

I wrote some CLI tool that could trigger a scan and read the data back, into a file. Worked well enough, but I wanted a GUI.

I started thinking I wanted to make a GUI for it. I started thinking "I'll need to do X like xv does, I'll need to do Y like xv does, I'll need to do Z like xv does..." Clearly, what I needed to do is extend xv so it could do scanning. I spent a weekend making the prototype, and it worked brilliantly.

xv was open source but licensed $25 for commercial use. I made a deal with the author, John Bradley to become a reseller for xv. Over the next few years I sold, I don't remember exactly, but maybe thousands of copies. To people, to government labs, to businesses large and small. It was the beginning of a company that I ran until around 7 years ago, and that just shuttered for good a few months ago, 25 years later.

All for program I wrote to scan a friend's album cover art.

https://www.linuxjournal.com/article/4029

[+] vishaltelangre|3 years ago|reply
Very inspiring and insightful story! Thanks for sharing it.
[+] iku|3 years ago|reply
Wow. Thanks for this story.
[+] chasd00|3 years ago|reply
I created a program that outputs one of my kid's name if the day of year is even, the other kid's name if it's odd. I use it to determine who's turn it is to take a shower first. They'll argue with me and each other all day long but for some reason they will not argue with the computer.
[+] oh-4-fucks-sake|3 years ago|reply
Install a second shower-head and make them shower together. Parallel processing is your friend here.
[+] ghewgill|3 years ago|reply
I do that too! One of my kids was born on an odd year, month, and day, while the other was born on an even year, month, and day. They know who is who and they don't argue with the calendar. (We do it by day of month and we find another way to decide if we need to on the 31st.)
[+] srcreigh|3 years ago|reply
has it been more than a year? How does Jimmy feel about going first on Dec 31 (day 365) and Jan 1 (day 1)?
[+] doodpants|3 years ago|reply
Heck yes, all the time. While it seems like the major computer/OS vendors these days are trying to turn computers into limited purpose appliances, I was first exposed to computers as a child in the late 70's, when it was expected that anyone who owned a computer would also want to program it for their own purposes. My own personal projects tend not to be very large in scope, but can be quite handy. Some examples include:

- A Pomodoro timer that has exactly the features and user interface that I want

- A script to perform backups of select files and directories from a source drive to a specified backup volume

- A "pixels-per-inch" calculator that allows me to compare the resolutions of displays that I may be interested in purchasing; by entering the width and height of a display in pixels, and its diagonal in inches, it calculates the density in pixels-per-inch, and the dot pitch in millimeters

- Various user-friendly graphical interfaces to aid in solving different types of puzzles (think sudoku-like logic puzzles)

- Programs to actually solve various types of puzzles all on their own (I've written over 70 of these in the last 10+ years!)

- Various command line scripts for code management tasks (i.e. useful for sofware development itself)

[+] mark-r|3 years ago|reply
I have a pixels-per-inch calculator too, but mine is an Excel spreadsheet. Lets me see all the displays I've been interested in or own, even things like phones.
[+] slig|3 years ago|reply
>- Programs to actually solve various types of puzzles all on their own (I've written over 70 of these in the last 10+ years!)

Cool, are these open source?

[+] gotaquestion|3 years ago|reply
Huh, I've never been asked that.

Yes, for over 30 years. I could never list them all. Nearly every thought I have becomes a program. I've written x86 asm game hacks (DOS era), 2D tile games (80's), Windows MIDI composers, game frame languages, ray-tracing renderers, OpenGL visualization, PID controllers, camera controllers, video controllers, circuit simulators, flight controllers, so so so many games, scripts for analyzing data, scripts for scraping websites, ODBC readers for my cars, FM synths, game solvers, and that's just stuff in C, not even getting started with the bazillion websites.

Over decades, programming becomes such a part of your life, that it is simply the way you move about the world, and think about it.

[+] WesleyJohnson|3 years ago|reply
I wish I could shift my thinking to do this. I've been a web developer for 17 years and love programming. But any time I've tried to build my own projects or products, it's usually a revamp of an existing product or game, and I quickly lose interest.

I lack the ability to see everyday "issues" that could be resolved with programming. But if someone asks me to solve an issue with a program, I could probably come up with something pretty quickly.

Curious if anyone else has this problem, or have found a way out of it?

[+] phaedrus|3 years ago|reply
I have a similar list - except I've never finished anything.
[+] deanmoriarty|3 years ago|reply
I wrote a scraper for various dating websites that would automatically generate activity on my behalf according to several empirical criteria (very simple stuff, no ML!), so that I could minimize the amount of time spent manually fishing.

It worked amazingly well, it got me hundreds (yes, 100+) of dates, incredible dating stories and a lifetime of memories, all in a semi-automated way without me requiring to “swipe right” or similar. As a matter of fact, my current girlfriend (of 5 years) was found through the software. She knows it and laughs about it.

Clearly the software didn’t do anything magical, I would have likely gotten the same results had I spent the time to individually message and interact with the 100s of women the software did in a semi-automated way, but it was really nice to save my time.

One day I should write a blog post.

[+] Karrot_Kream|3 years ago|reply
Tons. Way too many at times. I build a lot of tools to make it easy to consume and produce media/social media offline (these flows usually involve turning things into email or Usenet articles and then transmitting them on a private network) both because it lets me control how/when I consume media and also because it's just plain fun.

Other than that though, I have a system that helps my D&D group (which meets weekly and has for years) choose what to order for dinner. The system keeps track of a number of restaurants in our area (hand annotated) and chooses 5 restaurants from different food genres and excludes the genre of food that was picked the previous week. The restaurant choices are placed in a ranked choice poll which I monitor and close manually to choose dinner. The ranked choice poll has been helpful when a restaurant actually ends up closed so we just step down the list and pick the next in ranking.

Admittedly this is a technical solution to a mostly social problem, but my D&D group has some neurodivergent personalities that are really bad at coming to consensus. Also, the system pretty much runs itself at this point as the restaurants are kept in a sqlite database and the code is so simple that it never really changes.

[+] deathanatos|3 years ago|reply
I wrote a mapping program that could display maps, my location on them, time estimates to a down-road position, etc.

"Why not Google Maps?"

Several reasons: Google Maps requires a cell connection. (They have offline maps now — they didn't at the time I built the tool — but my offline maps are far more controllable in what data I pull down. And if I need data I haven't got, and I have a cell signal, I can fetch it on the fly and add it to the offline cache.)

Google maps was much worse at the time about finding rest areas. They're better marginally better now, but it's still pretty tedious to do on mobile. (There's no general search for it; you can search rest areas and usually get rest areas + junk, but you also really want to also search at the same time for, e.g., Flying Js, Loves. Contextual knowledge about the road would be good too, in case I'm on a turnpike. Also, still waiting for it to realize that, if I'm looking for gas, food, etc. … I want it downroad.) Admittedly my own implementation could have been better here, but I also lack the nice datasets that Google has…

OSM's map data is, in my opinion, better.

The GPS device I have can acquire a signal pretty much instantly. The phone … cannot. Useful in situations where we needed a quick answer, b/c things are happening at 60mph.

Though, we did end up supplementing the program with the phone. (On-the-fly routing is better in Maps, b/c it's a really tough problem, and I didn't build an interface into OpenRoute or whatever its called.)

OpenLayers is an amazing library, too.

[+] snide|3 years ago|reply
My entire linux Desktop feels this way! It's my favorite part of working in a barebones Linux distro like Arch. I've got to build everything from the ground up. Need a screenshot program? OK... let's pull in Flameshot. Where's it going to host that image? Well, let's create a watch folder and shuttle everything off to a GCP static bucket.

Window manager? I3... heh, let's build a bunch of scripts. Vim? Well... man, that's a whole ecosystem of tooling I an hack together and write against.

I do this as a designer. I'm actually not a fantastic programmer, I just like the flexibility of building tools that are specific to me. My entire desktop feels like a love letter to building cool things the way I want.

[+] jrm4|3 years ago|reply
I live by them; I probably couldn't name them all, they've become so embedded in my flow.

Probably the most important part of my flow is the following; it's a method for doing a personal "inbox" GTD style, 100% reliant on email + zim-wiki. I have a script that, when called manually, searches for new "inbox-marked" emails (i.e. ONLY those sent from me to me), and copies them to my zim notebook (specifically, to the page corresponding to "today" in the journal) as an open checkbox item.

Supporting that is-

- Desktop: a little shell script that pops open a zenity window to send such an email

- Smartphone: An android app called Blitzmail that does that and only that.(pops a window and sends to an address with no other interaction)

This replaces a LOT of things for me and helps prioritize immensely, (i.e. strongly prevents "email inbox as to-do list" which is a bad idea)

[+] tedyoung|3 years ago|reply
I created "Kid Money Manager", a tool to help manage my son's virtual account. He wasn't old enough to open his own bank account when I started, but we needed some way to track his "earnings" (returning bottles for their deposits or gifts from grandparents) and spending. It has both a Web UI and access via SMS text messages. We mainly use the text messaging—entering transactions at the store, etc.— since I didn't want to write a dedicated phone app for such a simple interaction.

Created it from scratch, live coding it on my (https://JitterTed.Stream) Twitch channel (and some videos on my YouTube channel at https://JitterTed.TV). Written using TDD in Java + Spring Boot, deployed on Heroku and open-source at https://github.com/tedyoung/kid-bank.

I also recently wrote "Format Hero" (https://formathero.dev), because I could never remember which letters to use in Java's DateTimeFormatter. Was also a good demonstration of Hexagonal Architecture and, of course, I live coded it, TDDing all the way. Source is at https://github.com/jitterted/format-hero. Still some work to do on that one, but filled my immediate need.

[edit: added proper links for Stream/YouTube]

[+] lbutler|3 years ago|reply
I work as a water engineer, specializing in building hydraulic models so water utilities can simulate their network.

A big part of that is calibrating them which can be time consuming, you look through hundreds of options. I create a few web based apps to help grind through these tasks but ultimately they were for my own use as a consultant to close projects quickly.

I did pull out the engine as its own open source library for other to use, and that ended up helping me get my current role where I can now maintain it and be paid at the same time.

https://github.com/modelcreate/epanet-js

[+] danbmil99|3 years ago|reply
Dozens if not hundreds (my github recently exceeded 100 repos; more than half are personal projects)

What I've done at every job I've had (in software) is convince my boss "it's just a little code, let's open-source it! Maybe it'll go viral and a community will form to contribute & make it better!"

Which basically never happens (well it did once, in a big way) -- but when I'm working my next gig, guess what? I can use all that code again. And this time I can honestly recommend, "Let's use this thing on github, it does what we want & it's open source!!"

[+] ghughes|3 years ago|reply
I have a fun one. The front door to my house had an automatic door opener, paired with a single-button remote control to unlock and open the door. The remote control was annoying to carry and use. (This was before IoT became a thing.)

I pried open the remote, soldered on an extra circuit bypassing the push switch, and hooked it up to an Arduino. When a packet is sent over serial, the Arduino simulates a button push:

    const int basePin = 2;

    void triggerRemote() {
        digitalWrite(basePin, HIGH);
        delay(2000);
        digitalWrite(basePin, LOW);
    }

    void setup() {
        pinMode(basePin, OUTPUT);
        Serial.begin(9600);
    }

    void loop() {
        if (Serial.available() > 0) {
            Serial.read();
            triggerRemote();
        }
    }
This was paired with a tiny web server to do the serial write:

    #!/opt/bin/python2.6

    PORT = 5525

    import BaseHTTPServer, SocketServer

    class LoccaHTTPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
        server_version = "LoccaServer/1.0"
        def do_GET(self):
            if self.path.startswith("/trigger"):
                serial.write('A')
                self.send_response(200)
            else:
                self.send_error(404)

    serial = open("/dev/ttyACM0", 'wb', 0)

    httpd = SocketServer.TCPServer(("", PORT), LoccaHTTPRequestHandler, False)
    httpd.allow_reuse_address = True
    httpd.server_bind()
    httpd.server_activate()
    httpd.serve_forever()
Finally I threw together an iPhone app with the most basic UI imaginable: a static full-screen photo of the remote; tap once, it fires off a HTTP request, and the door swings open:

    - (IBAction)triggerRemote:(id)sender {
        NSURL *url = [NSURL URLWithString:@"http://10.0.8.48:5525/trigger"];
        NSURLRequest *request = [NSURLRequest requestWithURL:url];
        [NSURLConnection connectionWithRequest:request delegate:nil];
    }
That's basically all of the code. Considering how much of a janky hack this is, it worked great.

Ancient write-up with some photos: https://web.archive.org/web/20120103180640/http://ghughes.co...

[+] maxmunzel|3 years ago|reply
After a quick burst of manic energy during exam phase, I decided to solve the pigeon problem on my balcony once and for all (and in a humane way).

So I bought a cheap electric water gun from Amazon, built in WiFi using an ESP8266 and a relay shield; 3D printed a window mount for my old iPhone (running a webcam app) and hacked together some openCV code in python.

After all this was working on my desk, I had the pleasure to discover that the PCB Antenna of the ESP is to weak to receive WiFi on my balcony so I connected the ESP to my (current) iPhone hotspot and wrote a small go relay for my server so that my laptop can send the shooting commands to the water gun ~~over the internet~~. Oh and while I was at it, I added a Siri Shortcut, so it’s voice controllable, too. (They are surprisingly hacker-friendly)

The surprising thing is, that this Ruben Goldberg machine actually works really well and without much fiddling.

[+] nilshauk|3 years ago|reply
Some weeks ago I wrote a couple of bookmarklets, one of which was this:

javascript:(function(){ location.href = `https://nitter.net${location.pathname}` })();

You can take this JavaScript snippet and save it as a clickable bookmark (hence the name bookmarklet) in you browser. I've named this "re-open in Nitter". I deleted my Twitter account a while back but sometimes I get handed a Twitter link. This snippet let's me quickly re-open the link in Nitter which is a nag-free way to browse Twitter without having an account. :)

[+] Sohcahtoa82|3 years ago|reply
I have a strange problem with my monitor that I solved with a program.

Basically, I use a USB switch to switch my mouse, keyboard, and webcam between my personal desktop computer and the MacBook I use for work. I tried a full KVM switch at first, but every time I'd switch it to my MacBook, Windows on my PC would flip its shit. With the primary monitor disconnected, it would move everything to the secondary monitor, which was fine, except that when I moved the KVM switch back to my PC, it would move everything back to my primary display, whether or not it was originally on my primary or secondary. Additionally, since my two monitors are different resolutions, all my window sizing was wrong.

I tried to get around this by plugging my PC into my monitor's Display Port and plugging the MacBook into an HDMI port and just telling my monitor to switch inputs, and for the most part it works, but at 1 PM every day, if my monitor is set to HDMI, it drops the DP connection, making Windows think it lost the monitor, putting me back at square one.

So I wrote a simple program in Python that sits in my notification tray. I can tell it to save or restore all my window positions. So if Windows loses the monitor, after it comes back, I can restore everything to where it was.

As a bonus, I also added a "Easy Copy/Paste" menu to quickly copy emojis like ¯\_(ツ)_/¯ and ಠ_ಠ to my clipboard.