Skip to content

Instantly share code, notes, and snippets.

View aaukhatov's full-sized avatar
:octocat:

Artur Aukhatov aaukhatov

:octocat:
View GitHub Profile
@aaukhatov
aaukhatov / build.gradle ws
Last active February 7, 2017 11:49
Gradle build web service script
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'war'
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
jcenter()
maven {
@aaukhatov
aaukhatov / build.gradle ws other
Created February 7, 2017 11:49
Gradle build script
plugins {
id "io.spring.dependency-management" version "0.5.7.RELEASE"
id "io.dcow.sublime" version "0.9.2"
id "org.akhikhl.gretty" version "1.2.4"
}
apply plugin: 'war'
apply plugin: 'idea'
apply plugin: 'eclipse-wtp'
@aaukhatov
aaukhatov / WriteToFile.groovy
Created May 31, 2017 10:17
How to write String to File by Groovy
String content = 'Some text'
def myFile = new File('mySuperFile.txt')
myFile.write(content)
@aaukhatov
aaukhatov / build.gradle
Created June 2, 2017 08:25
FileManager web-service
buildscript {
repositories {
maven {
url = "http://jerry-vrt.nsd.ru:8081/artifactory/repo"
}
}
dependencies {
classpath 'org.springframework.boot:spring-boot-gradle-plugin:1.5.3.RELEASE'
}
@aaukhatov
aaukhatov / PipelineEmailSender.groovy
Last active June 8, 2017 10:50
Email sender from Jenkins CI
node() {
stage("Checkout") {
cloneRepo("WSAlameda", "http://gitlabsvr.nsd.ru/gitlab/alameda/WSAlameda.git", "${branch}")
}
stage("Unit tests") {
dir('WSAlameda') {
try {
sh "chmod +x gradlew"
@GET
@Produces(MediaType.APPLICATION_JSON)
public Response getState(@Context ServletContext context) {
log.info("IoT page");
URI uri = UriBuilder.fromUri(URI.create(context.getContextPath()))
.path("/iot.html").build();
return Response.seeOther(uri).build();
}
@aaukhatov
aaukhatov / gist:51d777705906b9de753a06af207338b3
Created September 3, 2019 17:38
Reset Evaluation period in Intellij Idea 2019.x
rm ~/Library/Preferences/jetbrains.idea.*.plist
rm ~/Library/Preferences/IntelliJIdea2019.1/eval/*.key
sed -i'' -e '/evlsprt/d' ~/Library/Preferences/IntelliJIdea2019.1/options/options.xml
sed -i'' -e '/evlsprt/d' ~/Library/Preferences/com.apple.java.util.prefs.plist
# Base settings and GC logging
-server -XX:+AlwaysPreTouch # First should be default, but we make it explicit, second pre-zeroes memory mapped pages on JVM startup -- improves runtime performance
# -Xloggc:gc-%t.log # CUSTOMIZE LOCATION HERE - $path/gc-%t.log -- the %t in the gc log file path is so we get a new file with each JVM restart
-XX:NumberOfGCLogFiles=5 -XX:+UseGCLogFileRotation -XX:GCLogFileSize=20m # Limits the number of files, logs to folder
-XX:+PrintGC -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:+PrintHeapAtGC -XX:+PrintGCCause
-XX:+PrintTenuringDistribution -XX:+PrintReferenceGC -XX:+PrintAdaptiveSizePolicy # gather info on object age & reference GC time for further tuning if needed.
# G1 specific settings -- probably should be default for multi-core systems with >2 GB of heap (below that, default is probably fine)
-XX:+UseG1GC
-XX:+UseStringDeduplication