Skip to content

Instantly share code, notes, and snippets.

View powerman's full-sized avatar

Alex Efros powerman

View GitHub Profile

Это краткая памятка, которая подходит во время вспышки любого респираторного вирусного заболевания. Я ее пишу не для того, чтобы вы срочно начинали все это делать - никакого повода нет. Но, если вы хотите снизить вероятность получения или распространения вирусов - прочитайте.

Общее поведение

  1. Контролируйте свою панику. Никакого повода для паники нет, как говорил человек, падающий с пятого этажа, пролетая мимо четвертого: “пока все нормально”. Напомню, уже на вашей памяти у людей была такая же паника из-за птичьего гриппа и атипичной пневмонии. И никакого зомби-апокалипсиса не произошло. Контролировать панику - значит следить за своими реакциями и стараться принимать решения разумно.
  2. Не осуждайте чужую панику. Это не помогает ни вам, ни паникующим - каждый человек волен паниковать или не паниковать перед лицом любой опасности. Кроме того, активное осуждение паники вокруг “эпидемий” порождает и подпитывает многочисленные теории заговора, так что просто не надо.
  3. Примите разумные меры предосторожно
@powerman
powerman / Testing_local_HTTPS_project.md
Last active December 20, 2023 19:22
Cheat sheet: How to securely test local/staging HTTPS project

How to securely test local/staging HTTPS project

Modern projects often support HTTPS and HTTP/2, moreover they can use Strict-Transport-Security: and Content-Security-Policy: headers which result in different behaviour for HTTP and HTTPS versions, or even completely forbid HTTP version. To develop and test such project locally, on CI, and at staging server we either have to provide a way to access it using HTTP in non-production environments (bad idea) or somehow make it work with HTTPS everywhere.

HTTP in non-production environments is a bad idea because we'll test not the same thing which will runs on production, and because there is a chance to occasionally keep HTTP enabled on production too.

  • What do Etcd, Consul, and Zookeeper do?
    • Service Registration:
      • Host, port number, and sometimes authentication credentials, protocols, versions numbers, and/or environment details.
    • Service Discovery:
      • Ability for client application to query the central registry to learn of service location.
    • Consistent and durable general-purpose K/V store across distributed system.
      • Some solutions support this better than others.
      • Based on Paxos or some derivative (i.e. Raft) algorithm to quickly converge to a consistent state.
  • Centralized locking can be based on this K/V store.
@ruario
ruario / h264-vivaldi-linux.md
Last active March 18, 2023 11:17
How to enable HTML5 MP4 (H.264/AAC) video in Vivaldi for Linux, via an alternative FFMpeg library
@jboner
jboner / latency.txt
Last active April 26, 2024 21:27
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD