Skip to content

Instantly share code, notes, and snippets.

View hysios's full-sized avatar
🎯
Focusing

hysios hysios

🎯
Focusing
View GitHub Profile
# main.go
- docker-compose.yaml
## bin
- server
## cmd
- root.go
- server.go
- setup.go
@hysios
hysios / aliyun-ubuntu.list
Created August 6, 2020 07:15
aliyun ubuntu 18.04 mirror apt source list
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
package main
import (
"errors"
"fmt"
"log"
"sync"
"time"
)
@hysios
hysios / Dockerfile
Last active September 25, 2018 07:18
sqlite3 compile at linux
FROM golang:1.11.0 as builder
RUN apt-get -y update && apt-get install -y sqlite3 libsqlite3-dev
COPY . /go/src/sqltest
WORKDIR /go/src/sqltest
RUN go build -o sqltest main.go
@hysios
hysios / yaml_parser.go
Last active September 20, 2018 12:36
YAML 做定制解析功能
package main
import (
"bytes"
"encoding/json"
"errors"
"fmt"
"log"
"os"
"reflect"
@hysios
hysios / saop.go
Created September 20, 2018 02:34
package main
import (
"encoding/xml"
"fmt"
)
type Envelop struct {
XMLName xml.Name
Body Body `xml:"Body"`
@hysios
hysios / fire.go
Last active September 11, 2018 08:09
package main
import (
"fmt"
)
// type number uint8
const (
zero int = 0x7E // 0b1111110 => 6
CLUSTER=ceph
ID=${1:-0}
NAME=${CLUSTER}-${ID}
MON_HOST=192.168.0.3
MON_PORT=6789
mkdir -p /var/lib/ceph/mds/${CLUSTER}-{ID}
ceph-authtool --create-keyring /var/lib/ceph/mds/$NAME/keyring --gen-key -n mds.${ID}
ceph auth add mds.${ID} osd "allow rwx" mds "allow" mon "allow profile mds" -i /var/lib/ceph/mds/$NAME/keyring
UUID=$(uuidgen)
OSD_SECRET=$(ceph-authtool --gen-print-key)
NAME=centos_$HOSTNAME
DEV=/dev/mapper/$NAME-data
ID=$(echo "{\"cephx_secret\": \"$OSD_SECRET\"}" | \
ceph osd new $UUID -i - \
-n client.admin -k /etc/ceph/ceph.client.admin.keyring)
mkdir /var/lib/ceph/osd/ceph-$ID
MEMBERS=192.168.0.4,192.168.0.5
HOST=192.168.0.3
CEPH_USER_ID=`id -u ceph`
MASTER=k8smaster
ID=`uuidgen`
NODE=${1:-0}
CLUSTER=ceph
NETWORK=192.168.0.0/24
osd journal size = 1024
osd pool default size = 3