Skip to content

Instantly share code, notes, and snippets.

View itsvinayak's full-sized avatar
🎯
Focusing

vinayak itsvinayak

🎯
Focusing
View GitHub Profile

Kubernetes

Kubernetes Architecture Overview

                   +--------------------+
                   |   Control Plane    |
                   |   (Master Node)    |
                   +--------------------+
@itsvinayak
itsvinayak / WebSocketServer.js
Created August 21, 2024 19:05
WebSocketServer for push push notifications examples
const port = 3000;
const ws = require("ws");
const server = require("http").createServer();
const connection = [];
const wss = new ws.WebSocketServer({ server });
server.listen(port, () => {
console.log(`Server started on port ${server.address().port}`);
});

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

[
{
"id": "5a6ce86e2af929789500e7e4",
"author": "Edsger W. Dijkstra",
"en": "Computer Science is no more about computers than astronomy is about telescopes."
},
{
"id": "5a6ce86e2af929789500e7d7",
"author": "Edsger W. Dijkstra",
"en": "Simplicity is prerequisite for reliability."
@itsvinayak
itsvinayak / scripts.md
Created November 8, 2023 18:39
Sharing a Powerful Bash Script for Streamlined Productivity 🚀

Open Git Repository:

git remote get-url origin | xargs open

Kill Process by Port:

# lsof -i tcp:8080 | awk 'FNR == 2{print $2}' | xargs kill -9
@itsvinayak
itsvinayak / setup_kubernetes_aliases.sh
Created November 1, 2023 17:13
🚀 Elevate your Kubernetes game with our powerful Bash script! Introducing a seamless solution designed for efficiency and productivity. Say goodbye to manual alias setup – our script automates the process, configuring essential Kubernetes aliases in your .bashrc file effortlessly. Supercharge your workflow and boost productivity with just a few …
#!/bin/bash
# Function to add or update an alias in .bashrc
add_alias_to_bashrc() {
local alias_name="$1"
local alias_command="$2"
# Check if the alias already exists in .bashrc
if grep -q "^alias $alias_name=" ~/.bashrc; then
# Update the existing alias
@itsvinayak
itsvinayak / tmux-cheatsheet.markdown
Created June 12, 2023 15:27 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
eval "$(starship init zsh)"
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
sudo apt-get update -y
sudo apt-get install ca-certificates curl gnupg lsb-release -y
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
sudo echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update -y
sudo apt-get install \
ca-certificates \
curl \

FEATURE EXPECTATIONS [5 min]

    (1) Use cases
    (2) Scenarios that will not be covered
    (3) Who will use
    (4) How many will use
    (5) Usage patterns

ESTIMATIONS [5 min]

    (1) Throughput (QPS for read and write queries)
    (2) Latency expected from the system (for read and write queries)

(3) Read/Write ratio