Color output seems to be tuned for dark terminal backgrounds. Memory, vCPUs, and Storage are nearly unreadable on a white background.
I have a white background too. Is there a workaround for this?
Show HN: Curl https://ec2.shop
61–70 of 84 posts
Re: Show HN: Curl https://ec2.shop
#62Earlier quoted context omitted.
I've moaned about this with other CLI tools as well. I wish trend of using RGB values in ANSI escape codes would die because as ugly as the 16*3 colour fields¹ are, they are at least customisable so people can use palettes that suite their terminal and eyesight. You don't get any such opportunity if the developers hard code the colour values in (and it's worse with a tool like this because you can't even set an envir…
Can you link me to a way to use colours that change with the terminal colour preset? I haven't come across anything like that or maybe didn't pay attention. It would be really helpful You said you can't even set an env variable to change them so I assume that there is an even better way?
Re: Show HN: Curl https://ec2.shop
#63Re: Show HN: Curl https://ec2.shop
#64Is there a way to show the output in json format?
curl https://ec2.shop -H 'Accept: application/json'
Re: Show HN: Curl https://ec2.shop
#65It would be very helpful if you would support the `Accept: application/json` header. This way, we could use it in combination with jq to do arbitrary filtering:
curl -L -H "Accept: application/json" ec2.shop | jq .Re: Show HN: Curl https://ec2.shop
#66Interesting tool. Would be really useful if it supported Spot prices, which are even more of a PITA to find using Amazon’s UI.
Re: Show HN: Curl https://ec2.shop
#67Is there a way to show the output in json format?
curl https://ec2.shop -H 'Accept: application/json'
curl 'https://ec2.shop?json'
curl 'https://ec2.shop?txt'Re: Show HN: Curl https://ec2.shop
#68Re: Show HN: Curl https://ec2.shop
#69Earlier quoted context omitted.
There should be a new mime type for this: text/x-ansi
but why "ansi"? ANSI is only an encoding. You can have html that's in ansi, and you can have something like OP's that's not in ansi (eg. if you add emojis).
Re: Show HN: Curl https://ec2.shop
#70Earlier quoted context omitted.
Are you manually detecting Curl specifically? If I use anything other than Curl, e.g. HTTPie or wget, I get the HTML page, even if I provide an `Accept: text/plain` request header. If I use one of those tools and spoof the Curl user agent string, I get the text/plain response. You should probably just look at the Accept request header, it’s there specifically so clients can tell you what kind of response they want.
Great idea. I just implement it: https://github.com/yeo/ec2.shop/commit/ab258aef3ac2ad3d45b26... Now by default it's text mode, so request by http client library or tool like curl, wget, httppie all get text bersion. Only when detecting `Accept` contains `html` and user agent is safari/chrome/firefox etc it send html version.