16 comments

  • NelsonMinar
    41 minutes ago
    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.

    • lxgr
      37 minutes ago
      I remember hearing it’s even possible to plug in a USB-A plug too slowly, making the legacy pins make contact first, which results in a 480 Mbps connection – despite the cable, the host, and the device all supporting superspeed!
      • lloeki
        22 minutes ago
        Can confirm, was victim of this.

        Couldn't figure out why my 5-disk USB enclosure was so ungodly slow. Quickly I saw that it was capping suspiciously close to some ~40MB/s constant, so 480Mbps.

        lsusb -v confirmed. As it happened I did some maintenance and had to unplug the whole bay.

        Since the port was nearly tucked against a wall I had to find the port by touch and insert somewhat slowly in steps (brush finger/cable tip to find port, insert tip at an angle, set straight, push in) but once in place it was easy to unplug and insert fast...

        This was driving me "vanilla ice cream breaks car" nuts...

  • Izkata
    3 hours ago
    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.
    • wiradikusuma
      49 minutes ago
      Could you elaborate on "orientation"?

      Let's say for C-to-C, are you talking about swapping the head/tail? Or simply connecting at a different angle (180 degrees)?

    • duttish
      2 hours ago
      Wait what. I thought half the point of usb c was to not rely on orientation.

      Is there any way to check this other than experiment?

      My "solution" so far has been to not buy cheap cables and just hope I get quality in return.

      • lmm
        1 hour ago
        > I thought half the point of usb c was to not rely on orientation. > Is there any way to check this other than experiment?

        Well sure, a standards-compliant cable will work in either orientation, but it's always possible for some but not all of the pins or wires to break.

      • tennysont
        2 hours ago
        I think that I have a specific cable-device-orientation that is broken. Meaning, I think a particular USB C cable won't charge my phone if it's plugged in 'backwards'.

        I always assumed that USB C cables use different pins depending on orientation, and that some pins on the cable wore down.

        Maybe that's what happened here?

        • numpad0
          2 minutes ago
          [delayed]
        • consp
          1 hour ago
          My guess would be they used a one-sided pcb to connect the cable to and used half the wires. Some sockets internally link the power and ground pins, so it works both ways, but you get no resistor network and thus only standard 5v which gives you 500ma max (at best). With the resistors connected by the cable it's about 900ma to 3a which is probably what happens plugged in "correctly". Or some other magic happens on one side of the PCB to fool the charger into pushing the full 3A.
        • Waterluvian
          2 hours ago
          I think a more distressing thought is that it’s quite possible that your cable won’t charge your phone if it’s plugged in forwards.
      • cyberax
        1 hour ago
        It happens. More often than not, it can be physical damage or manufacturing defect for one of the contacts and/or wires.
    • atoav
      2 hours ago
      It is not unheard of to have single damaged lines/connector-joints within a cable. The question is whether your cable was designed that way or whether it was damaged in a way that made it do this.
  • madethemcry
    45 minutes ago
    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.

  • Tepix
    23 minutes ago
    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.

  • Someone
    1 day ago
    > 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.

    • lloeki
      11 minutes ago
    • JdeBP
      2 hours ago
      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.

      • Someone
        1 hour ago
        > But you didn't see that the source was one level up in the directory tree from the untrustworthy binary blob?

        No, silly me. Shortly searched for a src directory, but of course, should have searched for a bin directory, as that’s where vibe coding stores sources /s.

    • sorcercode
      1 day ago
      internally uses the same root command btw. in fact this recently changed for Tahoe (as the article mentions).

      started out as a shell script but switched to a go binary (which is what is linked).

      • procaryote
        1 hour ago
        I hope this doesn't become a trend. Moving it to go means you need to compile it before you run it, or blindly run an uninspected binary from some random guy

        It's not like the performance of this could have motivated it

  • basepurpose
    12 minutes ago
    i don't understand why do competent people need to mention that they vibe coded something.
    • stefanfisk
      10 minutes ago
      I wouldn’t be surprised if it’s actually a plus in the eyes of possible new employers these days.
      • basepurpose
        3 minutes ago
        vibe coding in my understanding is losing/confusing the mental model of your codebase, you don't know what is what and what is where. i haven't found a term to define "competently coding with ai as the interface".
    • sharkjacobs
      5 minutes ago
      I mean, they seem to address that pretty directly in the post

      > 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.

    • raincole
      6 minutes ago
      "My static blog templating system is based on programming language X" is the stereotypical HN post. In theory the choice of programming language doesn't matter. But HNers like to mention it in the title anyway.
  • nubinetwork
    2 hours ago
    They make a hardware device for this, it has several usb plugs on it, and two rows of LEDs that light up if the wires are all connected.
  • SomeoneOnTheWeb
    54 minutes ago
    Side question : what font are you using in your screenshots? I find it really nice looking
  • citizenpaul
    2 hours ago
    Cross compiling is not unique to golang. It does make it pretty easy though.
    • consp
      1 hour ago
      Why cross compile if it's made specifically for macos?
      • procaryote
        1 hour ago
        Why compile it when it could be a bash script?
        • dotancohen
          42 minutes ago
          Why a bash script when it could have been a one-liner?
  • bediger4000
    1 day ago
    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?

    • duckerduck
      7 minutes ago
      I've created a custom "new tab" page that I have been enjoying. 95% vibes. I wrote about it here:

      https://janschutte.com/posts/program-for-one.html

    • emilburzo
      48 minutes ago
      +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.

    • shepherdjerred
      39 minutes ago
      I spend an embarrassing amount of time on my homelab with Cursor

      https://github.com/shepherdjerred/homelab

    • mvdwoord
      1 hour ago
      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.

    • pjmlp
      1 hour ago
      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.

    • INTPenis
      1 hour ago
      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.
    • Hasnep
      3 hours ago
      Simon Willison's list has a few: https://tools.simonwillison.net/
      • sorcercode
        2 hours ago
        nice! thanks for sharing this. as always, Simon seems to be multiple steps ahead on this game.
    • AceJohnny2
      3 hours ago
      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.

      • dotancohen
        2 hours ago
        Who's the third? I'm assuming OpenAI and Anthropic are 1 and 2.
        • AceJohnny2
          2 hours ago
          Yeah, Anthropic & OpenAI for two, the third being Google. I hear Gemini's gotten quite good.
    • nurettin
      2 hours ago
      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.

    • ThrowawayTestr
      3 hours ago
      I've used chatgpt to make custom userscripts for neopets but I've never published them.
  • pmlnr
    1 hour ago
    Imagine if we printed the capabilities on the cables, like we used to.
    • chedabob
      6 minutes ago
      USB4 is supposed to have proper labels: https://www.pcworld.com/article/2602229/better-usb-labels-ar...

      I don't know if that necessarily helps though, because I've seen USB3 cables that seemingly have the bandwidth and power capabilities, but won't do video.

    • jeroenhd
      13 minutes ago
      Capabilities are printed on the side of ethernet cables and the text printed on the cable rarely seems related to the actual capabilities of the ethernet plug. Some cat5e cables are rated for 1000mbps but will happily run 5000mbps or 2500mbps (because those standards came after the text on the cable was last updated), other "cat6" cables are scams and struggle achieving gigabit speeds without packet loss.

      Plus, it doesn't really matter if you put "e-marker 100W USB3 2x2 20gbps" on a cable when half those features depend on compatibility from both sides of the plug (notably, supposedly high-end devices not supporting 2x2 mode or DP Alt mode or charging/drawing more than 60W of power).

    • threatripper
      1 hour ago
      That would only confuse potential buyers. You have to design everyday products for non-technical people.
      • withinboredom
        1 hour ago
        Not only that, it doesn’t stop unscrupulous manufacturers from just printing whatever they want.
  • self_awareness
    1 hour ago
    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.

  • thefz
    2 hours ago
    Vibe coded, no thanks.
  • rmunn
    3 hours ago
    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.
    • tomhow
      35 minutes ago
      We've updated the title now, thanks.
    • sorcercode
      2 hours ago
      yeah sorry about that. I don't have access to a Linux/Windows machine.

      if I got a hold of the output and commands run, would gladly modify it.

      • jasonjayr
        2 hours ago
        > lsusb -v

        On Linux that produces a lot of info similar to the macos screenshots, but with values and labels specific to the Linux USB stack.

        I wonder if AI could map the linux lsusb output to a form your tool can use...

      • lanyard-textile
        1 hour ago
        Is it really vibe coding if you’re testing it on the target machine? ;)
        • adastra22
          1 hour ago
          Yes, I think? “Vibe coding” is more about whether you are reading/reviewing the generated code, or just going with it, afaik.
      • kenperkins
        2 hours ago
        fwiw, it would take 10 minutes to download a linux docker image and build it in go to test. The harder part is getting the information from a different API on Linux.
        • RKearney
          2 hours ago
          This post is 12 minutes old. Have you finished yet?
        • febusravenga
          1 hour ago
          ... and orders of magnite more time to properly access USB devices to some arcane VM not in your control
    • swyx
      59 minutes ago
      what do you mean, all developers only use macs!

      (/s)

  • edarchis
    1 hour ago
    A similar tool, open source and portable Linux/Mac/Windows is Cyme. It works wonderfully well.

    https://github.com/tuna-f1sh/cyme

    • Slartie
      41 minutes ago
      Thanks for mentioning this, I spontaneously love it!