Ruby

../../../_images/rben.png

catch throw

def run
x = rand(10000)
  if x == 86
    puts Time.now
    throw :end
  end
end

catch(:end) do
  10000.times { run }
end

Read more...

MLAG & vPC

MLAG/CLAG & vPC

Read more...

VIM SETUP

CMAP

cmap W w !sudo tee % >/dev/null<CR>

Read more...

PTM - Prescriptive Topology Manager

Cumulus Linux - PTMD ensure actual virtual/physical links connected to the right place. A script execute at /etc/ptm.d/if-topo-pass / if-topo-failfor if each interface that encounters a flip. It uses LLDP reading and advertising interface metadata like show cdp neighbor To enable the service globally by sudo vtysh -c 'conf t' -c 'ptm-enable', show ptm status sudo vtysh -c 'show interface swp1'. Modify these dot file as needed /etc/ptmd./topologoy.dot and reload sudo systemctl force-reload ptmd.service .

Read more...

Kubernetes - NameServer Limits exceeded error

I got this error description: Using kubeadm to init kubernetes 1.15.1 falied:node “xxx” not found After reboot the Ubuntu 18.04 server , checking journalctl -b , kubectl get events and journctl -u kubelet -n10 -r

Read more...

CWM WM - openBSD

../../../_images/cwmrc.png

cwm - a lightweight and efficient window manager for X11

openBSD CWMRC guide- cwm maintains the simplest and most pleasant aesthetic. cwm is a window manager for X11 which contains many features that concen‐trate on the efficiency and transparency of window management, while maintaining the simplest and most pleasant aesthetic.

Read more...

SPACEMACS cheatsheet

Sphinx config value author already present

ERROR Building Sphinx

Running Sphinx v3.0.3

Extension error: Config value ‘author’ already present

https://media.giphy.com/media/uZ7ujnSoXlt28/giphy.gif

Read more...

Vagrant Box - LIBVIRT QEMU

../../../_images/ball1.gif

_ Let’s say I want to try openbsd , you don’t really to spend hours or day finding spare hardware and try it. Go to AWS, they may not be offering this os. Maybe you want build from scratch your live os and upload to AWS ami.

To intall the libvirt plugin vagrant plugin install vagrant-libvirt and initialze BSD box to run vagrant init -m  generic/openbsd6.

vagrant up –provider=libvirt

Finding other boxes - VAGRANT BOXES SEARCH LINK it automatically download from the repo.

bsd

Read more...

Simple Local HTTP Server With Ruby, python, nodejs

https://media.giphy.com/media/mCRJDo24UvJMA/giphy.gif

Yes, a simple HTTP server can do with Python, nodejs. And you can do it with Ruby too. Most program language offer a local HTTP server. Let’s say Sometimes you want to share document in your local network, or developing a static web page. This is simple way to run a local web service without installing software, such as with node, python or ruby.

Read more...