Readit News logoReadit News
hiAndrewQuinn commented on Go is portable, until it isn't   simpleobservability.com/b... · Posted by u/khazit
bitbasher · 2 days ago
Once you use CGO, portability is gone. Your binary is no longer staticly compiled.

This can happen subtley without you knowing it. If you use a function in the standard library that happens to call into a CGO function, you are no longer static.

This happens with things like os.UserHomeDir or some networking things like DNS lookups.

You can "force" go to do static compiling by disabling CGO, but that means you can't use _any_ CGO. Which may not work if you require it for certain things like sqlite.

hiAndrewQuinn · a day ago
You don't need CGO for SQLite in most cases; I did a deep dive into it here.

https://til.andrew-quinn.me/posts/you-don-t-need-cgo-to-use-...

hiAndrewQuinn commented on Copy-Item is slower than File Explorer   til.andrew-quinn.me/posts... · Posted by u/hiAndrewQuinn
Arrowmaster · 5 days ago
So everything I say in this comment is unlikely to have any real impact if you were to replace the cables and retest, but I'm saying it for educational purposes. The reason the specs are strict is not because it cannot be done on less but because the acceptable margins for error and risk are lower in non consumer settings.

That switch does have metal around the ports but I could not find any indication in a datasheet that it designed to accept shielded cables. I also don't know what other devices you are connecting to the switch. Proper usage of shielded twisted pair needs the shielding to make contact to ground on both sides of the cable. I was taught years ago that using a shielded cable with neither side grounded or just one side grounded had the potential to turn the shielding into an antenna and make interference worse than with an unshielded twisted pair cable.

The flat cable is concerning. Flat cables are not part of any twisted pair spec. There tends to be two kinds of flat ethernet cables. The first being completely flat with no twisted pairs at all and the second kind having each pair twisted around each other but then the four pairs are parallel in the falter sheathing. The second kind is better and from the pictures that cable might be the second kind. However 33 meters is very long for a flat cable. Ideally you shouldn't use them but if you have to keeping them very short like under 2 meters is ok.

The pages for the other two cables never even show the cables but what looks like 3d renderings. I personally do not like that and it makes me think less of the vendors. I doubt any of the three cables would pass a full qualification test for Cat7 but they are probably completely indistinguishable from qualified Cat5e (since you are only using 1g) unless you are using them next to high voltage power conduits or next to a high power broadcast antenna. This just comes down to "Cat7 consumer products are a marketing scam."

hiAndrewQuinn · 3 days ago
Thank you! The flat cable was a necessary conceit for my apartment. I can't cut a notch out of the doorframe and expect to get my deposit back...
hiAndrewQuinn commented on Tiny Core Linux: a 23 MB Linux distro with graphical desktop   tinycorelinux.net/... · Posted by u/LorenDB
jaypatelani · 7 days ago
Hi check this https://smolbsd.org/#about Also standard NetBSD ISO might not be useful do check platform specific images.
hiAndrewQuinn · 3 days ago
This is really cool!!!
hiAndrewQuinn commented on The past was not that cute   juliawise.net/the-past-wa... · Posted by u/mhb
brabel · 7 days ago
Don’t they buy cottages anymore? In Sweden that is still extremely popular. Almost everyone who can afford one owns one, to my foreign eyes amusement as to me that’s just finding something to work on every summer. There’s a satirical reference to this in the series “Welcome to Sweden”, which makes fun of lots of stereotypical Swedish behavior.
hiAndrewQuinn · 7 days ago
Same here in Finland, and it just makes no sense to me at all. So often I will talk with someone who lives in a city here, and hear them complain about how brutally expensive it is, how nobody makes enough money to save anything, and a few sentences later they're telling me about how annoyed they are that they have to drive 6 hours every weekend to their $30,000 hut in the middle of nowhere to patch up the leaking roof or stuff more dried moss between the logs, and that they should have sprung for the $50,000 one that's only 90 minutes away. By car. In a country where gas is regularly over $10 a gallon. When they could get to work just fine on the bus.

We'll stick with our quiet little apartment and our free time and our growing savings accounts, thank you very much.

