Skip to content

Instantly share code, notes, and snippets.

View nkonev's full-sized avatar

Nikita Konev nkonev

View GitHub Profile
@nkonev
nkonev / swagger.json
Created November 1, 2016 16:42
Swagger2Markup crash on fail(@RequestParam Map<String, String> requestParameters)
{
"swagger": "2.0",
"info": {
"description": "Api Documentation",
"version": "1.0",
"title": "Api Documentation",
"termsOfService": "urn:tos",
"contact": {},
"license": {
"name": "Apache 2.0",
@nkonev
nkonev / application.yml
Created February 27, 2017 15:02
hibernate logging and statistics
spring.jpa.hibernate.ddl-auto: validate
spring.jpa.database-platform: org.hibernate.dialect.PostgreSQLDialect
logging.level.org.hibernate.SQL: DEBUG
logging.level.org.hibernate.type: TRACE
spring.jpa.properties.hibernate.use_sql_comments: true
spring.jpa.properties.hibernate.format_sql: true
spring.jpa.properties.hibernate.generate_statistics: true
@nkonev
nkonev / nginx.conf
Created March 3, 2017 00:21 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@nkonev
nkonev / HazelCastConsole.java
Created March 21, 2017 13:42
HazelCastConsole.java
package ru.altarix.mp.aaa;
import com.hazelcast.console.ConsoleApp;
import com.hazelcast.core.HazelcastInstance;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@nkonev
nkonev / launcher.sh
Created April 20, 2017 08:41
launcher which redirects stdout and stderr to file and additively wtites start date, end date and exitcode
#!/bin/bash
# don't forget to `chmod +x`
# will exit on error in that script
set -e
EXIT_CODE_ERROR=1
MESSAGE_USAGE="Usage:\n./launcher.sh \"echo success\" file.log\n./launcher.sh \"ls nonexist\" file.log"
if [ -z "$1" ]; then
@nkonev
nkonev / glassfish.service
Last active December 14, 2022 18:31
systemctl GlassFish start script
[Unit]
Description=GlassFish Server
After=syslog.target network.target
[Service]
Type=forking
ExecStart=/opt/glassfish4/bin/asadmin start-domain domain1
ExecStop=/opt/glassfish4/bin/asadmin stop-domain domain1
TimeoutSec=180
@nkonev
nkonev / only-junit-maven-report.md
Created May 17, 2017 00:08
Non-conflict with spring boot maven plugin (removed unnecessary reporters which produses gemfire dependency error)
    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-project-info-reports-plugin</artifactId>
                <reportSets>
                    <reportSet>
 
package p;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Created by nkonev on 22.05.17.
*/
public class ImmutableStatelessInterfaceInstanceForThread {
public static void main(String[] args) throws InterruptedException {
package com.github.nikit.cpp.deadlock;
/**
* Created by nik on 03.08.16.
*/
public class DeadlockExample {
public static void main(String... args) throws InsufficientFundsException, InterruptedException {
final Account a = new Account(1000);
final Account b = new Account(2000);