This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Uncomment the next line to define a global platform for your project | |
#platform :ios, '11.0' | |
target 'Family' do | |
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks | |
use_frameworks! | |
# Pods for Family | |
pod 'Alamofire', '~> 4.5' | |
pod 'SwiftyJSON', '~> 4.0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"time" | |
"github.com/sirupsen/logrus" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package binarysearch | |
import ( | |
"errors" | |
) | |
func BinarySearch(a []int, target int) (int, error) { | |
startPos := 0 | |
endPos := len(a) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package cache | |
type Cache interface { | |
Get(key string) interface{} | |
Set(key string, value interface{}) | |
} | |
type CacheNode struct { | |
Key string | |
Value interface{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For each machine | |
ETCD_VERSION=v3.2.5 | |
TOKEN=taipei101-etcd-token | |
CLUSTER_STATE=new | |
NAME_1=core-1 | |
NAME_2=core-2 | |
NAME_3=core-3 | |
HOST_1=10.0.1.1 | |
HOST_2=10.0.1.2 | |
HOST_3=10.0.1.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker service create \ | |
--network traefik-net \ | |
--name gogs \ | |
--mount src=gogs,dst=/data \ | |
--constraint node.hostname=="hostname-1" \ | |
--label traefik.port=3000 \ | |
--label traefik.frontend.rule=Host:git.xxx.com \ | |
gogs/gogs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
./cockroach start --background --certs-dir=certs --advertise-host=10.140.1.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker run -d --restart always --net host --name consul \ | |
consul agent -server -bootstrap-expect=3 -retry-join=10.140.1.2 -retry-join=10.140.1.3 -bind=10.140.1.1 -ui -client=10.140.1.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get update | |
sudo apt-get install -y \ | |
apt-transport-https \ | |
ca-certificates \ | |
curl \ | |
software-properties-common | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# set the default region for the AWS CLI | |
export AWS_DEFAULT_REGION=$(curl --retry 5 --silent --connect-timeout 2 http://169.254.169.254/latest/dynamic/instance-identity/document | grep region | awk -F\" '{print $4}') | |
export JAVA_HOME=/etc/alternatives/jre | |
export HADOOP_CONF_DIR=/etc/hadoop/conf | |
export SPARK_HOME=/usr/lib/spark | |
export SPARK_WORKER_DIR=/var/run/spark/work | |
export EXTRA_CLASSPATH=/usr/lib/hadoop-lzo/lib/hadoop-lzo.jar:/etc/hive/conf | |
export SPARK_LOCAL_IP=$(ec2-metadata -o | cut -d ' ' -f2) | |
export SPARK_LOCAL_HOSTNAME=$(ec2-metadata -h | cut -d ' ' -f2) |
NewerOlder