Skip to content

Instantly share code, notes, and snippets.

View arsham's full-sized avatar

Arsham Shirvani arsham

View GitHub Profile
@arsham
arsham / kubernetes_dashboard.md
Last active February 18, 2019 17:11
Install and access #kubernetes #dashboard

Install

kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v1.10.1/src/deploy/recommended/kubernetes-dashboard.yaml

Access

kubectl proxy

Then browse to:

@arsham
arsham / clone_virtualbox_vms.sh
Created January 16, 2019 16:04
Clone a #virtualbox image and start headless
VBoxManage clonevm original_vm --name new_vm --register
# Change some properties
VBoxManage modifyvm new_vm --memory 6144 --vram 64
VBoxManage modifyvm new_vm --cpus 6
VBoxManage modifyvm new_vm --bridgeadapter1 enp0s3
# Start headless
VBoxManage startvm new_vm --type headless
@arsham
arsham / virtualbox_export_import.sh
Created January 16, 2019 16:02
Export and import VirtualBox VMs. #virtualbox
VBoxManage export machine_name -o /path/to/file/machine_name.ova
VBoxManage import machine_name.ova
@arsham
arsham / kubeadm_generate_token.sh
Created January 14, 2019 15:07
Generate a token and view the join command. #kubeadm #kubernetes
kubeadm token create --print-join-command
@arsham
arsham / docker_machine_generate.md
Last active January 11, 2019 14:34
Create a new vm and join the swarm (#docker)

About

We want to create a new vm and join the swarm.

Argument order

name, cpu count, memory, disk
@arsham
arsham / docker_max_map_count.sh
Created January 10, 2019 23:11
Change max_map_count on multiple #docker machines
for i in `seq 1 10`; do
docker-machine ssh vm$i 'echo "vm.max_map_count=300000" | sudo tee /etc/sysctl.conf ; sudo sysctl -p'
done
@arsham
arsham / docker_list_tasks.sh
Created January 10, 2019 23:06
List all tasks on #docker swarm
watch 'docker node ps $(docker node ls -q) | uniq'
@arsham
arsham / reload_docker_daemon.sh
Created January 10, 2019 17:18
Reload #docker daemon on #docker-machine
for i in `seq 1 10`;
do docker-machine ssh vm$i sudo /etc/init.d/docker restart
done
@arsham
arsham / internal_network_speed.sh
Created November 13, 2018 16:16
Measure the speed between two servers
pacman -S iperf3
# on one server
iperf3 -s
# on another
iperf3 -c <ip_of_server>
@arsham
arsham / mirror_website.sh
Created August 17, 2018 11:45
Mirror a website with #wget
wget --mirror --convert-links --adjust-extension --page-requisites --no-parent https://example.com