Oauth2 protocol

Nice to know what’s going on when we use oauth2 to get access.

https://milapneupane.com.np/2019/09/02/a-complete-guide-to-oauth2-protocol/

Curl Cookbook

Many useful curl arguments.

https://catonmat.net/cookbooks/curl

How Does BitTorrent Work? a Plain English Guide

Good read.

https://skerritt.blog/bit-torrent/

Water Hammer

Solitude and Leadership

So what I saw around me were great kids who had been trained to be world-class hoop jumpers. Any goal you set them, they could achieve. Any test you gave them, they could pass with flying colors. They were, as one of them put it herself, “excellent sheep.”

Because excellence isn’t usually what gets you up the greasy pole. What gets you up is a talent for maneuvering.

Not taking stupid risks like trying to change how things are done or question why they’re done. Just keeping the routine going.

… you will find yourself in environments where what is rewarded above all is conformity.

I can assure you from personal experience that there are a lot of highly educated people who don’t know how to think at all.

You do your best thinking by slowing down and concentrating.

[Concentrating] means gathering yourself together into a single point rather than letting yourself be dispersed everywhere into a cloud of electronic and social input.

Leadership means finding a new direction, not simply putting yourself at the front of the herd that’s heading toward the cliff.

Once the situation is upon you, it’s too late. You have to be prepared in advance. You need to know, already, who you are and what you believe: not what the Army believes, not what your peers believe (that may be exactly the problem), but what you believe.

Ref: https://theamericanscholar.org/solitude-and-leadership/

Get the First or Last Value in a Group Using Group By in SQL

Sample code in PostgreSQL

SELECT
  account,
  MAX(ARRAY[id, (data->'credit')::int])
    FILTER (WHERE type = 'credit_set'))
FROM
  event
GROUP BY
  account;

ref: https://hakibenita.com/sql-group-by-first-last-value

USB-C cables

usb-c_protocol_chart
Turns out there are 6 kinds of USB-C cables.

  1. USB 2.0 rated at 3A
  2. USB 2.0 rated at 5A
  3. USB 3.2 Gen 1 (5gbps) rated at 3A
  4. USB 3.2 Gen 1 (5gbps) rated at 5A
  5. USB 3.2 Gen 2 (10gbps) rated at 3A
  6. USB 3.2 Gen 2 (10gpbs) rated at 5A

ref: https://people.kernel.org/bleung/how-many-kinds-of-usb-c-to-usb-c-cables-are-there