Skip to content

Instantly share code, notes, and snippets.

View batmat's full-sized avatar
😞
I may be very very slow to respond.

Baptiste Mathus batmat

😞
I may be very very slow to respond.
View GitHub Profile
@batmat
batmat / working-cargo-jbossas6-pom.xml
Created February 24, 2011 16:41
For the record, here is a working pom for a dead-simple webapp I just created using the standard maven archetype. Managed to deploy onto a JBoss-as-6 (community) freshly downloaded.
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>net.batmat</groupId>
<artifactId>testdeploywebapp</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>testdeploywebapp Maven Webapp</name>
<url>http://maven.apache.org</url>
<dependencies>
@batmat
batmat / working-cargo-jboss-eap5.1.0-pom.xml
Created March 8, 2011 12:55
working pom for a dead-simple webapp I just created using the standard maven archetype. Managed to deploy onto JBoss EAP 5.1.0.
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>net.batmat</groupId>
<artifactId>testdeploywebapp</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>testdeploywebapp Maven Webapp</name>
<url>http://maven.apache.org</url>
<dependencies>
@batmat
batmat / renameJpgWithDateTimeOrigalExif.groovy
Created March 17, 2011 19:23
Small Groovy script to process a pictures directory and rename them using "Date/Time original" exif field. Useful for example if you want your photos automatically sorted by their names, as if it was sorted by the photo date. My case: useful in the Ph
// Using metadata-extractor-2.4.0-beta-1.jar from http://www.drewnoakes.com/drewnoakes.com/code/exif/sampleUsage.html
import com.drew.metadata.Metadata
import com.drew.imaging.jpeg.JpegMetadataReader
import com.drew.metadata.Directory
import com.drew.metadata.Tag
import java.text.*;
def dirToProcess = new File(".")
assert dirToProcess.exists()
#!/bin/bash
# Argument = -h -v -i groupId:artifactId:version -c classifier -p packaging -r repository
#shopt -o -s xtrace
# Define Nexus Configuration
NEXUS_BASE=http://repository.example.com:8081/nexus
REST_PATH=/service/local
ART_REDIR=/artifact/maven/redirect
@batmat
batmat / Sha512Test.java
Created April 17, 2011 10:52
Sample code showing how to use SHA-512 hash (Well, it's fully standard).
package net.batmat.testsha512;
import static junit.framework.Assert.assertEquals;
import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.HashMap;
import java.util.Map;
import org.junit.Test;
#!/bin/sh
# This post-commit hook is designed to serve as a central script for any repository you want to backup (via git bundle)
# based on the original idea of David Gageot https://gist.github.com/736547
# Backup configuration
backupRoot="$HOME/Mes documents/My Dropbox/gitbackup/"
#howManyTime=--since=5.days
howManyTime=-10
branchToBackup=master
10 Capital et réserves
101 Capital
104 Primes liées au capital social
105 Ecarts de réévaluation
106 Réserves
107 Ecart d'équivalence
108 Compte de l'exploitant
109 Actionnaires : capital souscrit - non appelé
11 Report à nouveau (solde créditeur ou débiteur)
110 Report à nouveau (solde créditeur)
2011-10-06 10:44:07
Full thread dump IBM J9 VM (2.3 J2RE 1.5.0 IBM J9 2.3 AIX ppc-32 j9vmap3223ifx-20080811 (JIT enabled)
J9VM - 20080809_21892_bHdSMr
JIT - 20080620_1845_r8
GC - 200806_19):
"main" - Thread t@1
java.lang.Thread.State: RUNNABLE
at java.net.PlainSocketImpl.socketAccept(Native Method)
@batmat
batmat / cpu-contention.vmstat
Created November 29, 2011 16:46
CPU contention :-)
r b avm fre re pi po fr sr cy in sy cs us sy id wa
163 0 3667865 15671 0 185 0 0 0 0 288 146313 6423 32 68 0 0
152 4 3664094 19711 0 400 441 512 814 0 702 132075 6859 29 71 0 0
118 12 3635468 58837 0 126 3218 3649 6809 0 2227 130823 17049 31 69 0 0
82 37 3697800 11397 0 125 4488 5147 10829 0 3076 154349 66793 31 67 0 2
151 2 3690600 22733 0 269 1429 1612 3335 0 1283 141325 7826 29 71 0 0
91 2 3674425 39646 0 307 507 565 1210 0 672 167149 5683 28 72 0 0
83 1 3676025 36587 0 427 0 0 0 0 519 150675 7634 28 72 0 0
76 4 3656376 55058 0 373 0 0 0 0 457 146427 7118 28 72 0 0
100 1 3648494 61734 0 332 0 0 0 0 397 145245 8608 29 71 0 0
@batmat
batmat / gist:1569693
Created January 6, 2012 08:28
FK constraint creation sample (Oracle)
CREATE TABLE "TESTTABLEPARENT"
(
"A" VARCHAR2(20 BYTE) NOT NULL ENABLE,
"B" VARCHAR2(20 BYTE) NOT NULL ENABLE,
"C" DATE,
CONSTRAINT "TESTTABLEPARENT_PK" PRIMARY KEY ("A", "B")
)
CREATE TABLE "TESTTABLEENFANT"
(
"INFO_BLABLA" VARCHAR2(20 BYTE),