{"id":49608,"date":"2025-10-12T20:18:27","date_gmt":"2025-10-13T00:18:27","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=49608"},"modified":"2025-10-14T14:47:30","modified_gmt":"2025-10-14T18:47:30","slug":"script-to-detect-slow-usb-c-cables","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2025\/10\/12\/script-to-detect-slow-usb-c-cables\/","title":{"rendered":"Script to Detect Slow USB-C Cables"},"content":{"rendered":"<p><a href=\"https:\/\/kau.sh\/blog\/usbi\/\">Kaushik Gopal<\/a> (via <a href=\"https:\/\/news.ycombinator.com\/item?id=45489317\">Hacker News<\/a>):<\/p>\n<blockquote cite=\"https:\/\/kau.sh\/blog\/usbi\/\">\n<p>You have a drawer full of USB cables. Half are junk that barely charge your phone. The other half transfer data at full speed. But which is which?<\/p>\n<p>[&#8230;]<\/p>\n<p>The script parses macOS&rsquo;s <code>system_profiler SPUSBHostDataType<\/code> command, which produces a dense, hard-to-scan raw output[&#8230;]<\/p>\n<p>[&#8230;]<\/p>\n<p>The first version was a bash script I cobbled together with AI. It worked, but was a mess to maintain. Because I let AI take the wheel, even minor tweaks like changing output colors were difficult.<\/p>\n<\/blockquote>\n<p>But then he asked Claude to rewrite it to be easier to maintain.<\/p>\n<blockquote cite=\"https:\/\/kau.sh\/blog\/usbi\/\">\n<p>That&rsquo;s the real story. Not the script, but how AI changes the calculus of what&rsquo;s worth our time.<\/p><\/blockquote>\n\n<p>Previously:<\/p>\n<ul>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2025\/03\/21\/vibe-coding\/\">Vibe Coding<\/a><\/li>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2023\/10\/18\/usb-c-cables-comparison\/\">USB-C Cables Comparison<\/a><\/li>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2023\/10\/05\/avoid-overspending-for-iphone-15-usb-c-cables-and-chargers\/\">Avoid Overspending for iPhone 15 USB-C Cables and Chargers<\/a><\/li>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2022\/10\/05\/usb-simplifies-branding-but-reintroduces-active-cables\/\">USB Simplifies Branding But Reintroduces Active Cables<\/a><\/li>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2021\/12\/20\/usbefuddled\/\">USBefuddled<\/a><\/li>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2019\/07\/16\/how-many-kinds-of-usb-c-to-usb-c-cables-are-there\/\">How Many Kinds of USB-C to USB-C Cables Are There?<\/a><\/li>\n<\/ul>\n\n<p id=\"script-to-detect-slow-usb-c-cables-update-2025-10-14\">Update (<a href=\"#script-to-detect-slow-usb-c-cables-update-2025-10-14\">2025-10-14<\/a>): <a href=\"https:\/\/information.garden\/@benfry\/113221766338597625\">Ben Fry<\/a>:<\/p>\n<blockquote cite=\"https:\/\/information.garden\/@benfry\/113221766338597625\">\n<p>Quick hack to detect the speed of plugged-in USB devices on macOS, then write a simple HTML page with the info and open it in a browser. Very basic Python script now posted as a <a href=\"https:\/\/gist.github.com\/benfry\/304938b9a4e27ded65c0b36eb70b8272\">GitHub gist<\/a>.<\/p>\n<\/blockquote>","protected":false},"excerpt":{"rendered":"<p>Kaushik Gopal (via Hacker News): You have a drawer full of USB cables. Half are junk that barely charge your phone. The other half transfer data at full speed. But which is which? [&#8230;] The script parses macOS&rsquo;s system_profiler SPUSBHostDataType command, which produces a dense, hard-to-scan raw output[&#8230;] [&#8230;] The first version was a bash [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"2025-10-13T00:18:30Z","apple_news_api_id":"cade6cde-f16d-4877-a8b8-1a15b8f32bdb","apple_news_api_modified_at":"2025-10-14T18:47:33Z","apple_news_api_revision":"AAAAAAAAAAAAAAAAAAAAAA==","apple_news_api_share_url":"https:\/\/apple.news\/Ayt5s3vFtSHeouBoVuPMr2w","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[2],"tags":[1351,90,2682,30,2742,74,175,1154],"class_list":["post-49608","post","type-post","status-publish","format-standard","hentry","category-technology","tag-artificial-intelligence","tag-cable","tag-claude","tag-mac","tag-macos-tahoe-26","tag-opensource","tag-usb","tag-usb-c"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/49608","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=49608"}],"version-history":[{"count":2,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/49608\/revisions"}],"predecessor-version":[{"id":49616,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/49608\/revisions\/49616"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=49608"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=49608"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=49608"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}