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 / configure.sh
Last active May 7, 2024 14:06
Ubuntu 20.04 config for Kubernetes
#!/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
@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