hiAndrewQuinn commented on Copy-Item is slower than File Explorer   til.andrew-quinn.me/posts... · Posted by u/hiAndrewQuinn
jiggawatts · 7 days ago
I wouldn’t mind a shell that uses structured text, such as JSON, but the inefficiency of the parsing and serialisation makes my eye twitch.
hiAndrewQuinn · 7 days ago
PowerShell does provide a ConvertTo-Json [0] for those who need it.

[0]: https://learn.microsoft.com/en-us/powershell/module/microsof...

Contrary to how it sounds I actually like PowerShell as a scripting language in itself. A lot of its ideas are pretty clever.

I treat my dormant familiarity with it as a resume hedge. Ideally things in my life continue to go well, and I can keep climbing the ranks of doing more and more impressive things powered by the Unix systems I've been daily driving since I was 14. If, however, things in my life ever go truly sideways, I could probably dial it way back and eke out an existence at some low pay, low stress, fully remote Windows admin job at some dinosaur of a company somewhere. There I could use PS and its deep, deep integration with all things Windows to automate 90-99% of it away, so that I could spend my time e.g. tending to my young children instead. (Even if Copy-Item is 27% slower than drag and drop. My time is still more expensive than the machine's.)

I truly never hope that has to happen, of course.

hiAndrewQuinn commented on Copy-Item is slower than File Explorer   til.andrew-quinn.me/posts... · Posted by u/hiAndrewQuinn
r1ch · 8 days ago
OP mentions using "Cat 7" cables - please don't buy these. Cat 7 isn't something that exists in TIA/EIA standards, only in ISO/IEC and it requires GG45 or TERA connectors. Cat 7 with RJ45 connectors isn't standardized, so you have no idea what you're actually getting. Stick with pure copper Cat 6A.
hiAndrewQuinn · 7 days ago
OP here, I looked into it. For legal reasons I will neither confirm nor deny any marketing claims here and let the experts decide. I will merely list the equipment I bought. [0] [1] [2] [3]

[0]: https://www.amazon.de/dp/B01EXDG2MO - "TP-Link TL-SG108 V3 8-ports Gigabit Network Switch"

[1]: https://www.amazon.de/dp/B07WG8TNDL - "CSL Cat 7 Network Cable, Gigabit, Ethernet, LAN Cable, PiMF Shielding With RJ 45 Connector, Switch, Router, Modem Access Point, White"

[2]: https://www.amazon.de/dp/B06XCYC4K7 - "deleyCON 5 x 0.5 m Cat7 Network Cables, Short, 10 Gigabit, RJ45 Patch Ethernet Cable, Copper, SFTP PiMF Shielding, LAN, DSL for Switches, Modems, Router, Patch Panels, Cat6, Cat5 Compatible, Black"

[3]: https://www.amazon.de/dp/B089MF1LZN - "Amazon Basics 30.5m White Flat RJ45 CAT7 Gigabit Ethernet Patch Internet Cable"

One copy of each would run you around 75-85 euros in total by my napkin math. Sticking with standard CAT 6A would have probably been 10-15 euros cheaper, and since I'm only aiming for 1 Gbps, not 10, I might have been able to get away with CAT 5e, even.

I suspect that the additional hours of time I would have had to spend actually doing my research here to make a fully informed purchase would have made this a slightly net negative decision financially. But that's mostly because of the small size and modest needs of the network I was wiring up. If I were wiring up anything that scaled beyond my own apartment it would have been valuable to know this, so thank you, my career will go better as a result of this correction.

hiAndrewQuinn commented on Tiny Core Linux: a 23 MB Linux distro with graphical desktop   tinycorelinux.net/... · Posted by u/LorenDB
1vuio0pswjnm7 · 8 days ago
"Tiny Core Linux has a version for Raspberry Pis called piCore [0] that I wish more people would look at, because it loads itself entirely into RAM and does not touch the SD card at all after that until and unless you explicitly tell it to."

Before RPI existed, I always made filesystem images for USB sticks in NetBSD so that writes never touched "disk" ("diskless"). This allows me to remove the USB stick after boot, freeing up the slot for something else

