55 comments

[ 4.4 ms ] story [ 57.8 ms ] thread
> The script parses macOS’s system_profiler SPUSBHostDataType2 command, which produces a dense, hard-to-scan raw output

I couldn’t find source (the link in the article points to a GitHub repo of a user’s home directory. I hope for them it doesn’t contain secrets), but on my system, system_profiler -json produces json output. From that text, it doesn’t seem they used that.

Correct. But you didn't see that the source was one level up in the directory tree from the untrustworthy binary blob?

* https://github.com/kaushikgopal/dotfiles/blob/master/bin/usb...

Presumably there is a sensible way to do this in go by calling an API and getting the original machine-readable data rather than shelling out to run an entire sub-process for a command-line command and parsing its human-readable (even JSON) output. Especially as it turns out that the command-line command itself runs another command-line command in its turn. StackExchange hints at looking to see what API the reporter tool under /System/Library/SystemProfiler actually queries.

Two years ago, I wouldn’t have bothered with the rewrite, let alone creating the script in the first place. The friction was too high. Now, small utility scripts like this are almost free to build.

This aligns with the hypothesis that we should see and lots lots of "personalized" or single purpose software if vibe coding works. This particular project is one example. Are there a ton more out there?

I've used chatgpt to make custom userscripts for neopets but I've never published them.
I have a bunch at work, yes. Can't publish them.

Just an hour ago I "made" one in 2 minutes to iterate through some files, extract metadata, and convert to CSV.

I'm convinced that hypothesis is true. The activation energy (with a subscription to one of the big 3, in the current pre-enshittification phase) is approximately 0.

Edit: I also wouldn't even want to publish these one-off, AI-generated scripts, because for one they're for specific niches, and for two they're AI generated so, even though they fulfilled their purpose, I don't really stand behind them.

For me, claude churns like 10-15 python scripts a day. Some of these could be called utilities. It helps with debugging program outputs, quick statistical calculations, stuff I would use excel for. Yesterday it noticed a discrepancy that lead to us finding a bug.

So yes there is a ton but why bother publishing and maintaining them now that anyone can produce them? Your project is not special or worthwhile anymore.

Definitely.... I just bought a new NAS and after moving stuff over, and downloading some new movies and series, "Vibe coding" a handful of scripts which check completeness of episodes against some database, or the difference between the filesystem and what plex recognized, is super helpful. I noticed one movie which was obviously compressed from 16:9 to 4:3, and two minutes later, I had a script which can check my entire collection for PAR/DAR oddities and provides a way to correct them using ffmpeg.

These are all things I could do myself but the trade off typically is not worth it. I would spend too much time learning details and messing about getting it to work smoothly. Now it is just a prompt or two away.

Absolutely. I can come home from a long day of video meetings, where normally I'd just want to wind down. But instead I spend some time instructing an AI how to make a quality of life improvement for myself.
I see it differently, no need to assign learning tasks to juniors that can now be outsourced to the computer instead.

This is currently the vibe on consulting, possible ways to reduce headcount, pun intended.

+1 here, with the latest Chrome v3 manifest shenanigans, the Pushbullet extension stopped working and the devs said they have no interest in pursuing that (understandable).

I always wanted a dedicated binary anyway, so 1 hour later I got: https://github.com/emilburzo/pushbulleter (10 minutes vibe coding with Claude, 50 minutes reviewing code/small changes, adding CI and so on). And that's just one where I put in the effort of making it open source, as others might benefit, nevermind the many small scripts/tools that I needed just for myself.

So I share the author's sentiments, before I would have considered the "startup cost" too high in an ever busy day to even attempt it. Now after 80% of what I wanted was done for me, the fine tuning didn't feel like much effort.

