Skip to content

Instantly share code, notes, and snippets.

View junxie6's full-sized avatar
🐢
Push the limits of what's possible. Today.

Jun Hsieh junxie6

🐢
Push the limits of what's possible. Today.
View GitHub Profile
@junxie6
junxie6 / index.md
Created March 19, 2019 05:19 — forked from bojand/index.md
gRPC and Load Balancing

Just documenting docs, articles, and discussion related to gRPC and load balancing.

https://github.com/grpc/grpc/blob/master/doc/load-balancing.md

Seems gRPC prefers thin client-side load balancing where a client gets a list of connected clients and a load balancing policy from a "load balancer" and then performs client-side load balancing based on the information. However, this could be useful for traditional load banaling approaches in clound deployments.

https://groups.google.com/forum/#!topic/grpc-io/8s7UHY_Q1po

gRPC "works" in AWS. That is, you can run gRPC services on EC2 nodes and have them connect to other nodes, and everything is fine. If you are using AWS for easy access to hardware then all is fine. What doesn't work is ELB (aka CLB), and ALBs. Neither of these support HTTP/2 (h2c) in a way that gRPC needs.

@junxie6
junxie6 / call_method_with_reflection.go
Created December 10, 2018 14:20 — forked from tkrajina/call_method_with_reflection.go
Golang, call method (and fill arguments) with reflection
package main
import (
"fmt"
"reflect"
)
type Aaa struct {
a string
}
@junxie6
junxie6 / .gitignore
Created December 8, 2018 03:43 — forked from miku/.gitignore
Golang XML worker queue example
xmlp
@junxie6
junxie6 / graceful.go
Created November 8, 2018 04:42 — forked from peterhellberg/graceful.go
*http.Server in Go 1.8 supports graceful shutdown. This is a small example.
package main
import (
"context"
"log"
"net/http"
"os"
"os/signal"
"time"
)
@junxie6
junxie6 / clean-up-boot-partition-ubuntu.md
Created October 17, 2018 05:22 — forked from ipbastola/clean-up-boot-partition-ubuntu.md
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
@junxie6
junxie6 / buildMySQLFromSourceCode.txt
Created September 16, 2018 16:25
Building MySQL from Source Code
# apt-get update && apt-get install build-essential cmake bison -y
# cd /usr/local/src \
&& git clone https://github.com/mysql/mysql-server.git --depth 1 \
&& mkdir bld \
&& cd bld \
&& cmake ../mysql-server \
-DDOWNLOAD_BOOST=1 \
-DWITH_BOOST=/usr/local/src/bld \
&& make
@junxie6
junxie6 / mysql_replication_autostart.sh
Created September 15, 2018 16:42 — forked from thomasvs/mysql_replication_autostart.sh
This script automates the process of starting a Mysql Replication on 1 master node and N slave nodes. More details on how it works at http://blog.ditullio.fr/2016/04/30/initialize-mysql-master-slave-replication-script/
#!/bin/bash
#title : replication-start.sh
#description : This script automates the process of starting a Mysql Replication on 1 master node and N slave nodes.
#author : Nicolas Di Tullio
#date : 20160706
#version : 0.2
#usage : bash mysql_replication_autostart.sh
#bash_version : 4.3.11(1)-release
#=============================================================================
#!/bin/bash
mysqlbinlog56=/store/mysql-5.6.23-linux-glibc2.5-x86_64/bin/mysqlbinlog
mysqlclient=/store/mysql-5.6.23-linux-glibc2.5-x86_64/bin/mysql
pidfile=/var/run/binlogstream.pid
binlogdir=/store/binlogstreamer/binlogs
binlogprefix=mysql-bin
mysqluser=tester
mysqlpass=tester
mysqlmaster=10.72.100.236
@junxie6
junxie6 / Makefile
Created February 18, 2018 18:46 — forked from eliasson/Makefile
Example Makefile for small projects in golang
PACKAGES := \
github.com/eliasson/foo \
github.com/eliasson/bar
DEPENDENCIES := github.com/eliasson/acme
all: build silent-test
build:
go build -o bin/foo main.go
@junxie6
junxie6 / translate.go
Created January 29, 2018 07:37 — forked from hvoecking/translate.go
Golang reflection: traversing arbitrary structures
// Traverses an arbitrary struct and translates all stings it encounters
//
// I haven't seen an example for reflection traversing an arbitrary struct, so
// I want to share this with you. If you encounter any bugs or want to see
// another example please comment.
//
// The MIT License (MIT)
//
// Copyright (c) 2014 Heye Vöcking
//