Skip to content

Instantly share code, notes, and snippets.

# SYNOPSIS
# manopt command opt
#
# DESCRIPTION
# Returns the portion of COMMAND's man page describing option OPT.
# Note: Result is plain text - formatting is lost.
#
# OPT may be a short option (e.g., -F) or long option (e.g., --fixed-strings);
# specifying the preceding '-' or '--' is OPTIONAL - UNLESS with long option
# names preceded only by *1* '-', such as the actions for the `find` command.
@giper45
giper45 / create-swarm.sh
Created September 17, 2020 13:17
swarm env with docker-machine
docker-machine create manager
docker-machine create agent-1
docker-machine create agent-2
MANAGER_IP=`docker-machine ip manager`
JOIN_CMD=`docker-machine ssh manager docker swarm init --advertise-addr ${MANAGER_IP} | grep "\-\-token"`
docker-machine ssh agent-1 ${JOIN_CMD}
docker-machine ssh agent-2 ${JOIN_CMD}
@giper45
giper45 / netshoot
Created July 9, 2020 08:34
Docker Aliases
function netshoot() { if [ -z $1 ]; then docker ps ; else docker run -it --rm --name netshoot --net container:${1} nicolaka/netshoot ;fi }
@giper45
giper45 / daemon.json
Created July 7, 2020 15:56
Full docker daemon configuration example
{
"authorization-plugins": [],
"data-root": "",
"dns": [],
"dns-opts": [],
"dns-search": [],
"exec-opts": [],
"exec-root": "",
"experimental": false,
"features": {},
@giper45
giper45 / async_for_each.js
Created January 10, 2020 14:11
Async for each nodejs
async function asyncForEach(array, callback) {
for (let index = 0; index < array.length; index++) {
await callback(array[index], index, array);
}
}
# -*- mode: ruby -*-
# vi: set ft=ruby :
if !Vagrant.has_plugin?("vagrant-docker-compose")
puts "Pls install vagrant-docker-compose (vagrant plugin install vagrant-docker-compose), then try 'vagrant up' again"
system("vagrant plugin install vagrant-docker-compose")
exit
end
if !Vagrant.has_plugin?("vagrant-disksize")
puts "Pls install vagrant-disksize (vagrant plugin install vagrant-disksize), then try 'vagrant up' again"
sudo apt-get update
sudo apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io
sudo usermod -aG docker $USER
@giper45
giper45 / Vagrantfile
Created April 17, 2019 18:03 — forked from drgarcia1986/Vagrantfile
Hello World with Ansible and Vagrant
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.network "forwarded_port", guest: 8000, host: 8000
config.vm.provision :ansible do |ansible|
@giper45
giper45 / common_usernames
Created April 5, 2019 13:03
Common usernames
111111
123456
12345678
abc123
abramov
account
accounting
ad
adm
admin
# SYNOPSIS
# manopt command opt
#
# DESCRIPTION
# Returns the portion of COMMAND's man page describing option OPT.
# Note: Result is plain text - formatting is lost.
#
# OPT may be a short option (e.g., -F) or long option (e.g., --fixed-strings);
# specifying the preceding '-' or '--' is OPTIONAL - UNLESS with long option
# names preceded only by *1* '-', such as the actions for the `find` command.