BSD "install images" work this way

I have been using the RPi with a diskless NetBSD image since around 2012; there are no SD card writes, the userland is extracted into RAM

I can pull out the SD card after boot and use the slot for something else

If I want data storage, I connect an external drive

It's been wild to read endless online complaints from so-called "technical" RPi users for the last 13 years about SD card wear and tear

To me, it's another example of how it's possible to have a solution that is as old as the hills and have it be completely ignored in favor of a "modern" approach that is fatally-flawed

hiAndrewQuinn · 7 days ago
I actually considered NetBSD for an old 32 bit box yesterday, so I'm somewhat wise to this world. My first experience with ramdisk operating systems was Puppy Linux back in the early 2010s. Ultimately I'm probably going with OpenBSD for that box.

But, NetBSD ISOs are much heavier than TCL ISOs, and so while I'm sure there's a way to get just what I want working in diskless mode, I'm not confident I will have any RAM to run what I actually want to run on top of it.

hiAndrewQuinn commented on Tiny Core Linux: a 23 MB Linux distro with graphical desktop   tinycorelinux.net/... · Posted by u/LorenDB
lukan · 8 days ago
"Phenomenal for those low powered servers you just want to leave on and running some tiny batch of cronjobs [1] or something for months or years at a time without worrying too much about wear on the SD card itself rendering the whole installation moot."

Yes, this is exactly what I want, except I need some simple node servers running, which is not so ultra light. Would you happen to know, if this still all works within the ram out of box, or does this require extra work?

hiAndrewQuinn · 7 days ago
To my understanding TCL expects the RAM-only / diskless case unless you put in a lot of extra work not to do that. In your situation the only thing you would have to really be worried about is whether 4 GB of RAM or whatever you have is enough to fit TCL and the files for your node server and the actual programs you are trying to run with all that. It doesn't get pretty once you exceed your available RAM, be forewarned - but that's true of all programs in a sense.
hiAndrewQuinn commented on Copy-Item is slower than File Explorer   til.andrew-quinn.me/posts... · Posted by u/hiAndrewQuinn
mgerdts · 8 days ago
Robocopy has options for unbuffered IO (/J) and parallel operations (/MT:N) which could make it go much faster.

Performing parallel copies is probably the big win with less than 10 Gb/s of network bandwidth. This will allow SMB multichannel to use multiple connections, hiding some of the slowness you can get with a single TCP connection.

When doing more than 1-2 GB/s of IO the page cache can start to slow IO down. That’s when unbuffered (direct) IO starts to show a lot of benefit.

hiAndrewQuinn · 7 days ago
The strange thing is, I did have /MT:32 on (added in a comment at the bottom of the page because I had to go to bed). I like to stick with defaults but I'm not that inept. /J probably shouldn't matter for my use case because 125 MBps just isn't that much in the grand scheme of things.
hiAndrewQuinn commented on Copy-Item is slower than File Explorer   til.andrew-quinn.me/posts... · Posted by u/hiAndrewQuinn
charcircuit · 8 days ago
>no scripting options at all on Windows that come close to the fearsome power of File Explorer’s copy and paste out of the box

You can use Powershell.

  $shell = New-Object -ComObject Shell.Application
  $shell.Namespace("C:\Source").ParseName("myfile").InvokeVerb("copy")
  $shell.Namespace("C:\Destination").Self.InvokeVerb("paste")

hiAndrewQuinn · 7 days ago
I didn't think of this one, will try it out, thank you.

I'm under the impression that using COM objects here in 2025 is generally discouraged, however. My Outlook mass email sysadmin scripts will have to be pried from my cold dead hands either way.

u/hiAndrewQuinn

KarmaCake day5053October 28, 2022
About
An American in Finland. аոdrеw [ät] ЅііLіkսіո [°] соm

https://andrew-quinn.me/

https://til.andrew-quinn.me/

https://meet.hn/city/fi-Tampere

https://github.com/hiAndrewQuinn

https://linkedin.com/in/heiandrewquinn

https://reddit.com/user/hiAndrewQuinn

https://x.com/hiAndrewQuinn

---

View Original