Skip to content

Instantly share code, notes, and snippets.

View frezbo's full-sized avatar
🏠
Working from home

Noel Georgi frezbo

🏠
Working from home
View GitHub Profile
def set_job_properties() {
properties([
[
$class: 'BuildDiscarderProperty',
strategy: [
$class: 'BuildRotator',
daysToKeep: 5,
numToKeep: 10,
artifactsDaysToKeep: 5,
artifactsNumToKeep: 10
@frezbo
frezbo / ghprb_auth.groovy
Created June 6, 2017 16:30 — forked from kpettijohn/ghprb_auth.groovy
Configure GitHub Pull Request Builder Jenkins plugin with Groovy
// ghprb 1.29.2
import java.lang.reflect.Field
import jenkins.model.*
import org.jenkinsci.plugins.ghprb.*
def descriptor = Jenkins.instance.getDescriptorByType(org.jenkinsci.plugins.ghprb.GhprbTrigger.DescriptorImpl.class)
Field auth = descriptor.class.getDeclaredField("githubAuth")
auth.setAccessible(true)
stage('Download template') {
echo "\u001B[34m\u001B[1mDownloading template\u001B[0m"
script {
withCredentials([string(credentialsId: "${gitCredentialId}", variable: 'gitToken')]) {
sh '''
#!/bin/bash
set -e
curl -s -X GET -H "Authorization: token '''+gitToken+'''" \
-H "Accept: application/vnd.github.v3.raw" \
'''+gitDownloadURL+''' -o '''+docxTemplate+'''
import static groovy.io.FileType.DIRECTORIES
@NonCPS
def traverseHelper() {
final excludeDirs = ['.git']
def dirs = [];
new File("${WORKSPACE}").eachDir() { dir ->
if (dir.name in excludeDirs) return true else dirs.add(dir)
}
return dirs
}
#!/bin/bash
for d in /sys/kernel/iommu_groups/*/devices/*; do
n=${d#*/iommu_groups/*}; n=${n%%/*}
printf 'IOMMU Group %s ' "$n"
lspci -nns "${d##*/}"
done
#!/usr/bin/env groovy
pipeline {
agent {
node {
label 'master'
}
}
environment {
sshKey = UUID.randomUUID().toString()
sshId = "${sshKey}"
@frezbo
frezbo / gist:2228c3ea3f7b68f51209a5a8559eb6f4
Created November 22, 2017 15:57 — forked from nemonik/gist:951a0e55436e0708222b
A Python script to extract data out of DISA STIG Viewer xccdf file to a CSV
###
# A Python script to extract data out of a DISA STIG Viewer xccdf file to a CSV
# @author Michael Joseph Walsh <github.com@nemonik.com>
##
import csv
import glob
import os
import sys
import xml.etree.ElementTree as ET
# http://inspec.io/docs/reference/resources/file/
describe file('rebooted') do
its('content') { should match 'success' }
end
On Fri, Jun 26, 2015 at 10:18:27AM -0700, Alexander Morozov wrote:
There is no network section in spec now. We probably should have some.
For what it's worth, you can currently (48182db, 2015-07-07) just
use the host's network configuration with the following changes to the
stock config:
Add to mounts:
{
# will be further used by umoci to create an OCI complaint image
FROM debian:stable-slim AS rootfs
ARG WORKDIR=/opt/data
RUN apt-get update && \
apt-get install --no-install-recommends -y ansible python-pip curl
# downloading and verifying umoci
FROM alpine:3.7 AS umoci
ARG UMOCI_URL=https://github.com/openSUSE/umoci/releases/download/v0.3.1/umoci.amd64
ARG UMOCI_ASC=https://github.com/openSUSE/umoci/releases/download/v0.3.1/umoci.amd64.asc