Skip to content

Instantly share code, notes, and snippets.

View ursuad's full-sized avatar

Adrian Ursu ursuad

  • Advance Leap Ltd
  • London, United Kindom
View GitHub Profile

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@ursuad
ursuad / iterm2.md
Created April 30, 2016 10:46
iterm2 cheatsheet

Tabs and Windows

Function Shortcut
Previous Tab + Left Arrow
Next Tab + Right Arrow
Go to Tab + Number
Go to Window + Option + Number
Go to Split Pane by Direction + Option + Arrow
Go to Split Pane by Order of Use + ] , + [
@ursuad
ursuad / exercise.tour.go
Created May 24, 2016 12:45 — forked from zyxar/exercise.tour.go
tour.golang exercise solutions
/* Exercise: Loops and Functions #43 */
package main
import (
"fmt"
"math"
)
func Sqrt(x float64) float64 {
z := float64(2.)
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: federation-controller-manager
namespace: federation
labels:
app: federated-cluster
spec:
template:
metadata:
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: federation-apiserver
namespace: federation
labels:
app: federated-cluster
spec:
template:
metadata:
@ursuad
ursuad / README.md
Created October 12, 2016 13:38 — forked from adambom/README.md
Backup Kubernetes Cluster State

Run this in order to backup all you k8s cluster data. It will be saved in a folder bkp. To restore the cluster, you can run kubectl apply -f bkp.

Please note: this recovers all resources correctly, including dynamically generated PV's. However, it will not recover ELB endpoints. You will need to update any DNS entries manually, and manually remove the old ELB's.

Please note: This has not been tested with all resource types. Supported resource types include:

  • services
  • replicationcontrollers
  • secrets
  • deployments
  • horizontal pod autoscalers
@ursuad
ursuad / gist:81238fd33bd6a6135f25c76abdc6160f
Created December 20, 2016 14:05 — forked from mbn18/gist:0d6ff5cb217c36419661
How to install nsenter on Ubuntu 14.04
# Ubuntu 14.04 don't have nsenter - the straight forward way required me to install build tools and etc.
# I preferred to keep the system clean and install nsenter in a container and then copy the command to the host
# Note - its also possible to run nsenter from a container (didn't tried) https://github.com/jpetazzo/nsenter
# start a container
docker run --name nsenter -it ubuntu:14.04 bash
## in the docker
apt-get update
apt-get install git build-essential libncurses5-dev libslang2-dev gettext zlib1g-dev libselinux1-dev debhelper lsb-release pkg-config po-debconf autoconf automake autopoint libtool

Keybase proof

I hereby claim:

  • I am ursuad on github.
  • I am ursuad (https://keybase.io/ursuad) on keybase.
  • I have a public key ASA0k9R6djMVQSjquz69dEZEiAGa44zliIFXotpuntTVdwo

To claim this, I am signing this object:

@ursuad
ursuad / masq.sh
Created October 31, 2017 16:29 — forked from mowings/masq.sh
script to get xet xhyve working with all vpn interfaces
#!/bin/bash
interfaces=( $(netstat -in | egrep 'utun\d .*\d+\.\d+\.\d+\.\d+' | cut -d ' ' -f 1) )
rulefile="rules.tmp"
echo "" > $rulefile
sudo pfctl -a com.apple/tun -F nat
for i in "${interfaces[@]}"
do
RULE="nat on ${i} proto {tcp, udp, icmp} from 192.168.64.0/24 to any -> ${i}"
echo $RULE >> $rulefile
done
@ursuad
ursuad / gist:bc1dbcab86b9544c5453df6400ba9c81
Created March 14, 2018 13:38 — forked from anikitenko/gist:b41206a49727b83a530142c76b1cb82d
[Golang] Convert size in bytes to Bytes, Kilobytes, Megabytes, GB and TB
package main
import (
"fmt"
"math"
"strconv"
)
var (
sizeInMB float64 = 999 // This is in megabytes