Skip to content

Instantly share code, notes, and snippets.

View percyvega's full-sized avatar

Percy Vega percyvega

View GitHub Profile

What is Kubernetes

* Kubernetes is an open-source container orchestrator
* K8s helps with:
	* Cluster Management of machines (perform health checks, bounce them, change cluster size)
	* Scheduling containers on those machines (match CPU/memory requirements with right machines).
* Defines API objects to describe your cluster’s desired state.
* Provides basic monitoring, logging, and health checking.
* Reconciles desired state and current state.

Concepts

Aperture

  • It's the opening in a lens through which light passes to enter the camera.
  • You can shrink or enlarge the size of the aperture to allow more or less light to reach your camera sensor.
  • It affects the depth of field.
  • It also affects the exposure of your images by making them brighter or darker.
  • e.g. aperture of f/1.4
    • wide/large aperture
  • a lot of light passing through the lens = bright image

MongoDB

Terms

Database -> Collections -> Documents -> Fields

Concepts

Sharding (Data Partition, Horizontal Partition):

Breaks up the data among multiple servers.

@percyvega
percyvega / DDD Cheatsheet.md
Last active September 8, 2022 22:29
DDD Cheatsheet

DDD

Message types:

  1. Command: an expression of intent to trigger an action in the domain.
    • Routing: routed to a single handler (via consistent hashing).
    • Outcome: provides confirmation/result (sync or async).
  2. Event: a notification (if subscribed) that something relevant has happened inside the domain.
    • Routing: distributed to all logical handlers (ordering required).
    • Outcome: no results from handling.
  3. Query: a request for information or state.
@percyvega
percyvega / RegEx Cheatsheet.md
Last active October 6, 2021 01:53
RegEx Cheatsheet

https://regex101.com/

Remove all Javadocs from a file /*(?s:(?!*/).)**/

    \/ matches the character / literally (case sensitive)
    \* matches the character * literally (case sensitive)
    Non-capturing Group. Matches the tokens contained with the following effective flags: s (?s:(?!\*\/).)*
        s modifier: single line. Dot matches newline characters
  • matches the previous token between zero and unlimited times, as many times as possible, giving back as needed (greedy)

Legend

  • Shift: ⇧
  • Control: ⌃
  • Alt/Option: ⌥
  • Command: ⌘
  • Enter/Return: ⏎
  • Right arrow: →
  • Left arrow: ←
  • Up arrow: ↑
  • Down arrow: ↓

Help

$ docker --help
$ docker image --help
$ docker image ls --help

Versions

See the Docker version

$ docker --version

List

List current directory's directories
	ls -ld *
List current directory's directories and their files:
	ls -l *
List current directory's contents recursively:
	ls -lR
List specified directory's contents:

ls dir123 -ltr

Vert.x is a toolkit to build reactive and distributed systems.

It's a server API for writing asynchronous networking applications (e.g. for db connectivity, monitoring, authentication, service discovery, clustering, etc.)

You can use Vert.x callback-based API exclusively, but Vert.x also implements an equivalent Rxified API using RxJava under the hood. This provides a great platform to integrate Vert.x modules within RxJava applications.

Vert.x provides fluent HTTP endpoints and route configuration backed by handlers where the business logic is implemented. But the real nervous system is the event bus that acts as a telecom provider to all Vert.x local or distributed components.

Its event-bus supports: