Skip to content

Instantly share code, notes, and snippets.

version: '2'
services:
db-bootstrap:
image: dayreiner/centos7-mariadb-10.1-galera:latest
container_name: db1
restart: never
expose:
- "3306"
- "4567"
- "4568"
- What do Etcd, Consul, and Zookeeper do?
- Service Registration:
- Host, port number, and sometimes authentication credentials, protocols, versions
numbers, and/or environment details.
- Service Discovery:
- Ability for client application to query the central registry to learn of service location.
- Consistent and durable general-purpose K/V store across distributed system.
- Some solutions support this better than others.
- Based on Paxos or some derivative (i.e. Raft) algorithm to quickly converge to a consistent state.
- Centralized locking can be based on this K/V store.
@elvuel
elvuel / install-gradle-centos.sh
Created July 7, 2016 09:11 — forked from parzonka/install-gradle-centos.sh
Install gradle on redhat/centos linux
# installs to /opt/gradle
# existing versions are not overwritten/deleted
# seamless upgrades/downgrades
# $GRADLE_HOME points to latest *installed* (not released)
gradle_version=2.9
wget -N https://services.gradle.org/distributions/gradle-${gradle_version}-all.zip
sudo unzip -foq gradle-${gradle_version}-all.zip -d /opt/gradle
sudo ln -sfn gradle-${gradle_version} /opt/gradle/latest
sudo printf "export GRADLE_HOME=/opt/gradle/latest\nexport PATH=\$PATH:\$GRADLE_HOME/bin" > /etc/profile.d/gradle.sh
. /etc/profile.d/gradle.sh
@elvuel
elvuel / des.go
Created October 31, 2015 02:17 — forked from cuixin/des.go
des ecb mode in golang
package main
import (
"bytes"
"crypto/des"
"errors"
)
func PKCS5Padding(ciphertext []byte, blockSize int) []byte {
padding := blockSize - len(ciphertext)%blockSize
<div id="css3book">
<div class="book-host">
<div class="book">
<div class="dummy">
<div class="book-cover"></div>
<div class="dummy-page" id="dummy-page0"></div>
<div class="dummy-page" id="dummy-page1"></div>
<div class="dummy-page" id="dummy-page2"></div>
<div class="dummy-page" id="dummy-page3"></div>
<div class="dummy-page" id="dummy-page4"></div>
@elvuel
elvuel / bashpipe.go
Last active August 29, 2015 14:13 — forked from tyndyll/bashpipe.go
package main
import (
"bytes"
"io"
"log"
"os"
"os/exec"
)
@elvuel
elvuel / README.md
Last active August 29, 2015 14:11 — forked from AyushSachdev/README.md

Readme

A shell script to install VPN using SoftEther and Transmission CLI Torrent Client on Ubuntu 14.04 for use on Digital Ocean

Execution

  • Execution for installation and setup
sudo su
@elvuel
elvuel / redis-backup.sh
Last active December 14, 2016 11:32 — forked from acenqiu/redis-backup.sh
#!/bin/bash
#
## redis backup script
## usage
## redis-backup.sh port backup.dir
port=${1:-6379}
backup_dir=${2:-"/data/backup/redis"}
cli="/usr/local/bin/redis-cli -p $port"
@elvuel
elvuel / nettimeout
Created August 19, 2014 02:40 — forked from jbardin/nettimeout
package nettimeout
import (
"net"
"time"
)
// Listener wraps a net.Listener, and gives a place to store the timeout
// parameters. On Accept, it will wrap the net.Conn with our own Conn for us.
type Listener struct {
@elvuel
elvuel / map_reflection_bm.go
Created May 5, 2014 08:27
Benchmark reflect json(KIND:MAP)
package main
import (
"encoding/json"
"reflect"
"testing"
)
func BenchmarkMapReflection(b *testing.B) {
jsonStr := `{"uuid":"abcdefghijklmnopqrstuvwxyz0123456789","pm25":65.7,"temperature":34.6,"humidity":40,"pa":125,"timestamp":13900000000,"status":0}`