Skip to content

Instantly share code, notes, and snippets.

Testing on Mac

Add to /etc/pf.conf

block out proto udp from any to any
block in proto udp from any to any
pass out proto udp from any to any port 53
pass in proto udp from any to any port 53

To apply:

asyncapi: '2.2.0'
info:
title: Internal Digitalbank EventBus on Azure EventGrid
version: 1.0.0
description: This service is in charge to pass data between Azure Step Functions and Digital Mobile Payments Service.
channels:
internalPayments/InitPayment:
publish:
message:
$ref: '#/components/messages/InitPayment'
asyncapi: '2.2.0'
info:
title: Kafka API with Core-Processing
version: 1.0.0
description: This service is part of core bank and responsible for accepting card operations commands
channels:
paymentTransactions/InitTransaction:
publish:
message:
$ref: '#/components/messages/InitTransaction'
openapi: 3.1.0
info:
title: Digital Bank sign-in API
version: '1.0'
summary: Allows bank clients to sign in.
contact:
name: G2
servers:
- url: 'http://localhost:3000'
paths:
# From https://gist.github.com/cupuyc/8855d0e958d977ef9d6928542e35a886
set -e
mkdir -p .ebextensions
# Define instance type to use
tee -a .ebextensions/ec2-settings.config > /dev/null <<EOT
option_settings:
aws:autoscaling:launchconfiguration:
@cupuyc
cupuyc / protocols.csv
Last active November 1, 2020 12:35
Video Protocols
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 6.
Protocol,Description
RTMP,"This is the first protocol that should be mentioned, because it is an old protocol that did a great job in the time the Adobe Flash shined in pair with Adobe Media Server. Nowadays, many live broadcast applications still utilize it to ingest video data from broadcaster app/device to media servers. Unfortunately browsers can’t play it natively."
WebRTC,"Web Real-Time Communications comes to allow modern browsers to support video chats. It combines many other protocols under the hood. The business value of it is unquestionable. It provides low-latency and automatic quality adjustments depending on network conditions."
HLS,"HTTP Live Streaming allows desktop and mobile browsers to natively play video content. Used as protocol for live steam in YouTube, Twitch."
MPEG-DASH,"Similar to HLS used for live stream events, and envisioned as the successor of it. However this is a downside that some mobile browsers can’t play it natively."
CMAF,"The youngest technology on the live streaming mark
@cupuyc
cupuyc / LetsEncrypt.md
Created November 29, 2017 14:00 — forked from davestevens/LetsEncrypt.md
Let’s Encrypt setup for Apache, NGINX & Node.js

Let's Encrypt

Examples of getting certificates from Let's Encrypt working on Apache, NGINX and Node.js servers.

Obtain certificates

I chose to use the manual method, you have to make a file available to verify you own the domain. Follow the commands from running

git clone https://github.com/letsencrypt/letsencrypt
cd letsencrypt
@cupuyc
cupuyc / puzzle.md
Last active April 10, 2017 12:24
Misspelled lookups: a Grammarly coding puzzle (6 days duration)

Misspelled lookups

Given two strings, S1 and S2, we can define an edit distance as the minimum number of operations required to change S1 to S2.

The operations might be one of the following:

  • delete a character
  • insert a character
  • substitute a character for another character
@cupuyc
cupuyc / latency.txt
Created March 11, 2017 15:21 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
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
//sol Wallet
// Multi-sig, daily-limited account proxy/wallet.
// @authors:
// Gav Wood <g@ethdev.com>
// inheritable "property" contract that enables methods to be protected by requiring the acquiescence of either a
// single, or, crucially, each of a number of, designated owners.
// usage:
// use modifiers onlyowner (just own owned) or onlymanyowners(hash), whereby the same hash must be provided by
// some number (specified in constructor) of the set of owners (specified in the constructor, modifiable) before the
// interior is executed.