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
# https://www.binarytides.com/linux-ss-command/ | |
# https://www.computerhope.com/unix/nc.htm | |
# show only the listening sockets (To get the output faster, use the "n" option to prevent ss from resolving ip addresses to hostnames) | |
ss -ltpn | |
ss -ltn | |
# test the connetion (netcat) | |
# "r" means report not connect |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
VAGRANTFILE_API_VERSION = '2' | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.vm.box = 'centos6' | |
config.vm.box_url = 'http://developer.nrel.gov/downloads/vagrant-boxes/CentOS-6.4-x86_64-v20130731.box' | |
config.vm.boot_timeout = 60 |
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
kf_dir=~/sw/kafka_2.11-1.0.0 | |
echo "...starting zookeeper..." | |
gnome-terminal --title="zookeeper" --geometry 80x30+1+1 \ | |
-e "$kf_dir/bin/zookeeper-server-start.sh $kf_dir/config/zookeeper.properties" | |
echo "...waiting for 5 sec..." | |
sleep 5 | |
echo "...starting kafka broker 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
sudo netstat -tulpn | grep 9092 | |
tcp 0 0 0.0.0.0:9092 0.0.0.0:* LISTEN 4484/java | |
sudo cat /proc/4484/cmdline | |
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
aws s3api create-bucket --bucket e1-dev-local-dddd-bucket1 --region us-east-1 --endpoint-url http://localhost:7373 | |
aws s3api create-bucket --bucket e1-dev-local-dddd-bucket2 --region us-east-1 --endpoint-url http://localhost:7373 | |
aws s3api list-buckets --region us-east-1 --endpoint-url http://localhost:7373 |
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 junk | |
import com.amazonaws.{AmazonClientException, AmazonServiceException, ClientConfiguration} | |
import com.amazonaws.auth.{AWSStaticCredentialsProvider, BasicAWSCredentials} | |
import com.amazonaws.client.builder.AwsClientBuilder.EndpointConfiguration | |
import com.amazonaws.services.s3.{AmazonS3Client, AmazonS3ClientBuilder, S3ClientOptions} | |
import com.amazonaws.services.s3.model.Bucket | |
import scala.collection.JavaConversions._ | |
import com.amazonaws.services.s3.model.PutObjectRequest |
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
http://blogs.atlassian.com/2013/01/covariance-and-contravariance-in-scala/ | |
trait Function1[-T1, +R] { | |
def apply(t : T1) : R | |
... | |
} | |
This is single arg function in scala - T1 is basically input, R is output. | |
Any single arg function extends from this. And think through this rationally: | |
-T1 -> input needs to be less restrictive |
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
http://www.scala-lang.org/old/node/8194.html | |
http://stackoverflow.com/questions/4017357/difference-between-this-and-self-in-self-type-annotations | |
3 forms: | |
trait A {self: B =>..} | |
trait A {self =>..} | |
trait A {this: B =>..} | |
trait A {self: B =>..} is the most useful one. used primary for mixins. | |
'A' implements a small groups of very specific operations for very generic type. 'B' could be potentially implements another a small group. |
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
// Keywords | |
<- // Used on for-comprehensions, to separate pattern from generator | |
=> // Used for function types, function literals and import renaming | |
// Reserved | |
( ) // Delimit expressions and parameters | |
[ ] // Delimit type parameters | |
{ } // Delimit blocks | |
. // Method call and path separator | |
// /* */ // Comments |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
NewerOlder