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 / jenkins-plugins-per-month.sh
Last active November 15, 2015 21:50
Small scripts to generate Jenkins data about number of plugins per months since 2007
# Quick & Dirty way to generate data for number of plugins per month
# after the .svg of installations per plugins available under stats.jenkinsci.org
# Get all the files
for year in $(seq 2007 2015)
do
for month in $(seq -w 1 12)
do
wget "http://stats.jenkins-ci.org/jenkins-stats/svg/$year$month-plugins.svg"
done
@batmat
batmat / forge-kids-gloves.adoc
Last active November 3, 2015 21:39
A Software Factory With Kid Gloves

Deliver software quickly and on a regular basis? Adapt to change? All that by hands?

In this session, I’ll explain how we went from a simple Hudson with some jobs a few years ago, to a complete software factory around Jenkins with several hundreds jobs today (Continuous Integration, Continuous Inspection…​).

I’ll give feedback on things that didn’t work, and things that work. Why and how put developers in control of their jobs. Tips & tricks to manage all that.

Finally, we’ll see ongoing and upcoming work designed to provide even more "Agility" to all that: job versioning, using Docker for reproducibility and auto-scaling, etc.

@batmat
batmat / crush-ze-docker-storage.sh
Last active August 29, 2015 14:28
Small PoC script showing the disk usage can grow very quickly with forgotten volumes (and it's not removable through docker rm[i])
#!/bin/bash
set -eou pipefail
COUNT=5
SIZE_IN_MB=500
while [[ $COUNT > 0 ]]; do
sudo du -sm /var/lib/docker
docker run -v /pouet debian fallocate -l ${SIZE_IN_MB}M /pouet/test.img
COUNT=$(( $COUNT - 1 ))
@batmat
batmat / sonarqube-mysql-docker-compose.yml
Created July 15, 2015 22:32
Working SonarQube + Mysql Dead Simple Docker Compose file
sonarqube:
image: sonarqube:5.1.1
ports:
- "9000:9000"
- "3306:3306"
environment:
- SONARQUBE_JDBC_USERNAME=sonar
- SONARQUBE_JDBC_PASSWORD=sonar
- SONARQUBE_JDBC_URL=jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true
@batmat
batmat / KDE5-unstable.adoc
Last active August 29, 2015 14:22
KDE / Plasma 5 unstabilities

KDE 5 (Plasma) issues

Wildly unstable

Goes without saying, anything below was working fine with KDE4.

Autostart

Autostart apps configured for .kde4 previously are now just ignored. The format totally changed: from simple symlink before, you now have to create a still simple but far more complex than before file and put it elsewhere so that KDE5 starts your app.

@batmat
batmat / eclipse-tips.adoc
Last active August 29, 2015 14:21
WIP list of Eclipse tips & tricks (mainly for the Java IDE)

List of tips to cover

  1. Refactoring: Extract method?

  2. Typing: automatically place semicolons

  3. Typing: escape text when pasting into a string literal

  4. Do not always remember the shortcuts? Find any option with Ctrl-Shift-3

  5. Organize imports: how to ignore javadoc

  6. Formatter: don’t touch my manually wrapped lines!

  7. Formatter: don’t touch that part (using begin/end tags). Thx Emmanuel Fontan)

@batmat
batmat / NonNullUtil.java
Created May 6, 2015 09:40
SONARJAVA-985 Example
package xxxxx.utils;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
@batmat
batmat / keybase.md
Created February 5, 2015 06:22
keybase.md

Keybase proof

I hereby claim:

  • I am batmat on github.
  • I am bmathus (https://keybase.io/bmathus) on keybase.
  • I have a public key whose fingerprint is 7207 4617 7725 A892 07A7 075B FD5D EA07 FCB6 90A8

To claim this, I am signing this object:

@batmat
batmat / jsr308-illustration
Created April 16, 2014 13:58
JSR 308 Illustration : Multiple same annotations on the same elements don't require wrapping it from Java 8
// Legacy style
@SomeAnnotations({
@SomeAnnotation(..a..),
@SomeAnnotation(..b..),
@SomeAnnotation(..c..),
})
public class SomeClass {
...
}
@batmat
batmat / gitbackup-config
Last active August 29, 2015 13:57
git backup (put this in your .git/config or better in your global gitconfig file).
[alias]
backup = "!f(){ git add -A . && git ci -q -m \"WIP backup\" && commit=`git show HEAD|head -1` && git reset HEAD~ && echo \"Backup OK: $commit (or use git reflog)\"; };f"