Live data from Hacker News

Show HN: Curl https://ec2.shop

ec2.shop

31–40 of 84 posts

Re: Show HN: Curl https://ec2.shop

#31
post #25
post #19

Earlier 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?

Wikipedia has a good section on the different methods of describing colour: https://en.wikipedia.org/wiki/ANSI_escape_code#3/4_bit

I've got some Go code that you can reuse if you want to the escape codes in Go: https://github.com/lmorg/murex/blob/master/utils/ansi/codes....

Just bare in mind that any numbers you see in documentation are sent as ASCII values rather than integers. eg `ESC[31m` (red text) should be sent to the terminal as

    []byte{  // http://www.asciitable.com/
        27,  // ESC character code
        91,  // '['
        51,  // '3'
        49,  // '1'
        109, // 'm'
    }

Though, as you know, most languages will have some syntactic sugar to translate characters to their ASCII values, eg

    'm' == 109
    Asc("m") == 109
    ...etc...
so at least you don't have to write all those values by hand.

Re: Show HN: Curl https://ec2.shop

#33
I really like this, but the horizontal lines are not helpful at all and just double the number of lines for no benefit.

You can obviously

    curl ec2.shop | grep -v ─
but I'm not sure I want to do that every time and I'm not exactly sure why, but when I do that, I can't select the entire row, only a column at a time (zsh on iTerm 2).

Re: Show HN: Curl https://ec2.shop

#36

I really like this, but the horizontal lines are not helpful at all and just double the number of lines for no benefit. You can obviously curl ec2.shop | grep -v ─ but I'm not sure I want to do that every time and I'm not exactly sure why, but when I do that, I can't select the entire row, only a column at a time (zsh on iTerm 2).

I also really like this, and have some feedback:

I don't find the colors useful. They aren't contextual at all, it's just certain columns have certain colors, for no apparent reason.

Re: Show HN: Curl https://ec2.shop

#38

From time to time, I want a quick tool to help me compare EC2 instances price. https://ec2instances.info/ works great but it's somewhat slow and didn't have a way to just `curl` from terminal. So I develop this small tool which you can do thing like curl https://ec2.shop curl https://ec2.shop?region=us-west-2&filter=t2,m4

And it has to be infinitely better than using the pricing API.
Post reply on HN