Skip to content

Instantly share code, notes, and snippets.

@k9ert
k9ert / gist:5d7a8fd5bf0621e27361
Created May 13, 2015 00:15
VERY poor man's way to determine the newest version on a artifatctory's artifact
curl -u user:password -s https://soemartifactory.com/api/storage/repo-id/com/company/someotherpath/theartifact | jq .children | jq 'map(.uri)' | sort | tail -2 | head -1 | sed 's/^ *"\///' | sed 's/",$//'
@k9ert
k9ert / gist:18fce5fc99f389c5dacc
Created February 9, 2015 07:19
Passing the number of some errormessages to graphite daily
#!/bin/bash
PORT=2003
SERVER=graphite.yourcompany.com
yesterday=`date --date="yesterday" +%Y-%m-%d`
counter=`less /some/log/file/program-${yesterday}.log | grep "An errormessage" | wc -l`
#echo "echoing $counter"
@k9ert
k9ert / gist:ace7b25b354831ec5006
Created January 21, 2015 23:31
Bitcoin-assets 21-01-2015 minus some distractions
kim@kopti:~/tmp$ cat ba-21-01-2015.txt | grep -v ben_vulpes | grep -v asciilifeform | grep -v lobbes | grep -v "^$" | gpg --clearsign
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
18:00:01 gavinandresen: howdy y'all
18:00:54 kakobrekla: hi
18:01:28 felipelalli: hi!
18:02:11 gavinandresen: I came here so you can tell me how I’m going to ruin bitcoin (again…)
18:03:06 davout: gavinandresen: hello

Keybase proof

I hereby claim:

  • I am k9ert on github.
  • I am k9ert (https://keybase.io/k9ert) on keybase.
  • I have a public key whose fingerprint is 2C1E 6526 9F3D 11C8 2907 F647 EBE0 90A9 5354 FBCB

To claim this, I am signing this object:

@k9ert
k9ert / github_pom.rb
Last active August 29, 2015 14:10 — forked from gcmurphy/github_pom.rb
#!/usr/bin/env ruby
require 'pp'
require 'uri'
require 'net/http'
require 'octokit'
require 'nokogiri'
require 'celluloid'
require 'mongo'
require 'logger'
@k9ert
k9ert / gist:34e1547480821b18e722
Created September 16, 2014 11:56
Grails idiom to test for config-values
if (grailsApplication.config.zenboot.processing.workerThreads.respondsTo("toInteger") &&
grailsApplication.config.zenboot.processing.workerThreads.toInteger() > 0) {
// do something here
}
APT::Get::AllowUnauthenticated true;
APT::Install-Recommends false;
APT::Get::AutomaticRemove true;
#APT::Cache-Limit 31457280;
DPkg::Options {"--force-confold";};
@k9ert
k9ert / gist:567a3f0471ab914b21c7
Created June 26, 2014 16:00
some shell-effort to be able to run vagrant up/destroy on a jenkins, improvable!!
#!/bin/bash
vagrant destroy -f
timeout 3600 vagrant up
VAGRANT_RESULT=$?
echo "==============================================================="
if [ $VAGRANT_RESULT -eq 124 ]; then
echo "vagrant up timed out: 3600 seconds"
else
echo "Vagrant exited with code: $VAGRANT_RESULT"
@k9ert
k9ert / gist:3e6d64f620b0254d4ad7
Created June 24, 2014 22:11
example for a Pre-send Script in the JENKINS/Email-ext+plugin
// https://wiki.jenkins-ci.org/display/JENKINS/Email-ext+plugin
// An example for a Pre-send Script
// Assume output log-output like:
// ERROR: [email protected] please fix
import javax.mail.internet.*
logger.print("This ends up in the log as well");
String encodingOptions = "text/html; charset=UTF-8;";
// msg.setContent("please check!!!!", encodingOptions);
@k9ert
k9ert / gist:7689464
Last active December 29, 2015 15:19
you don't want to grep but grab which basically gives you all the lines below your pattern Can e.g. be used like this: cat catalina.out | grab 4:02:14.989 | tail -100
#!/usr/bin/perl
my @grabbed;
while (<STDIN>) {
if (/$ARGV[0]/) {
print $_;
while (<STDIN>) {
last if /^$/;
print $_;
}
}