Skip to content

Instantly share code, notes, and snippets.

View BenjaminHerbert's full-sized avatar

Benjamin Herbert BenjaminHerbert

View GitHub Profile
@BenjaminHerbert
BenjaminHerbert / gist:0ce28721193efe8e7c8a
Last active August 29, 2015 14:05
docker shortcuts
# From http://kartar.net/2014/03/some-useful-docker-bash-functions-and-aliases/
# Docker container IP
alias dip="docker inspect --format '{{ .NetworkSettings.IPAddress }}'"
#Removing containers
drm() { docker rm $(docker ps -q -a); }
#Removing images
dri() { docker rmi $(docker images -q); }
@BenjaminHerbert
BenjaminHerbert / assignedLabel.groovy
Last active March 14, 2016 16:02
Jenkins Expression fuu AND NOT bar
job.setAssignedLabel(
// fuu && !bar
new hudson.model.labels.LabelExpression.And(
new hudson.model.labels.LabelAtom("fuu"),
new hudson.model.labels.LabelExpression.Not(new hudson.model.labels.LabelAtom("bar"))
)
)
@BenjaminHerbert
BenjaminHerbert / .md
Last active April 6, 2016 09:57
Linux fuu

Some helpful things for Linux

Systemd Maximum Number of Openfiles

  • systemd does not rely on ulimit (as opposed to Fedora), so /etc/security/limits.conf is ignored
  • The solutions is to use LimitNOFILE=10000 (with an appropriate value) in the .service file
    • systemctl daemon-reload
    • systemctl restart <service>
    • systemctl show -p LimitNOFILE <service>
@BenjaminHerbert
BenjaminHerbert / man.md
Created June 1, 2016 16:48
man - Handbuch

man - Handbucheinträge

Abschnitte - Nummern

       Die folgende Tabelle zeigt die Nummern der Abschnitte der Handbuchseiten und den Typ der dort zu findenden Seiten.

       1   Ausführbare Programme oder Shell-Befehle
       2   Systemaufrufe (Kernel-Funktionen)
       3   Bibliotheksaufrufe (Funktionen in Programmbibliotheken)
 4 Spezielle Dateien (gewöhnlich in /dev)
@BenjaminHerbert
BenjaminHerbert / gist:ddbe2384d03a8d73292a74a55ec332e4
Last active July 8, 2016 13:07
Jenkins URLs and authentication
# Create a Jenkins job via API
curl -X POST -H "Content-Type:application/xml" -d @config.xml http://<user>:<api-token@<server>/createItem?name=<job-name>
# Download an artifact:
wget --auth-no-challenge --http-user=<user> --http-password=<user-token> http://<server>/<path-to-foobar>
curl -X GET http://<user>:<api-token@<server>
@BenjaminHerbert
BenjaminHerbert / .md
Last active October 14, 2016 11:15
Linux-Kram

Timezone dump

> zdump /etc/localtime 
/etc/localtime  Mon Sep  5 15:08:55 2016 CEST

Docker timezones

Docker link timezone into container:

job('test') {
steps{
maven {
mavenInstallation('3.3.9')
goals('fuu:bar')
}
maven {
mavenInstallation('3.3.9')
goals('compile')
}
@BenjaminHerbert
BenjaminHerbert / example.groovy
Created October 12, 2016 19:56
DSL in Groovy
class Behandlungsplan {
def count = 0
def patient(String yo) {
println "Patient: " + yo
}
def behandlung(String yolo) {
println yolo
count ++