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
#!/bin/bash | |
# Minimum TODOs on a per job basis: | |
# 1. define name, application jar path, main class, queue and log4j-yarn.properties path | |
# 2. remove properties not applicable to your Spark version (Spark 1.x vs. Spark 2.x) | |
# 3. tweak num_executors, executor_memory (+ overhead), and backpressure settings | |
# the two most important settings: | |
num_executors=6 | |
executor_memory=3g |
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
#!/bin/sh | |
BOOT2DOCKER_CERTS_DIR=/var/lib/boot2docker/certs | |
CERTS_DIR=/etc/ssl/certs | |
CAFILE=${CERTS_DIR}/ca-certificates.crt | |
for cert in $(/bin/ls -1 ${BOOT2DOCKER_CERTS_DIR}); do | |
SRC_CERT_FILE=${BOOT2DOCKER_CERTS_DIR}/${cert} | |
CERT_FILE=${CERTS_DIR}/${cert} | |
HASH_FILE=${CERTS_DIR}/$(/usr/local/bin/openssl x509 -noout -hash -in ${SRC_CERT_FILE} 2>/dev/null) |
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
def dotProduct(vector: Array[Int], matrix: Array[Array[Int]]): Array[Int] = { | |
// ignore dimensionality checks for simplicity of example | |
(0 to (matrix(0).size - 1)).toArray.map( colIdx => { | |
val colVec: Array[Int] = matrix.map( rowVec => rowVec(colIdx) ) | |
val elemWiseProd: Array[Int] = (vector zip colVec).map( entryTuple => entryTuple._1 * entryTuple._2 ) | |
elemWiseProd.sum | |
} ) | |
} | |
My goal was to set up Flume on my web instances, and write all events into s3, so I could easily use other tools like Amazon Elastic Map Reduce, and Amazon Red Shift.
I didn't want to have to deal with log rotation myself, so I setup Flume to read from a syslog UDP source. In this case, Flume NG acts as a syslog server, so as long as Flume is running, my web application can simply write to it in syslog format on the specified port. Most languages have plugins for this.
At the time of this writing, I've been able to get Flume NG up and running on 3 ec2 instances, and all writing to the same bucket.
Install Flume NG on instances
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 ( | |
"fmt" | |
"reflect" | |
) | |
type Foo struct { | |
FirstName string `tag_name:"tag 1"` | |
LastName string `tag_name:"tag 2"` |
- SVN : https://dev.naver.com/svn/naverapis/trunk/naver-java-client-samples/
- ID : anonsvn
- Password : anonsvn
- Maven 프로젝트
- Checkout후 mvn eclipse:eclipse로 이클립스 프로젝트 생성
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 me.whiteship.board.modules.servlet.async; | |
import javax.servlet.AsyncContext; | |
import javax.servlet.AsyncEvent; | |
import javax.servlet.AsyncListener; | |
import javax.servlet.ServletException; | |
import javax.servlet.annotation.WebServlet; | |
import javax.servlet.http.HttpServlet; | |
import javax.servlet.http.HttpServletRequest; | |
import javax.servlet.http.HttpServletResponse; |
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
#!/bin/sh | |
# | |
# Transforms a jar file into source and outputs source files to 'src'. | |
# Example: | |
# | |
# jar2java foo.jar ; --> source to 'src' | |
# | |
# After you can run javadoc on these files, e.g. | |
# | |
# javadoc -classpath foo.jar -d api `find src -name "*.java"` |