Skip to content

Instantly share code, notes, and snippets.

View prologic's full-sized avatar
👋
Principal SRE, Founder of Yarn.social and Salty.im

James Mills prologic

👋
Principal SRE, Founder of Yarn.social and Salty.im
View GitHub Profile
@erkin-personal
erkin-personal / create-cluster.sh
Created December 9, 2023 19:56 — forked from vitorreus/create-cluster.sh
High Availability Redis cluster using Sentinel deployed in Docker Swarm
#!/bin/bash
#This script creates 1 master, 2 slaves and 3 sentinels services in docker swarm.
docker network create \
--driver overlay \
testes_network
SWARM_MASTER=192.168.205.125
#Master
@prologic
prologic / main.go
Created April 1, 2022 14:46
Test program to test Go'a netdns=cgo resolver on macOS
package main
import (
"fmt"
"log"
"net"
)
func main() {
cnames, addrs, err := net.LookupSRV("_salty", "_tcp", "home.arpa")
@prologic
prologic / consul.yml
Created October 11, 2021 07:21
Consul Stack (Docker Swarm)
---
version: "3.8"
services:
seed:
image: consul:latest
environment:
- "CONSUL_LOCAL_CONFIG={\"disable_update_check\": true}"
- "CONSUL_BIND_INTERFACE=eth0"
entrypoint:
@prologic
prologic / weed.yml
Created May 25, 2021 03:07
SeaweedFS Docker Swarm Stack
---
version: "3.8"
services:
master:
image: chrislusf/seaweedfs:latest
command: master -mdir=/data
networks:
- weed
@prologic
prologic / go.mod
Created January 11, 2021 23:07
Twtxt Search Engine Crawler proof-of-concept
module twtxt-search-engine
go 1.14
require (
github.com/gocolly/colly/v2 v2.1.0
github.com/jointwt/twtxt v0.0.0-20210108082814-7098fcfa49df
github.com/prologic/read-file-last-line v0.0.0-20200806014221-326f63458987
github.com/sirupsen/logrus v1.7.0
)
@prologic
prologic / LearnGoIn5mins.md
Last active December 3, 2024 19:40
Learn Go in ~5mins
# First try, we get edb8f4a65586 as our hash
$ cat << EOF | docker build --no-cache -
> FROM alpine
> RUN touch foo
> EOF
Sending build context to Docker daemon 2.048kB
Step 1/2 : FROM alpine
---> a24bb4013296
Step 2/2 : RUN touch foo
---> Running in 9687f21f4edb
@prologic
prologic / post.go
Created December 18, 2019 12:56
A quick 'n dirty MIcroPub Go (Golang) client for Micro.blog (https://micro.blog)
package main
import (
"flag"
"fmt"
"io/ioutil"
"log"
"net/http"
"net/url"
"os"
package main
import (
"fmt"
"log"
"os"
"runtime"
"runtime/pprof"
"strings"
@zicklag
zicklag / swarm-stack.yml
Last active May 25, 2021 00:31
SeaweedFS Swarm Stack
version: '3.5'
# WARNING: Haven't tested this version of this YAML exactly, but it *should* be correct.
services:
master-1:
image: chrislusf/seaweedfs:latest
networks:
- hostnet
command: "master -port=9333 -defaultReplication=001 -peers=localhost:9333,localhost:9334,localhost:9335"