Skip to content

Instantly share code, notes, and snippets.

@sh1nj1
sh1nj1 / gist:90f10c2c2828830f5bab
Created June 18, 2014 09:39
Gradle configuration strips off JPA Annotations
task serverJar(type: Jar) {
classifier = 'server'
from sourceSets.main.output
}
task removeAnnotation << {
ant.echo("strip annotation")
@sh1nj1
sh1nj1 / strip.conf
Last active August 29, 2015 14:09 — forked from dextorer/strip.conf
actions=true
ads=true
analytics=true
appindexing=true
appstate=true
auth=true
cast=true
common=true
drive=false
dynamic=true
/*
Usage: define 4 variables. and apply this file as below in build.gradle.
archivesBaseName = 'doblist'
group = 'doblist'
version = '1.0.0-SNAPSHOT'
System.properties.repoUrl = 'http://REPOSITORY_URL'
apply from: 'https://gist.githubusercontent.com/sh1nj1/5c12f2390a9180be4949/raw/9b5711490bc0526ac2bfc3df5aa4a0343e722b52/upload-archives.gradle'
#!/bin/bash
#
# =========================================================================
# Copyright 2014 Rado Buransky, Dominion Marine Media
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
@sh1nj1
sh1nj1 / install-el.sh
Created April 21, 2015 09:20
Install elasticsearch
#!/bin/bash
version=1.5.1
dir=~/local/elastic-search
mkdir ${dir}
cd ${dir}
curl -O https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-${version}.tar.gz
tar xzvf elasticsearch-${version}.tar.gz
@sh1nj1
sh1nj1 / jks-to-crt-and-key.txt
Created May 13, 2015 09:46
jks to crt and key
keytool -list -keystore keystore.jks
keytool -importkeystore -srckeystore keystore.jks -destkeystore keystore.p12 -deststoretype PKCS12 -srcalias alias -deststorepass password
openssl pkcs12 -in keystore.p12 -nokeys -out cert.pem
openssl pkcs12 -in keystore.p12 -nodes -nocerts -out key.pem
openssl x509 -outform der -in cert.pem -out cert.crt
openssl rsa -in key.pem -out key.key
@sh1nj1
sh1nj1 / update-file-encoding.sh
Created November 3, 2015 01:04
update file encoding
find ./ -name "*.sql" -exec file -i {} \; | grep "charset=iso-8859-1" | cut -d':' -f1 | while read a; do iconv -c -f euc-kr -t utf-8 $a > "$a-utf8.sql"; cat "$a-utf8.sql" > "$a"; rm "$a-utf8.sql"; done
@sh1nj1
sh1nj1 / emr_bootstrap_java_8.sh
Last active March 16, 2016 06:21 — forked from ericeijkelenboom/emr_bootstrap_java_8.sh
Bootstrap script for installing Java 8 on an Amazon Elastic MapReduce instance (AMI 3.0.1)
# Check java version
JAVA_VER=$(java -version 2>&1 | sed 's/java version "\(.*\)\.\(.*\)\..*"/\1\2/; 1q')
if [ "$JAVA_VER" -lt 18 ]
then
# Download jdk 8
echo "Downloading and installing jdk 8"
wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8-b132/jdk-8-linux-x64.rpm"
# Silent install
@sh1nj1
sh1nj1 / spring-boot-exclude-jars
Created March 18, 2016 00:12
Exclude some jar files from package with spring-boot-gradle-plugin.
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.3.3.RELEASE")
}
apply plugin: 'spring-boot'
springBoot {
customConfiguration = 'runtime'
}
@sh1nj1
sh1nj1 / spark-spring-boot-pom.xml
Created March 18, 2016 00:23
Spark application with SpringBoot.
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>tv.anypoint</groupId>
<artifactId>spark-spring-boot</artifactId>
<version>0.0.1-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>