4 ms·
> 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, wh
by basilikum 4mo ago
> 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 write a full http/1.1 client in bash, you can even do a full http server in pure bash: https://github.com/bahamas10/bash-web-server https://github.com/bahamas10/bash-web-server
For less insane, non-bash shells there is always nc which is usually probably the wiser choice.
- mrshu 4mo ago> No, it can not. Bash lets you open TCP sockets. Very fair pushback -- I did get carried away and will update the article to be more precise. Thanks for raising it! > For less insane, non-bash shells there is always nc which is usually probably the wiser choice. For completeness, `nc` or any netcat equvialent I could think of was not available in the image I was trying this with. It would certainly be a better option though.
- bearjaws 4mo agoThis is the most Claude pilled comment I've seen here.
- thih9 4mo agoThis worries me. Some AI writing styles became mainstream; at first it was the em-dashes, now it’s “A, not B” patterns and excessive acknowledging. There will be more. Was grandparent comment written by an LLM? Or is this a human who copies a style they saw in a blog post, unaware that they’re copying an AI? Or is this a human who spent too much time talking to an AI and now they just talk like this? Or is this an organic human response and we’re all paranoid by now? I don’t know which would be worse.
- 8bitsout 4mo agoI'm going to go insane from all of this
- elevation 4mo agoWhen 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.
- disqard 4mo agoInsightful, and scary! Imitating an imitation machine... even if no one is trying to intentionally do so, McLuhan's "we become what we behold" is inescapable.
- vbezhenar 4mo agoI 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, to a point of being a comically similar. So people who learn on AI-generated text, will not learn from just one recurring style.
- pastage 4mo ago> 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.
- eddd-ddde 4mo agoSo? That's literally how language works. The importance is not in the writing style, but in the content of the words.
- nialv7 4mo agowhat would be a non-pilled way of saying the same thing?
- mrshu 4mo agoIt's pretty rough to learn I sound like Claude. Will need to do something about it then. (For what it's worth I did write the message above manually but I understand why no one would believe that now. At least I did not call netcat "load-bearing" [https://mareksuppa.com/til/load-bearing/ https://mareksuppa.com/til/load-bearing/] or something...)
- ed_elliott_asc 4mo agoOk Claude :)
- ffsm8 4mo agoI know that feeling I notice myself getting afflicted with llm-isms after a full workday. And I didn't always notice, sometimes I only realize the day after... Like it slowly siphoned out my soul, which then reconnected with me over night
- nandomrumber 4mo ago[dead]
- sisve 4mo agoI did not think you sounded like claude. Then I looked again after the comment was made and then I saw some of the vibes. Like acknowledging a mistake you have done. Before that would just made you top 5% (or maybe top 1%) of the nicest people to talk too.. know ppl think you are Claude. We are all going crazy s a sibling comment said.
- deleted 4mo ago[deleted]
- fc417fc802 4mo agoIt's wasn't "acknowledging the mistake" it was the phrasing and general structure while doing so.
- BearOso 4mo agoAvoid the backtick quotes, too. Claude also mistakenly uses them outside of markdown.
- deleted 4mo ago[deleted]
- tbossanova 4mo agoI’m torn. It’s a great thing to share knowledge and take feedback graciously. Maybe this kind of comment will encourage more of that. But you also need people to tell you what is up without unnecessary filters. It’s a challenge
- throwrioawfo 4mo ago[flagged]
- mrshu 4mo agoAn old habit that unfortunately makes one indistinguishable from LLMs these days...
- disqard 4mo agoI have done the same for many years now, and I feel like it's going to be an annoying false positive for people like us. I remember when the "hacker vs. cracker" distinction went away because Hollywood co-opted the former and it became de facto "hacker == bad guy"
- scubbo 4mo agoFWIW, I didn't read this as AI-like. Even on a re-read, it's only the quasi-em-dash, and _maybe_ the polite acknowledgement of "Very fair pushback" (just good etiquette, IMO!) that would ring any alarm bells. You're fine.
- farmerbb 4mo agoNot to mention, the typo in the word "equivalent".
- a-dub 4mo agoit's not that insane. i've been manually typing http requests in since before http/1.1 and the mandatory host header. it is insane to use it for anything serious (also the opposite, implementing webservers in bash), but for quick testing it's pretty great!
- bitmasher9 4mo agoWhy wouldn’t you use curl for the quick test?
- hnav 4mo agoSometimes you want to do something that curl cannot express, e.g. timing, protocol oddities, etc. For example you may want to issue a CONNECT to an echo server through a proxy and observe the bytes flowing back and forth. You may want to see what happens when conflicting hop-by-hop headers are specified without worrying about the client's (curl's) interpretation of them. A simple nc -c (or openssl s_client -crlf) lets you do all of that.
- Bender 4mo agoFor what it's worth curl can do very detailed timing [1] and it can also do this using a proxy export http_proxy=http://your.proxy.server:port/ export HTTPS_PROXY=https://your.proxy.server:port/ curl -x http://proxy_server:proxy_port --proxy-user username:password or $socks-wrapper curl # [2] [1] - https://dev.to/gbhorwood/curl-getting-performance-data-with-curl-47f1 https://dev.to/gbhorwood/curl-getting-performance-data-with-... [2] - torsocks, tsocks, wireproxy, shadowsocks-rust, proxychains-ng, etc...
- hnav 4mo agowhat I meant was a proxy that implements HTTP/1.1 CONNECT and a server behind it like ``` mkfifo /tmp/myfifo cat /tmp/myfifo | nc -l 12345 > /tmp/myfifo ``` so if you manually type out CONNECT host:12345 HTTP/1.1 host: host:12345 you can see exactly what's happening. To be fair you can hack curl to support that via curl -x proxy:3333 telnet://host:12345 but that's not exactly what you want and requires curl to have been compiled with telnet support.
- morpheuskafka 4mo ago> No, it can not. Bash lets you open TCP sockets. I thought you had to use a program called netcat for that--if not then what is the point of that binary? And for that matter, can't you also use telnet to manually send HTTP?
- some_random 4mo agonc is basically just a nicer interface for the same thing, in the same way that curl is. https://linux.die.net/man/1/nc https://linux.die.net/man/1/nc
- deleted 4mo ago[deleted]
- deleted 4mo ago[deleted]
- TZubiri 4mo ago>No, you can't write 10 lines of code, you have to import a 100k LOC dependency Common misconception, if you want to replace a dependency on a swiss knife you don't need to implement a swiss knife, sometimes you can just implement the last helix of the corkscrew.
- cyanydeez 4mo agoit's curious what you'd be building where you think you can hit the reliability of curl with a bash script.
- pillmillipedes 4mo agoa script ten lines long perhaps?
- TZubiri 4mo agohealth check, check that website/webapp returns 4xx and some known keyword api, GET url, content-type aplication/json, parse json you can even invert it and make a server
- nandomrumber 4mo ago[dead]
- andelink 4mo agoNice parameter expansion examples in that bash-web-server. It uses the $_ parameter in ways I hadn’t thought to before, often preceded by a single : ${x} line for pre-processing of the variable.
- iam-TJ 4mo agoNeed to be clear that "full http server in pure bash" is incorrect. Bash cannot listen on a TCP/UDP socket for incoming connections. bash-web-server project builds a C language socket listener [0] that is dynamically loaded at run-time as a "built-in" module that makes the functionality available. [0] https://github.com/bahamas10/bash-web-server/tree/main/loadables https://github.com/bahamas10/bash-web-server/tree/main/loada...
- majorchord 4mo agoBy this logic, Linux does not support Wi-Fi, because all the driver modules are "dynamically loaded at run-time."
- zwischenzug 4mo agoPure Linux doesn't.
- pastage 4mo agoInteresting. 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.
- zwischenzug 4mo agoI don't know TBH. It's just that if you're going to have a 'pure' designation for a tech, it's going to be pretty strict (as per bash and adding modules). I've never heard of 'pure' linux, but 'pure' bash has a recognised meaning. If someone said 'pure Linux' and it meant the core without loaded modules I wouldn't be shocked. Not sure how useful it would be, though.
- rascul 4mo ago> If someone said 'pure Linux' and it meant the core without loaded modules I wouldn't be shocked. Not sure how useful it would be, though. That probably wouldn't be a useful distinction because almost every module can be built in
- tombert 4mo agoThere's even a Rails-like framework for Bash: https://github.com/jneen/balls https://github.com/jneen/balls
- sgjohnson 4mo agoSomeone did a Minecraft server in pure bash. https://sdomi.pl/weblog/15-witchcraft-minecraft-server-in-bash/ https://sdomi.pl/weblog/15-witchcraft-minecraft-server-in-ba...
- hnlmorg 4mo agoIt’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.