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
# Mac下同时安装多个版本的JDK | |
Mac自带了的JDK6,安装在目录:`/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/`下。 | |
JDK7,JDK8则需要自己到Oracle官网下载安装对应的版本。自己安装的JDK默认路径为:`/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk` | |
### 1. 在用户目录下的bash配置文件.bashrc中配置JAVA_HOME的路径: | |
``` | |
export JAVA_6_HOME=/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home |
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
How can I make a Grafana template with a variable reference another variable using Prometheus as a datasource? | |
With InfluxDB backend you can write e.g.: | |
SHOW TAG VALUES WITH KEY = "cpu" WHERE service =~ /$service/ | |
where $service is another template variable. | |
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 dao | |
import ( | |
"gopkg.in/mgo.v2/bson" | |
"time" | |
"gopkg.in/mgo.v2" | |
"strings" | |
"log" | |
) |
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
git fetch origin branchname:branchname | |
可以把远程某各分支拉去到本地的branchname下,如果没有branchname,则会在本地新建branchname | |
git checkout origin/remoteName -b localName | |
获取远程分支remoteName 到本地新分支localName,并跳到localName分支 |
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
#!/usr/bin/env bash | |
# 免翻墙安装Go tools | |
branch="release-branch.go1.4" | |
mkdir -p $GOPATH/src/golang.org/x | |
git clone -b $branch git@github.com:golang/tools.git $GOPATH/src/golang.org/x/tools | |
git clone git@github.com:golang/net.git $GOPATH/src/golang.org/x/net | |
cd $GOPATH | |
go install golang.org/x/tools/cmd/goimports |
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
# 从这里下载scala | |
http://www.scala-lang.org/download/2.10.4.html | |
#解压到安装目录,这里我选择安装在/opt下 | |
sudo tar -zxvf scala-2.10.4.tgz | |
#配置环境变量 | |
sudo vim /etc/profile | |
#setting scala | |
export SCALA_HOME=/opt/scala-2.10.4 | |
export PATH=${SCALA_HOME}/bin:$PATH | |
source /etc/profile |
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
载kafka官网编译好的二进制文件 | |
wget http://apache.fayea.com/kafka/0.8.2.1/kafka_2.10-0.8.2.1.tgz | |
tar -xzvf kafka_2.10-0.8.2.1.tgz | |
cd kafka_2.10-0.8.2.1 | |
启动zookeeper | |
bin/zookeeper-server-start.sh config/zookeeper.properties | |
启动kafka server |
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
获取ZooKeeper安装包 | |
``` | |
下载地址:http://apache.dataguru.cn/zookeeper | |
选择一个稳定版本进行下载,我这里下载的是zookeeper-3.4.6版本。 | |
wget http://mirrors.sonic.net/apache/zookeeper/zookeeper-3.4.6/zookeeper-3.4.6.tar.gz | |
``` | |
ZooKeeper伪分布式集群安装 | |
伪分布式集群:在一台Server中,启动多个ZooKeeper的实例。 |
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
wget http://www.rarlab.com/rar/rarlinux-3.8.0.tar.gz | |
tar -zxvf rarlinux-3.8.0.tar.gz | |
cd rar | |
su root | |
make | |
make install | |
exit |
NewerOlder