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-console-consumer.sh --topic gps-data-export --zookeeper 10.64.249.175:2181/kafka --consumer.config tmp.conf >data.log & | |
// tmp.conf: group.id=gps2orcl-qa |
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
Couchbase DCP will compact several changes of the same document into one DCP event; | |
DCP will serialize the offset (vis state serializer) immediately when it determines the current offset. | |
That means, if you started the DCP, the state that's been serialized is the latest offset; not the offset that has been streamed. | |
In other words, DO NOT stop the streaming if the data has not been fully streamed. |
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 --detach -p 8091:8091 -p 8092:8092 -p 8093:8093 -p 11207:11207 -p 11210:11210 -p 11211:11211 -p 18091:18091 -p 18092:18092 couchbase:3.0.3 | |
docker run --net=host couchbase:3.0.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
sudo apt-get update; | |
sudo apt-get install apt-transport-https ca-certificates apparmor | |
sudo apt-get install linux-image-extra-$(uname -r) | |
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D | |
echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" | sudo tee /etc/apt/sources.list.d/docker.list | |
sudo apt-get update | |
sudo apt-get install -y docker-engine | |
sudo usermod -a -G docker `whoami` | |
sudo service docker start |
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
# this script prints the preferred apache mirror and path_info to download components; | |
import urllib | |
import json | |
url="https://www.apache.org/dyn/closer.cgi?as_json=1" | |
#url='https://www.apache.org/dyn/closer.cgi/maven/maven-3/3.0.5/binaries/apache-maven-3.0.5-bin.tar.gz?as_json=1' | |
result=json.load(urllib.urlopen(url)) | |
print result['preferred'] | |
print result['path_info'] |
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
public static class MyInt { | |
public MyInt(int i) { | |
data = i; | |
} | |
int data; | |
} | |
public static long getFirstIndex(String str, InputStream is) | |
throws IOException { | |
byte[] bstr = str.getBytes(); |
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
public Class RevertLinkedList{ | |
public static class LinkedNode{ | |
int data; | |
LinkedNode next; | |
} | |
public LinkedNode revert(LinkedNode head){ | |
LinkedNode result = null; | |
while(head!=null){ | |
LinkedNode tmp=head.next; |