Skip to content

Instantly share code, notes, and snippets.

@blotus
blotus / log4j_exploitation_attempts_crowdsec.md
Last active December 29, 2023 12:24
IPs exploiting the log4j2 CVE-2021-44228 detected by the crowdsec community

This list is no longer updated, thus the information is no longer reliable.

You can see the latest version (from october 2022) here

@oucem
oucem / FluxDataBufferParseExperiments.java
Created October 15, 2021 21:02 — forked from caprica/FluxDataBufferParseExperiments.java
Some experiments using Reactor to parse XML/JSON from a Flux of DataBuffer instances
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.core.io.buffer.DataBuffer;
import org.springframework.core.io.buffer.DataBufferUtils;
import org.springframework.core.io.buffer.DefaultDataBufferFactory;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
import java.io.BufferedWriter;
import java.io.FileWriter;
@oucem
oucem / example.kt
Created November 4, 2020 15:51 — forked from ajalt/example.kt
Kotlin initializer order example
open class Parent {
private val a = println("Parent.a")
constructor(arg: Unit=println("Parent primary constructor default argument")) {
println("Parent primary constructor")
}
init {
println("Parent.init")
}
@oucem
oucem / .gitconfig
Last active June 17, 2022 08:54 — forked from Mattgic/.gitconfig
git config
[user]
name = Rabhi Houcem
email = [email protected]
[core]
autocrlf = input
excludesfile = ~/.gitignore-global
editor = vim
[color]
ui = true
[alias]
@oucem
oucem / loadExternalFiles.xml
Created April 21, 2018 17:25 — forked from jgcasta/loadExternalFiles.xml
Spring bean to describe how to load external property file, and Log4j.properties
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util"
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd">
<bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location">
@serac
serac / Application.java
Last active March 25, 2021 16:32
Configuring RestTemplate for Client TLS in a Spring Boot Application
/*
* See LICENSE for licensing and NOTICE for copyright.
*/
package edu.vt.middleware.app;
import java.io.File;
import java.security.*;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Predicate;
@ajalt
ajalt / example.kt
Created September 21, 2016 17:39
Kotlin initializer order example
open class Parent {
private val a = println("Parent.a")
constructor(arg: Unit=println("Parent primary constructor default argument")) {
println("Parent primary constructor")
}
init {
println("Parent.init")
}
@welshstew
welshstew / groovy-zip.groovy
Created March 5, 2015 04:41
groovy script to zip and unzip text/String content
// Simple groovy script to compress / decompress Strings
import java.util.zip.GZIPInputStream
import java.util.zip.GZIPOutputStream
def zip(String s){
def targetStream = new ByteArrayOutputStream()
def zipStream = new GZIPOutputStream(targetStream)
zipStream.write(s.getBytes('UTF-8'))
zipStream.close()
def zippedBytes = targetStream.toByteArray()
@timander
timander / pom.xml
Last active August 28, 2021 23:15
Maven JaCoCo Coverage Profile
<profiles>
<profile>
<id>normal</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<surefireArgLine></surefireArgLine> <!--create blank property for surefire when not running under coverage profile-->
<failsafeArgLine></failsafeArgLine> <!--create blank property for failsafe when not running under coverage profile-->
</properties>
@freretuc
freretuc / gist:3346696
Created August 14, 2012 05:50
Liste Gares SNCF France + codes gares
"frxab";"50.102";"1.82425";"Abbeville"
"frmlw";"49.0037";"2.57089";"Aéroport CDG 2 TGV"
"frxag";"43.3174";"3.46613";"Agde"
"fragf";"44.2084";"0.620312";"Agen"
"frais";"49.9284";"2.20058";"Ailly Sur Somme"
"frqai";"45.5543";"6.6489";"Aime la Plagne"
"frqxb";"43.5232";"5.44412";"Aix en Provence"
"fraie";"43.4553";"5.31723";"Aix en Provence TGV"
"frxai";"45.6879";"5.90924";"Aix les Bains le Revard"
"frale";"45.7861";"5.98222";"Albens"