Skip to content

Instantly share code, notes, and snippets.

View borqosky's full-sized avatar
🏠
Working from home

Włodek Borkowski borqosky

🏠
Working from home
View GitHub Profile
@borqosky
borqosky / Install_Script.ps1
Created February 28, 2024 09:30 — forked from Dominicus1165/Install_Script.ps1
Winget install script for Windows
<#
# 0. Windows 10 only: update "App Installer" on Windows Store
#
# 1. Win+X => A
# 2. cd C:\Users\xxx\Desktop or C:\Users\xxx\OneDrive\Desktop if you have OneDrive
# 3. Set-ExecutionPolicy Unrestricted
# 4. .\Install_Script.ps1
#>
<#
@borqosky
borqosky / terminal-prompt-git-branch-zsh.md
Created January 6, 2024 15:29 — forked from reinvanoyen/terminal-prompt-git-branch-zsh.md
Add Git Branch Name to Terminal Prompt (MacOS Catalina zsh)

Add Git Branch Name to Terminal Prompt (MacOS Catalina zsh)

Updated for MacOS Big Sur | Monterey | Ventura

screenshot

Install

Open ~/.zshrc in your favorite editor and add the following content to the bottom.

function parse_git_branch() {
@borqosky
borqosky / k8s-networking-from-scratch-in-bash.md
Last active June 24, 2020 06:26
Kubernetes Networking: How to Write Your Own CNI Plug-in with Bash

1. A CNI plug-in is responsible for allocating network interfaces to the newly created containers.

Kubernetes first creates a container without a network interface and then calls a CNI plug-in. The plug-in configures container networking and returns information about allocated network interfaces, IP addresses, etc. The parameters that Kubernetes sends to a CNI plugin, as well as the structure of the response must satisfy the CNI specification, but the plug-in itself may do whatever it needs to do its job.

2. we are just creating two VMs (k8s-master and k8s-worker) from the Ubuntu v16.04 image.

The important parameter here is --can-ip-forward. This parameter configures IP forwarding on the network interface of a VM, allowing it to receive and forward network packets that have different destination IP address from its own IP address. This is a requirement, because each VM should accept packets with the destination IP set to a container IP rather then an IP of a virtual machine.

>Note that alterna

@borqosky
borqosky / macvlan-and-ipvlan.md
Last active July 10, 2023 10:30
Macvlan and IPvlan basics

Macvlan and IPvlan tutorial

Macvlan and ipvlan are Linux network drivers that exposes underlay or host interfaces directly to VMs or Containers running in the host.

VM and Container networking

There are two ways for Containers or VMs to communicate to each other. In Underlay network approach

  • In underlay network approach, VMs or Containers are directly exposed to host network - bridge, macvlan and ipvlan network drivers are examples of this approach
  • In overlay network approach, there is an additional level of encapsulation like VXLAN, NVGRE between the Container/VM network and the underlay network