Computer & Software

tmux cheatsheet

Session Session groups one or more windows together. Each session has one current window, this is the window displayed when the session is attached and is the default window for any commands that target the session. Sessions do not have an index but they do have a name, which must be unique. Every window has …

tmux cheatsheet Read More »

MemTable, WAL, SSTable, Log Structured Merge(LSM) Trees

Taken from: Build a Database Pt. 2: MemTable MemTable – facebook/rocksdb wiki Write-Ahead Logging -SQLite Writing A Database: Part 2 — Write Ahead Log SSTable and Log Structured Storage: LevelDB Study Guide — Cassandra Reads and Writes On Disk IO, Part 3: LSM Trees Bigtable: A Distributed Storage System for Structured Data MemTable The MemTable …

MemTable, WAL, SSTable, Log Structured Merge(LSM) Trees Read More »

Linux: Open files (systemd, ulimit, netstat, lsof)

ulimit $ man limits.conf NAME limits.conf – configuration file for the pam_limits module DESCRIPTION The module applies ulimit limits, nice priority and number of simultaneous login sessions limit to user login sessions. This description of the configuration file syntax applies to the /etc/security/limits.conf file and *.conf files in the /etc/security/limits.d directory. Also see: …

Linux: Open files (systemd, ulimit, netstat, lsof) Read More »

Big O notation: Orders of common functions

constant Determining if a binary number is even or odd; Calculating  ; Using a constant-size lookup table double logarithmic Number of comparisons spent finding an item using interpolation search in a sorted array of uniformly distributed values logarithmic Finding an item in a sorted array with a binary search or a balanced search tree as well as all operations in a Binomial heap …

Big O notation: Orders of common functions Read More »

JavaScript: Number.EPSILON and Number.MAX_SAFE_INTEGER

EPSILON The Number.EPSILON property represents the difference between 1 and the smallest floating point number greater than 1 > Number.EPSILON == Math.pow(2, -52) true Use Number.EPSILON to test floating point number equality. x = 0.2; y = 0.3; z = 0.1; equal = (Math.abs(x – y + z) < Number.EPSILON); MAX_SAFE_INTEGER & MIN_SAFE_INTEGER The MAX_SAFE_INTEGER constant has a …

JavaScript: Number.EPSILON and Number.MAX_SAFE_INTEGER Read More »

Non-cryptographic Hash Functions

See: List of non-cryptographic hash functions Pearson hashing Pearson hashing is a hash function designed for fast execution on processors with 8-bit registers. This hash function is a CBC-MAC that uses an 8-bit substitution cipher implemented via the substitution table. An 8-bit cipher has negligible cryptographic security, so the Pearson hash function is not cryptographically strong, but it is useful for implementing hash tables or as a data integrity check …

Non-cryptographic Hash Functions Read More »


$ cat from random import shuffle example_table = list(range(0, 256)) shuffle(example_table) def hash8(message, table): hash = len(message) % 256 for c in message: #hash = table[(hash+ord(c)) % 256] print(f’for c=\'{c}\’, ord(c)={ord(c)}: {hash} ^ {ord(c)} => {hash ^ ord(c)} and table[hash ^ ord(c)] = {table[hash ^ ord(c)]}’) hash = table[hash ^ ord(c)] return hash if …

Python: Read More »

Bloom Filters in Redis

Probabilistic (P11C) data structure

AWS CDK Cheat Sheet

Documentation CDK Constructs Library TypeScript API Reference Best Practices Examples Some Gotchas When synthesizing an AWS CDK stack, I get the message –app is required either in command-line, in cdk.json or in ~/.cdk.json This message usually means that you …

AWS CDK Cheat Sheet Read More »

Downloading Files using Google Drive API

See: Google Cloud SDK (gcloud CLI) Create project in Enable Google Drive API in console Using gcloud cli: gcloud doesn’t provide command to access google drive. Install gdrive After entering verification code from browser: -q, –query <query> –order <sortOrder> OrderBy sets the optional parameter “orderBy”: A comma-separated list of sort keys. …

Downloading Files using Google Drive API Read More »

Google Cloud SDK (gcloud CLI)

Installation options Home Brew: Official: gcloud CLI gcloud init – initialize or reinitialize gcloud See: gcloud auth – manage credentials  gcloud auth login – authorize gcloud to access Google Cloud Platform with Google user credentials gcloud auth list – lists credentialed accounts gcloud auth activate-service-account – authorize access to Google Cloud Platform …

Google Cloud SDK (gcloud CLI) Read More »

About YAML

Based on: JSON JSON stands for “javascript object notation” records separated by commas keys & strings wrapped by double quotes good choice for data transport YAML YAML stands for “YAML ain’t markup language” and is a superset of JSON lists begin with a hyphen dependent on whitespace / indentation better suited for configuration than …

About YAML Read More »

AWS Cloud Development Kit (CDK) – Big Picture

Big Picture Infrastructure as code in TypeScript and Python etc. CDK includes Command line interface (CLI) tool Language bindings to CloudFormation resources Construct Library A Construct is a logical grouping of one or more resources Constructs are reusable cloud components Types of CDK Constructs CFN Resources or L1 Construct (or L1, short for “level 1”) or …

AWS Cloud Development Kit (CDK) – Big Picture Read More »

screen CheatSheet

~/.screenrc Example screen config file: .screenrc Start a new screen session Start a new screen session with session name List screen sessions Attach a screen session <name> can be the part of the session name (search term) if there is no conflict. If the search term match multiple session names, the attach will fail. Detach …

screen CheatSheet Read More »

AWS CLI CheatSheet

Install aws-cli on macOS Based on: Configure default profile AWS Access Key ID AWS Secret Access Key Default region name Default output format Configure a specific profile List default profile information List all profile names Get Access Key ID List all profiles credentials Changing default profile