# on leader node
docker swarm init
docker node ls
# on worker nodes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# run it like that: | |
# bash <(curl -sL https://gist.github.com/m99coder/d39540caaa04b8aaac5ef1e041dec99b/raw/configure.sh) | |
# bash <(curl -sL http://tiny.cc/configure) | |
# colorize prompt | |
export PS1="\[\e[0;32m\][\u@\h \W]$\[\e[m\] " | |
# change locale to English |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Configuration for Alacritty, the GPU enhanced terminal emulator. | |
# Full config: https://github.com/alacritty/alacritty/blob/master/alacritty.yml | |
env: | |
TERM: xterm-256color | |
window: | |
padding: | |
x: 8 | |
y: 8 |
Based on Install Docker Engine on CentOS
$ # uninstall old versions
$ sudo yum remove docker \
docker-client \
docker-client-latest \
docker-common \
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"sync" | |
) | |
type Fetcher interface { | |
// Fetch returns the body of URL and | |
// a slice of URLs found on that page. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"golang.org/x/tour/tree" | |
) | |
func Walk(t *tree.Tree, ch chan int) { | |
defer close(ch) | |
// using a closure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"golang.org/x/tour/pic" | |
"image" | |
"image/color" | |
) | |
type Image struct { | |
w, h int |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"io" | |
"os" | |
"strings" | |
) | |
type rot13Reader struct { | |
r io.Reader |
NewerOlder