Skip to content

Instantly share code, notes, and snippets.

View m99coder's full-sized avatar
👨‍🚀
Where no human has gone before

Marco Lehmann m99coder

👨‍🚀
Where no human has gone before
View GitHub Profile
@m99coder
m99coder / alacritty.yaml
Last active March 27, 2023 19:16
Alacritty + tmux
# 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
@m99coder
m99coder / README.md
Last active September 9, 2022 20:37
Docker Swarm

Docker Swarm

Initialization

# on leader node
docker swarm init
docker node ls

# on worker nodes
@m99coder
m99coder / README.md
Last active September 9, 2022 14:30
Docker Stats

Docker Monitoring

Docker Stats

docker stats
docker stats \
  --format "table {{ .Name }} {{ .ID }} {{ .MemUsage }} {{ .CPUPerc }}"
@m99coder
m99coder / README.md
Created September 7, 2022 06:57
Install Docker Community Edition on CentOS

Install Docker Community Edition on CentOS

Based on Install Docker Engine on CentOS

$ # uninstall old versions
$ sudo yum remove docker \
                  docker-client \
                  docker-client-latest \
                  docker-common \
@m99coder
m99coder / README.md
Last active September 3, 2022 11:05
Run EC2 instance with SSH access and install Docker with Docker Compose as CLI plugin

Run EC2 instance and install Docker

AWS EC2

How to install CLI

brew install awscli
@m99coder
m99coder / web_crawler.go
Created March 10, 2021 12:44
Mutual exclusion with mutex
package main
import (
"fmt"
"sync"
)
type Fetcher interface {
// Fetch returns the body of URL and
// a slice of URLs found on that page.
@m99coder
m99coder / equivalent_trees.go
Last active March 10, 2021 12:32
Concurrency and channels to walk binary trees
package main
import (
"fmt"
"golang.org/x/tour/tree"
)
func Walk(t *tree.Tree, ch chan int) {
defer close(ch)
// using a closure
@m99coder
m99coder / images.go
Created March 10, 2021 11:24
Image interface
package main
import (
"golang.org/x/tour/pic"
"image"
"image/color"
)
type Image struct {
w, h int
@m99coder
m99coder / rot13reader.go
Created March 10, 2021 11:13
Transform Reader: Rot13
package main
import (
"io"
"os"
"strings"
)
type rot13Reader struct {
r io.Reader
@m99coder
m99coder / readers.go
Created March 10, 2021 11:06
Reader with infinite stream of ASCII character 'A'
package main
import "golang.org/x/tour/reader"
type MyReader struct{}
func (r MyReader) Read(b []byte) (int, error) {
for i := range b {
b[i] = 65
}