Yep! Nothing worth sharing/publishing from me, but quite a few mini projects that are specific to my position at a small non-tech company I work for. For example we send data to a client on a regular basis, and they send back an automated report with any data issues (missing fields, invalid entries, etc) in a human-unfriendly XML format. So I one-shotted a helper script to parse that data and append additional information from our environment to make it super easy for my coworkers to find and fix the data issues.
(comment deleted)
It's more complicated than "this cable is good/bad". I had a suspicion about one of my cables for months, but just last week I confirmed it with a device that shows the volts/amps/watts/total kwh passing through it: I have a USB-C cable with orientation. Plugged in one way it transfers about 5x more power than the other way, and in the lower orientation it's low enough for the earbud case I use it with to not charge.
My pixel 7 seems to have fully died out of the blue while charging two days ago, using a USB-C I thought might be getting a little flaky (connected to my mac, I'd occasionally get repeating disconnects). I wonder if something along these lines could be the culprit.

I picked it up to find it had shut itself off, and now won't accept any charge, wireless or wired from any combination of power sources and cables. No signs of life at all.

I still prefer cables that are USB-A on one side for exactly this reason. Directionality is totally fine and even expected if one end is USB-A, but for a symmetrical looking cable it's a terrible idea.
Please update the title to mention that this is MacOS only; I got excited to try this out, but I only have laptops running Linux and Windows.
Vibe coded, no thanks.
Cross compiling is not unique to golang. It does make it pretty easy though.
Vibe coding. Producing code without considering how we should approach the problem. Without thinking where exactly is the problem. This is like Electron, all over again.

Of course I don't have any problems with the author writing the tool, because everyone should write what the heck they want and how they want it. But seeing it gets popular tells me that people have no idea what's going on.

Imagine if we printed the capabilities on the cables, like we used to.
(comment deleted)
Side question : what font are you using in your screenshots? I find it really nice looking
Content wise a nice idea, but I also like the conclusion about how AI made this possible in the first place. The author itself mentions this motivation. AI is undoubtedly perfect for utilities, small (even company internal) tools for personal use where maintainability is secondary as you can ditch the tool or rebuild it quickly.

> Two years ago, I wouldn’t have bothered with the rewrite, let alone creating the script in the first place. The friction was too high. Now, small utility scripts like this are almost free to build.

> That’s the real story. Not the script, but how AI changes the calculus of what’s worth our time.

lsusb will get you this info in Linux, but I like the idea of a little wrapper tool to make the output easier to parse.

480 vs. 5000 Mbps is a pernicious problem. It's very easy to plug in a USB drive and it looks like it works fine and is reasonable fast. Right until you try to copy a large file to it and are wondering why it is only copying 50MBytes/second.

It doesn't help that the world is awash in crappy charging A-to-C cables. I finally just throw me all away.

Why does it mention USB 3.2 (i.e. 20 Gbps) at all if it's for Macs? I thought Macs only support 10 Gbps and 40 Gbps, but nothing inbetween?

(which is inconvenient because USB 3.2 Gen 2x2 20 Gbps external SSD cases are much cheaper than USB 4 cases for now).

Also, he is calling a binary a script, which i find suspicious. This task looks like it should have been a script.

>Why does it mention USB 3.2 (i.e. 20 Gbps) at all if [...]

USB-IF in all their wisdom used "USB 3.2" to refer everything from 5 gbps (USB 3.2 Gen 1×1 ) to 20 gbps

https://en.wikipedia.org/wiki/USB_3.0#USB_3.2

Yes but i think in this context it means 20Gpbs, doesn‘t it?
i don't understand why do competent people need to mention that they vibe coded something.
Guys, please, don't upvote this. If this topic will beat the "Physics Nobel Prize 2025", I will lose my faith in HN.
I was looking for a USB cable tester (where I would plug in both ends of my cable and it would test it (power, data, ...).

There are plenty for Ethernet, but none such ones for USB. Was I looking with the wrong keywords or such device does not exist?

Note: I have a dongle that measures the power when inserted between the laptop and the charger, this is not what I am looking for

This is a vibe coding Trojan horse article.

> That’s the real story. Not the script, but how AI changes the calculus of what’s worth our time.

Looking at the github source code, I can instantly tell. It's also full of gotchas.

Fun fact: this information is already available in the System Information app on your Mac.

Hardware -> USB

I also use the app to check what wattage my cables are when charging my MacBook (Hardware -> Power)

> Go also has the unique ability to compile a cross-platform binary, which I can run on any machine.

Huh? Is this true? I know Go makes cross-compiling trivial - I've tried it in the past, it's totally painless - but is it also able to make a "cross platform binary" (singular)?

How would that work? Some kind of magic bytes combined with a wrapper file with binaries for multiple architectures?

No, I don't get it. Firstly, the normal system command output is not hard to read, but secondly, this output doesn't list any of the capabilities of the cables, just the devices at the ends of them. Perhaps showing an example of the output when the device is plugged in through the wrong cable would have helped. Does the tool produce a similar warning to the system popup, that is "this cable and device are mismatched"?
> Two years ago, I wouldn’t have bothered with the rewrite, let alone creating the script in the first place. The friction was too high. Now, small utility scripts like this are almost free to build.

adding to the theory that soon we gonna prefer to write, rather download ready-made code, because the friction is super low

(comment deleted)