Skip to content

Instantly share code, notes, and snippets.

View ysrotciv's full-sized avatar

rotciv ysrotciv

  • Shanghai
View GitHub Profile
version = '0.1.0'
task fatJar(type: Jar) {
manifest {
attributes 'Implementation-Title': 'Gradle Jar File Example',
'Implementation-Version': version,
'Main-Class': 'com.mkyong.DateUtils'
}
baseName = project.name + '-all'
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
@ysrotciv
ysrotciv / .bash_profile
Created June 10, 2018 10:20
http_proxy switch functions
function proxy_off(){
unset http_proxy
unset https_proxy
brew services stop polipo
echo -e "已关闭代理"
}
function proxy_on() {
export no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com"
export http_proxy="http://127.0.0.1:8123"
@ysrotciv
ysrotciv / Dockerfile
Created June 10, 2018 10:03
Optimization of common Dockerfile
FROM java:openjdk-8u111-jre-alpine
COPY repositories /etc/apk/
RUN apk update && apk add tzdata && cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& echo "Asia/Shanghai" > /etc/timezone && apk del tzdata
@ysrotciv
ysrotciv / ConsumerTest
Last active May 19, 2017 02:13
Kafka operation
package com.palmaplus.amapdata.test.tour
import java.util.{Collections, Properties}
import org.apache.kafka.clients.consumer.{ConsumerConfig, KafkaConsumer}
import org.apache.kafka.clients.producer.ProducerConfig
import com.palmaplus.amapdata.common.KafkaUtil
import com.palmaplus.amapdata.common.KafkaUtil.bootstrapServers
@ysrotciv
ysrotciv / repositories
Created January 16, 2017 05:56
repositories for sbt user in the wall
[repositories]
local
nexus-aliyun:http://maven.aliyun.com/nexus/content/groups/public
oschina:http://maven.oschina.net/content/groups/public/
repo2:http://repo2.maven.org/maven2
jboss:http://repository.jboss.com/maven2/
sonatype:http://repository.sonatype.org/content/groups/public/
ibiblio:http://mirrors.ibiblio.org/pub/mirrors/maven2/org/acegisecurity/
oschina-ivy:http://maven.oschina.net/content/groups/public/, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]
sbt-releases-repo: http://repo.typesafe.com/typesafe/ivy-releases/, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]
@ysrotciv
ysrotciv / httpd.conf
Created August 11, 2015 04:55
apache2.2+django
#
# This is the main Apache server configuration file. It contains the
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs/2.2/> for detailed information.
# In particular, see
# <URL:http://httpd.apache.org/docs/2.2/mod/directives.html>
# for a discussion of each configuration directive.
#
#
# Do NOT simply read the instructions in here without understanding
@ysrotciv
ysrotciv / updatePip.py
Created November 26, 2014 13:17
move files in the folder depend on each modified time
import os, time, shutil, datetime
from stat import *
from os import listdir
from os.path import isfile, join
LASTUPDATETIME = "E:\code\python\\updatePip\lastUpdateTime"
SOURCEPATH = "D:\workspace\Saga\Tools\Saga1.0-Data\data\pipLib"
TARGETPATH = "D:\workspace\Saga\Tools\Saga1.0-Data\data\scripts\Win32\\"
TEMPLATEDATA = "D:\workspace\Saga\Tools\Saga1.0-Data\data\saga_template.data"
TEMPLATEDATATARGET = "D:\workspace\Saga\Tools\Saga1.0-Data\data\scripts\Win32\saga_template.data"