Live data from Hacker News

Ask HN: Is there any software you only made for your own use but nobody else?

news.ycombinator.com

461–470 of 484 posts

Re: Ask HN: Is there any software you only made for your own use but nobody else?

#461
post #460
post #421

Earlier quoted context omitted.

If you reduce the problem statement to an ELF x86 program written in C, with a symbol table and a complete relocation table (not just the one you get when dynamically linking), then sure it's trivial, you have almost all the information you need to make an object file (issues like switch jump tables can still crop up in that case). If you don't have that relocation table from `cc -r` however, you'll run into problems…

> the MIPS relocation synthesizer is a thousand lines of absolute eldritch horrors Wow I only really know amd64, arm64, and i8086. What is it about MIPS that makes it so evil?

That would warrant an entire blog post to describe all the pitfalls [1], but I'll condense it down to the highlights.

On MIPS, loading a pointer is classically done in two instructions, a LUI and an ADDIU, which forms a HI16/LO16 relocation pair I need to identify precisely in order to delink code. I'm using Ghidra's references in my analyzers, but these are attached to only one instruction operand, typically a register or an immediate constant.

So my MIPS analyzer has to traverse the graph of register dependencies for a reference within an instruction and find which two instructions are the relocation pair. It's trickier than it sounds because references can have an addend that's baked in the immediate constants (so we can't just search for the pattern of the address bits inside the instructions) and complex memory access patterns inside large functions can create large graphs (ADDU in particular generates two branches to analyze, one per source register). It's bad enough that I have one method inside my analyzer in particular that is recursive and takes six arguments, four of which rotate right one step at each iteration.

But that graph traversal can't be done in reverse program order, because there are instruction patterns that can terminate the graph traversal too early with the right mix of branches, instruction sequencing and register reuse. I've had to integrate code flow analysis to figure out which parent code block has to be actually considered during the register graph traversal.

But the most evil horror is the branch delay slot. One particular peephole optimizer consists of vacuuming up a branch target instruction inside a branch delay slot and shift the branch target one instruction forward, which effectively shortens the execution flow by one instruction. It also duplicates the instruction, which is catastrophic if it had a HI16 relocation because now we have LO16 relocations with multiple HI16 parents, which can't be represented by object file formats. I have to detect and undo that optimization on the fly by shifting the branch targets one instruction back, which I accomplish by adjusting the relocation addends for the branches.

I've only written relocation analyzers for x86 and MIPS so far. I don't know what other horrors are lurking inside other architectures, but I expect that all RISC architectures with split relocations will require some form of that register graph traversal and code flow analysis [2]. What I do know is that my MIPS relocation analyzer [3] is probably the most algorithmically complex piece of code I've ever written so far, one that I've rewritten a half-dozen times over two years due to all the edge cases that kept popping up. I also had to create an extensive regression test suite to keep the analyzer from breaking down in subtle ways every time I need to modify it. I expect that there are still edge cases to fix in there that I haven't encountered yet.

[1] I've written about some of them here, but it's far from the whole story: https://boricj.net/tenchu1/2024/05/15/part-10.html

[2] That piece of code is split off in its own Java class: https://github.com/boricj/ghidra-delinker-extension/blob/mas...

[3] In case you're curious: https://github.com/boricj/ghidra-delinker-extension/blob/mas... (remember that the register graph and code flow bits are split off inside another class)

Re: Ask HN: Is there any software you only made for your own use but nobody else?

#462

I have a very simple AutoHotkey script that remaps [h,j,k,l] to [left, down, up, right] when the LeftAlt modifier is pressed. This prevents me from having to switch to the arrow keys all the time. I use it for navigating the list of browser search suggestions, or for quickly moving around any program that doesn't have vim bindings. I've found it to be especially helpful while using the https://www.desmos.com/scientif…

That's brilliant, very clever and practical use of remapping keys!

Re: Ask HN: Is there any software you only made for your own use but nobody else?

#463
Other people do use this: https://cuppin.gs/ but realistically I only make it for myself.

We have coffee venues from different parts of the world but they become red ("picked") only if I and my friends travel there. The main use case for the app is still me being somewhere--mostly in my hometown these days--opening up my phone and looking for a good cup of coffee. Other people can take or leave that proposition.

Re: Ask HN: Is there any software you only made for your own use but nobody else?

#464

Earlier quoted context omitted.

Not the problem I'm having at all. What happens in my case is that Explorer forgets the "When using multiple displays, show my taskbar apps on..." setting. It just randomly changes the setting in memory: I can either change the setting back and forth, or restart Explorer, and then it works correctly. It's the oddest bug I've seen.

Ah, I see. That is indeed odd. Maybe one of the monitors is dropping out or sleeping? Are they daisy chained? Same connection type or different? Onboard or GPU connected? Maybe the GPU PCIe interface is going into some kind of power saving mode? I do tech support a fair bit so if there’s any commonalities, hypotheses, or coincidences you can think of that might help me figure this out if I come across it, please let…

It's not a driver or hardware issue. Please concentrate more closely on the problem as I describe it, not as you believe it to be.

It happens with many different kinds of monitors, with many different kinds of docking stations, and 3 different laptops. I started encountering the problem on Windows 10, and continue to encounter the problem on Windows 11.

I'm pretty sure it has something to do with the fact that I change a lot of the taskbar's defaults. It's probably a setting that most Microsoft Windows engineers don't use, and an unusual enough corner case that either Microsoft Windows engineers haven't seen it, or are aware of the issue but haven't prioritized it.

---

BTW: A lot of Explorer problems are not hardware related. Many software packages install Explorer plugins that crash Explorer or make it unresponsive. Ever have the right-click menu take forever to display? That's most likely a 3rd party plugin blocked on a network or filesystem call.

(I shipped a plugin and took care to architect the application so it wouldn't block Explorer.)

Re: Ask HN: Is there any software you only made for your own use but nobody else?

#465
post #243

I wrote a pair of PHP scripts that let me subscribe to YouTube channels as podcast feeds, with enclosure URLs and all. One script parses the channel's RSS feed and inserts enclosure tags, with the target URLs pointing to the second script with the video ID as a parameter. The second script then wraps youtube-dl and redirects to the raw video URL obtained for that video ID by youtube-dl. This worked great for years, b…

On the off chance you don't already know about it, yt-dlp can do that interleaving for you. Still a headache to add to the pipeline, but less to invent at least.

Much more than a headache, unfortunately: yt-dlp only remuxes the stream as a post-processing step after all streams have been downloaded. So this would take my nice on-demand stateless solution that just returns redirects to the raw video URLs from YouTube, and turn it into a stateful application that downloads and rehosts the video files on my own server.

To accommodate that, I'd then need to create a configuration layer that determines which feeds to download and when, since I wouldn't necessarily want every video posted on every channel I subscribe to downloaded to my server in advance.

So it turns the whole project into something quite different and much more complex. If there was something that could remux the streams and then pipe the output stream back out over HTTP, that would be more appropriate. Maybe I can work with bindings to FFMpeg to create something that would work here.

Re: Ask HN: Is there any software you only made for your own use but nobody else?

#467

To anyone in the US who said they make their own apps for their own iPhone: do you really pay Apple $99/year for that "privilege", or do you reinstall the app every 7 days (or use workarounds like AltStore non-PAL or jailbreaking) to get around this?

I pay $99/year. With the amount of money I make, it’s a really trivial sum for the convenience. Plus I could use it to add Apple OAuth to my web apps if I wanted to.

[dead]

Re: Ask HN: Is there any software you only made for your own use but nobody else?

#468
post #117

40 lines of C to control brightness on Linux in the way I like (Pressing brightness up key should make it go up more than pressing brightness down key makes it go down). It took 20 minutes to make. Used as a keyboard binding. TODO list program and the list is periodically printed on my desktop with conky Software to automatically book reservations at good restaurants on Resy. Supported proxies, multi account, automat…

any chance to opensource your foto searching?

Re: Ask HN: Is there any software you only made for your own use but nobody else?

#469

In high school I built a chrome extension to secretly chat with my girlfriend on the Google Search page. Her parents were super strict and would not allow having a boyfriend, we were caught once so wanted to be few steps ahead of their detection. Using internet was allowed for her to study. Made the extension such that when you search for something popular click on the largest image in knowledge graph (right side box…

> Switched to a simple ROT13 encoded sms-ing. With the key changing every day.

I was confused. So, some days it was ROT-13, some days Double ROT-13, some days Triple ROT-13? Surely not.

I guess you mean that it wasn't always 13 (so, not really ROT-13).

Re: Ask HN: Is there any software you only made for your own use but nobody else?

#470
post #354

Earlier quoted context omitted.

How'd she take it?

Well, while we obviously were both upset and sad about the situation, she was very understanding, for which I am thankful. We were in it together. It helped that she managed to find a slightly better job pretty shortly thereafter. Nevertheless I felt really guilty about it and as a result the obvious relevant professional programming lesson was instantly and indelibly burned into my brain: you can fix bugs, but you m…

I've favorited your top-level comment. This is an incredibly important lesson to learn, one that I wish I learned earlier in life, but your favorited comment will be a reminder for me in the future.
Post reply on HN