Skip to content

Instantly share code, notes, and snippets.

View mika's full-sized avatar

Michael Prokop mika

View GitHub Profile
#!/usr/bin/env python
from __future__ import print_function
import sys
import argparse
def brute_search(dev, search_string, max_lines, bufsize):
oldbuf = b''
found = False
data = None
#!/bin/bash
#
# Copies certain kinds of known files and directories from a given Jenkins master directory
# into a git repo, removing any old ones, adds 'em, commits 'em, pushes 'em.
#
set -ex
if [ $# -ne 2 ]; then
echo usage: $0 root_dir jenkins_master
# You do need to talk to an NTP server or two (or three).
server time.metrologie.at iburst
server ts1.aco.net
server ptbtime1.ptb.de iburst
server ntp.siq.si
server ntp2.belwue.de
server time1.euro.apple.com
server ntp1-rz.rrze.uni-erlangen.de
server Time1.Stupi.SE
server ntp0.nl.uu.net
@mika
mika / example output.txt
Last active August 29, 2015 14:14
puppetdb<->ansible
[int]
inta1-web01.in...
inta1-nfs01.in...
inta1-db02.in...
[prod]
proda1-api02.in...
proda1-scripts01.in...
import com.cloudbees.plugins.credentials.*
import com.cloudbees.plugins.credentials.domains.*
import com.cloudbees.plugins.credentials.common.*;
import hudson.security.ACL
import hudson.scm.SubversionSCM
def jenkins = Jenkins.instance
jenkins.allItems.each { job ->
def scm = job.scm;

pytest all the things

@mika
mika / jdg-pipeline_all.groovy
Created July 21, 2016 06:39 — forked from jbfavre/jdg-pipeline_all.groovy
Jenkins Debian Glue - Jenkins Pipeline
// Checkout package git repository
stage('Checkout GIT repository')
node('master'){
deleteDir()
checkout changelog: false,
poll: false,
scm: [$class: 'GitSCM',
branches: [[name: "${branch}"]],
doGenerateSubmoduleConfigurations: false,
extensions: [
# I am managed in <%= @__scope__.source.namespace %> line <%= @__scope__.source.line %>
actual
contents
...
distribution=$distribution
export REPOS=$distribution
export DIST=$distribution
export USE_FREIGHT=true
export FREIGHT_BASE=/srv/freight
export FREIGHT_REPOSITORY=managed
export KEY_ID=DEADBEEF # please adjust, or edit /etc/freight.conf
/usr/bin/build-and-provide-package
# Creates:
printf "[Service]\nSystemCallFilter=~fsync sync syncfs fdatasync msync sync_file_range\nSystemCallErrorNumber=0\n" \
| s env EDITOR='tee -a' systemctl edit postgresql@.service