Skip to content

Instantly share code, notes, and snippets.

@amshinde
amshinde / docker-with-proxy.md
Last active April 4, 2019 01:09
Docker with proxy

Getting docker to work with corporate proxy

Docker's conf file /etc/docker/daemon.json :

{  
   "dns":[  
      "10.248.2.1",
      "10.22.224.196"
   ],
 "dns-search":[ 
@amshinde
amshinde / K8s-Raw-Block-Kata.md
Last active December 29, 2020 03:55
K8s Raw Block storage support with Kata
sudo -E qemu-lite-system-x86_64 -machine pc,accel=kvm,kernel_irqchip -cpu host -m 2G,slots=3,maxmem=16G -object memory-backend-file,id=mem,size=2G,mem-path=/dev/shm,share=on -numa node,memdev=mem -device virtio-serial-pci,id=serial0 -device virtio-blk-pci,drive=image -drive if=none,id=image,file=kata-containers.img,format=raw -kernel vmlinuz.container -append 'console=ttyS0 console=hvc0 iommu=false root=/dev/vda1 rw rootfstype=ext4 data=ordered rcupdate.rcu_expedited=1 tsc=reliable no_timer_check loglevel=7 apic=verbose noapic noapictimer virtio_mmio.device=0x200@0x540000000:14' -smp 2,maxcpus=4 -device virtconsole,chardev=charconsole0,id=console0 -chardev stdio,id=charconsole0 -monitor telnet:127.0.0.1:55555,server,nowait -device isa-debugcon,iobase=0x402,chardev=debugcon -chardev file,path=/tmp/debug-log,id=debugcon -device isa-debugcon,iobase=0x3f8,chardev=serialcon -chardev file,path=/tmp/serial-log,id=serialcon
[sudo] password for amshinde:
[ 0.223920] brd: module loaded
[ 0.226454]
@amshinde
amshinde / install-go.md
Last active June 11, 2024 21:22
Install golang on Linux
curl -O https://storage.googleapis.com/golang/go1.22.4.linux-amd64.tar.gz
sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.22.4.linux-amd64.tar.gz
sudo ln -sf /usr/local/go/bin/go /usr/bin/go

vim ~/.bashrc
export GOPATH=$HOME/go
export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin

vim /etc/profile
#side by side terminal diff
git difftool -y -x "sdiff -w $COLUMNS" | less
@amshinde
amshinde / mlgre.md
Created November 12, 2018 19:36 — forked from mcastelino/mlgre.md
Setting up a overlay network using point to multi-point GRE tunnels

Setting up a overlay network using point to multi-point GRE tunnels

Multi-Point GRE Tunnels

Typically VxLAN is used to setup a point to multi-point overlay networks. However GRE also offers a similar capability which is often not heavily used. This document calls out how to setup an effient overlay mesh network to link up multiples sits together using multi point GRE tunnels.

Setup

The setup used in this case assumes there is a need to link three sites hosting three different subnets together using a simple overlay mesh network.

@amshinde
amshinde / iptables-cheatsheet.md
Created November 9, 2018 22:43 — forked from mcastelino/iptables-cheatsheet.md
iptables-cheatsheet

The netfilter hooks in the kernel and where they hook in the packet flow

The figure below calls out

  • The netfilter hooks
  • The order of table traversal

Failed to add inotify watch : no space left on disk

This is due to the inotify watch limit being hit. cat /proc/sys/fs/inotify/max_user_watches

sudo sysctl fs.inotify.max_user_watches=524288

or edit

@amshinde
amshinde / VFIO_nested.md
Created October 29, 2018 17:13 — forked from mcastelino/VFIO_nested.md
QEMU VFIO in Nested VM vIOMMU

How to use VFIO to assign a device to nested VM

  • Here the vfio-pci device is passed in into the L1 VM
  • The L1 VM is setup with kernel_irqchip=split
  • The L0 exposes a virtual IOMMU to the L1 VM
qemu-system-x86_64 \
    -machine q35,accel=kvm,kernel_irqchip=split \
    -enable-kvm \