Live data from Hacker News

TIL: You can make HTTP requests without curl using Bash /dev/TCP

mareksuppa.com

181–190 of 255 posts

Re: TIL: You can make HTTP requests without curl using Bash /dev/TCP

#181

Earlier quoted context omitted.

With agents in the house now, we don't use curl at all. Slowly they all are becoming implementation details.

Probably curl is safer than whatever cobbled up bash script your agent invented. Battle tested for years, and free, why replace that?

He probably means using curl directly. Indirectly it's still curl the LLM will default to, but that is an implementation detail.

Re: TIL: You can make HTTP requests without curl using Bash /dev/TCP

#182
In Plan 9 you did have a real (synthetic) /net, and could do that and more from any program. You could even mount /net from another machine via 9P protocol and have an instant VPN...

9front lets you play with that on Linux.

Some Plan 9 like /net things are visible in Go libraries... (Rob Pike legacy)

Re: TIL: You can make HTTP requests without curl using Bash /dev/TCP

#183

> As it turns out, bash can speak HTTP by itself. No, it can not. Bash lets you open TCP sockets. What you are doing here is trying to speak HTTP yourself, which is fine for testing and debugging, and hella cool for fun to do by hand, but you will shoot yourself in the foot if you try to use this pseudo http client unattended in reality. This toy code does not parse HTTP properly and will break. You could of course w…

Someone did a Minecraft server in pure bash. https://sdomi.pl/weblog/15-witchcraft-minecraft-server-in-ba...

It’s impressive but it’s not “pure bash”. Even just in the first section, the author talks about using hexdump and dd.

Though I did also notice they didn’t claim it was pure bash themselves. That’s a flare you added.

Re: TIL: You can make HTTP requests without curl using Bash /dev/TCP

#184

As a kid in the late 90s my mind was blown when I realized I could telnet to port 80, 25, or 110 and interact with the servers manually. Simple get: GET / HTTP/1.1 Content-Type: text/html User-Agent: l33t hax0rs lol X-Funny-Monkey: farts For sending a mail message on port 25: HELO mail-from: whoever@whatever.com mail-to: sysadmin@yaya.com Body of the message yay. POP3 was so long ago I forgot but you could list the m…

Isn't that the whole point of TCP? Creating a pair of two streams you can read out of and write to out of less reliable network primitives?

I am not sure why this is a revelation. Any college level networking course would cover this?!

Re: TIL: You can make HTTP requests without curl using Bash /dev/TCP

#185

Earlier quoted context omitted.

By this logic, Linux does not support Wi-Fi, because all the driver modules are "dynamically loaded at run-time."

Pure Linux doesn't.

Interesting. I have never heard kernel modules being regarded as non-linux, not in 30 years of LKM. Further compiling a monolithic Kernel is rather straight forward, in this day it is even possible to find wifi devices that do not require a an on device firmware blob uploaded from the kernel.

Re: TIL: You can make HTTP requests without curl using Bash /dev/TCP

#186

Earlier quoted context omitted.

When learning a language, I've heard it's good to find a reference speaker, such as a prolific actor, and mimic them in order to absorb several aspects of what makes them sound authentic as a speaker, such as vocabulary, intonation, diction, pacing. For many in the next generation of language learners, this reference will be Claude.

I think that the fact that AI has a very recognizable singular style is a problem. And this problem will be solved, sooner or later. It probably isn't a very important problem, because I feel that it should be relatively easy to solve (but maybe I'm wrong?). But certainly with smarter AI I do believe it'll become more fluent with choosing more diverse idioms and phrasing, rather than repeating one thing over and over…

> It probably isn't a very important problem

The amount of languages are decreasing on the earth, I would also say that dialects and accents are decreasing as well. I think this is a problem.

Re: TIL: You can make HTTP requests without curl using Bash /dev/TCP

#187

Earlier quoted context omitted.

If someone referred to the "previous decade" in 2004, would you have said the same thing? As the calendar rolled from 1999 to 2000, we entered a new millennium, century, decade, year, day, ...

> As the calendar rolled from 1999 to 2000, we entered a new millennium, century, decade, year, day, ... no, that all happened when we rolled from 2000 to 2001. smh, even paedants today aren't what they used to be.

The entirety of 1999 and 2000 was a nightmare. "No, buddy, we won't change millenium next january." "Nope. We are still in the 20th century." And so on...

I think that's more or less when I lost faith in humanity.

Re: TIL: You can make HTTP requests without curl using Bash /dev/TCP

#188
post #134

Earlier quoted context omitted.

Because curl is not installed in minimal docker images.

Sometimes I don't understand why people use those most tiny of images, at least for anything that they might ever ssh into. When there is no corresponding level of restraint in the libraries that we add to most applications, does it really make a difference to leave out the likes of curl, nano, ping, etc compared to how frustrating it is to operate in just busybox (etc)? I'm not just ranting, I'd actually like someon…

Less installed things means smaller security surface area, fewer things to patch when CVEs get discovered etc.

Thanks to `kubectl debug`, you don't need to install debugging utilities into your production image.

Re: TIL: You can make HTTP requests without curl using Bash /dev/TCP

#189
post #132

Earlier quoted context omitted.

Back in those days not only was there was no DKIM or SPF, most SMTP servers would accept email from anyone anywhere to anyone anywhere (i.e. 'open relay').

[ Note: Anyone who has been a geek since the 90s, there's nothing you don't already know here ] > most SMTP servers would accept email from anyone anywhere to anyone anywhere (i.e. 'open relay'). to date that claim, I'd say that by the late 90s at least, true open relays ("from anyone to anyone") were still numerous but carried a huge assumption of being part of spam operations (willingly or through ineptitude), and…

The magic for me, to this day in fact, is knowing that mail is essentially anyone on the internet being allowed to write to a mail servers disk.

There are rules now, but the concept is still almost intact, random people writing to the servers disk - to be later read by someone

Re: TIL: You can make HTTP requests without curl using Bash /dev/TCP

#190

As a kid in the late 90s my mind was blown when I realized I could telnet to port 80, 25, or 110 and interact with the servers manually. Simple get: GET / HTTP/1.1 Content-Type: text/html User-Agent: l33t hax0rs lol X-Funny-Monkey: farts For sending a mail message on port 25: HELO mail-from: whoever@whatever.com mail-to: sysadmin@yaya.com Body of the message yay. POP3 was so long ago I forgot but you could list the m…

You can't do that with HTTP/2 (but thankfully every server still talks HTTP/1). You also can't do that with TLS (and a lot of servers won't talk HTTP other than redirects). openssl s_client instead of telnet might allow you to tunnel text inside TLS, but that feels like a cheating. And many other modern protocols, sadly, prefer binary encoding, which makes it impossible to tinker with it on wire level, not without sp…

Nothing to regret. Text Protocol is too inefficient.
Post reply on HN