Skip to content

Instantly share code, notes, and snippets.

View barlog-m's full-sized avatar
😕
Have seen some bugs...

Barlog M. barlog-m

😕
Have seen some bugs...
View GitHub Profile
@barlog-m
barlog-m / BaseIntegrationTest.kt
Created July 18, 2018 20:35
Integration abstract class for Spring Boot and Testcontainers
import bot.config.ITConfig
import org.junit.jupiter.api.extension.ExtendWith
import org.springframework.boot.test.context.SpringBootTest
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment
import org.springframework.test.context.ActiveProfiles
import org.springframework.test.context.junit.jupiter.SpringExtension
import org.springframework.boot.test.util.TestPropertyValues
import org.springframework.context.ConfigurableApplicationContext
import org.springframework.context.ApplicationContextInitializer
import org.springframework.context.ApplicationListener
@barlog-m
barlog-m / SpringBootUndertowHTTP2.java
Created August 23, 2015 09:11
Enable HTTP2 in Undertow with Spring Boot
public class SpringBootUndertowHTTP2 {
@Bean
UndertowEmbeddedServletContainerFactory embeddedServletContainerFactory() {
UndertowEmbeddedServletContainerFactory factory = new UndertowEmbeddedServletContainerFactory();
factory.addBuilderCustomizers(
builder -> builder.setServerOption(UndertowOptions.ENABLE_HTTP2, true));
return factory;
}
}
@barlog-m
barlog-m / build.gradle
Last active December 13, 2017 14:37
gradle docker image build task
task docker(dependsOn: tasks.bootJar) {
def tag = 'app'
def workDir = file("$buildDir/docker")
def dockerFile = file('src/main/docker/Dockerfile')
def inputDir = file("$buildDir/libs")
doLast {
copy {
from inputDir
from dockerFile
# JDK 7
-Dcom.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.dump=true
-Dcom.sun.xml.internal.ws.transport.http.HttpAdapter.dump=true
-Dcom.sun.xml.internal.ws.transport.http.HttpAdapter.dumpTreshold=999999
# JDK 8
-Dcom.sun.xml.ws.transport.http.client.HttpTransportPipe.dump=true
-Dcom.sun.xml.ws.transport.http.HttpAdapter.dump=true
-Dcom.sun.xml.ws.transport.http.HttpAdapter.dumpTreshold=999999
@barlog-m
barlog-m / package.json
Last active December 17, 2015 12:48
TeamCity node.js script for start build branch
{
"name": "teamcity-build-starter",
"version": "0.0.1",
"private": true,
"dependencies": {
"node-fetch": "latest"
}
}
@barlog-m
barlog-m / commit message
Created April 15, 2015 08:53
Random commit message
curl -s http://whatthecommit.com/index.txt
@barlog-m
barlog-m / log message
Last active December 8, 2015 09:28
log messages
¯\_(ツ)_/¯
@barlog-m
barlog-m / ignore-self-signed-ssl-certificates.java
Last active December 8, 2015 09:27
Ignore self-signed SSL certificates
private void trustAllCertificates() {
try {
TrustManager[] trustAllCerts = new TrustManager[] {
new X509TrustManager() {
public java.security.cert.X509Certificate[] getAcceptedIssuers() {
return null;
}
public void checkClientTrusted(X509Certificate[] certs, String authType) {
}
@barlog-m
barlog-m / proxy.java
Last active December 8, 2015 09:27
Enable Proxy for all connections
private void enableProxy() {
System.setProperty("http.proxySet", "true");
System.setProperty("http.proxy", "localhost"); // JavaFX WebView
System.setProperty("http.proxyHost", "localhost");
System.setProperty("http.proxyPort", "8080");
System.setProperty("https.proxySet", "true");
System.setProperty("https.proxy", "localhost"); // JavaFX WebView
System.setProperty("https.proxyHost", "localhost");
System.setProperty("https.proxyPort", "8080");
@barlog-m
barlog-m / vagrant-ubuntu-ansible-provision.yml
Last active December 8, 2015 09:26
vagrant ubuntu ansible provision playbook
---
- name: Provision
hosts: all
sudo: yes
tasks:
- name: Upgrade
apt: upgrade=dist
- name: Locale install
apt: name=language-pack-ru state=latest update_cache=yes cache_valid_time=3600