Skip to content

Instantly share code, notes, and snippets.

@Cepr0
Cepr0 / gist:86fb282a5697c5ba57623b51ade3d271
Created October 5, 2020 18:51
Confugure Logback with Logstash appender in Spring Boot application
pom.xml
-------
<!-- Used for conditional processing of Logback config -->
<!-- See: http://logback.qos.ch/manual/configuration.html#conditional-->
<dependency>
<groupId>org.codehaus.janino</groupId>
<artifactId>janino</artifactId>
<version>3.0.6</version>
</dependency>
@Hakky54
Hakky54 / openssl_commands.md
Last active July 23, 2024 15:29 — forked from p3t3r67x0/openssl_commands.md
Some list of openssl commands for check and verify your keys

OpenSSL 🔐

Install

Install the OpenSSL on Debian based systems

sudo apt-get install openssl
@Hakky54
Hakky54 / java_keytool_cheat_sheet.md
Last active July 18, 2024 03:45
Keytool Cheat Sheet - Some list of keytool commands for create, check and verify your keys

Keytool CheatSheet 🔐

Some history

This cheat sheet came into life when I started working on a tutorial of setting up one way tls and two way tls, which can be found here: GitHub - Mutual TLS SSL

Creation and importing

Generate a Java keystore and key pair

keytool -genkeypair -keyalg RSA -keysize 2048 -keystore keystore.jks -alias server -validity 3650
@cubespace
cubespace / sql, bash
Created May 30, 2017 08:51 — forked from igorpronin/sql, bash
postgresql - администрирование
Вывести всех пользователей
SELECT * FROM pg_shadow;
Поменять пароль пользователю
ALTER USER "user_name" WITH PASSWORD 'new_password';
командой psql
\password user_name
Переименовать пользователя постгрес
ALTER USER <old_username> RENAME TO <new_username>;
@zerda
zerda / .gitlab-ci.yml
Last active October 8, 2020 04:05
Gitlab CI for spring boot project
image: maven:3.3-jdk-8-alpine
cache:
key: "$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME"
paths:
- .m2/
variables:
MAVEN_OPTS: "-Dmaven.repo.local=.m2"
@stasgm
stasgm / gist:29b0dc83b2746929f87a3763751b4368
Created May 4, 2016 17:02
Firebird SQL - First/last day of month
select
current_date - EXTRACT(DAY FROM current_date) + 1 FirstDay,
current_date - EXTRACT(DAY FROM current_date) + 32 - EXTRACT(DAY FROM current_date - EXTRACT(DAY FROM current_date) + 32) LastDay
from
rdb$database
@amaembo
amaembo / PairTest.java
Last active June 1, 2023 18:57
JMH benchmark for different solutions of http://stackoverflow.com/q/30089761/4856258
package org.sample;
import java.util.concurrent.TimeUnit;
import javax.util.streamex.*;
import java.util.stream.*;
import java.util.*;
import org.openjdk.jmh.infra.Blackhole;
import org.openjdk.jmh.annotations.*;
@lucascs
lucascs / Capitalize.java
Created April 30, 2015 01:50
Capitalize java 8
import java.util.Arrays;
public class Capitalize {
public static String capitalize (String x) {
return x.substring(0,1).toUpperCase() + x.substring(1).toLowerCase();
}
public static void main(String[] args) {
String text = "gabinete do deputado fulando de tal e de dona maria";
@myusuf3
myusuf3 / delete_git_submodule.md
Created November 3, 2014 17:36
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@mscharhag
mscharhag / Java8DateTimeExamples.java
Created February 24, 2014 19:53
Examples for using the Java 8 Date and Time API (JSR 310)
import java.time.*;
import java.time.format.DateTimeFormatter;
import java.time.format.FormatStyle;
import java.time.temporal.ChronoUnit;
import java.time.temporal.TemporalAdjusters;
import java.util.*;
import static java.time.temporal.TemporalAdjusters.*;
public class Java8DateTimeExamples {