Skip to content

Instantly share code, notes, and snippets.

View andrewkroh's full-sized avatar

Andrew Kroh andrewkroh

View GitHub Profile
@andrewkroh
andrewkroh / gist:10213678
Created April 9, 2014 00:38
Create xterm from Jenkins "Script Console"
// Send xterm to machine from Jenkins:
def myip='192.168.0.2'
def proc = "xterm".execute(["DISPLAY=${myip}:0.0"], new File('/home/jenkins'))
proc.waitFor()
println "return code: ${proc.exitValue()}"
println "stderr: ${proc.err.text}"
println "stdout: ${proc.in.text}"
@andrewkroh
andrewkroh / gist:10339105
Last active August 29, 2015 13:58
How can we regularly update the system without internet connection?
https://access.redhat.com/site/solutions/29269
# register the system that is connected to RHN, directly or using a http proxy:
rhn_register --nox --proxy=1.2.3.4
# or use
subscription-manager register --user --password --auto-allow ?
# sync updates from channels
reposync -p /somedir --repoid=rhel-x86_64-server-5 -l
Cisco Adaptive Security Appliance Software Version 9.1(1)4
Device Manager Version 7.1(2)
Compiled on Wed 13-Mar-13 07:45 by builders
System image file is "disk0:/asa911-4-k8.bin"
Config file at boot was "startup-config"
asa5505 up 23 hours 25 mins
Hardware: ASA5505, 512 MB RAM, CPU Geode 500 MHz,
@andrewkroh
andrewkroh / gist:d5d8acb420fbf54babfc
Created October 2, 2014 17:42
Using local puppet filebucket
puppet filebucket --bucket /var/lib/puppet/clientbucket -l get b52b12f6059f118d2db377b92e8458eb
@andrewkroh
andrewkroh / jar-verify-openssl.sh
Created September 8, 2015 18:55
Jar Verification with OpenSSL
# Print attributes inside of DSA/RSA file:
openssl cms -in ORG.RSA -inform DER -noout -cmsout -print
# Verify the signature:
openssl smime -verify -inform DER -in ORG.RSA -content ORG.SF -noverify
# Print signing chain:
openssl pkcs7 -text -in ORG.RSA -inform DER -print_certs -noout
@andrewkroh
andrewkroh / solaris_multicast.sh
Last active December 29, 2015 05:09
Adding a multicast route on Solaris 11
# 172.16.1.2 is the address assigned to interface that should
# route/broadcast the packets.
sudo /usr/sbin/route -n add -interface 224.0/4 -gateway 172.16.1.2
@andrewkroh
andrewkroh / gist:7629198
Created November 24, 2013 16:42
Debugging IGMP on Cisco 3750
sw01#show ip mroute
IP Multicast Routing Table
Flags: D - Dense, S - Sparse, B - Bidir Group, s - SSM Group, C - Connected,
L - Local, P - Pruned, R - RP-bit set, F - Register flag,
T - SPT-bit set, J - Join SPT, M - MSDP created entry,
X - Proxy Join Timer Running, A - Candidate for MSDP Advertisement,
U - URD, I - Received Source Specific Host Report,
Z - Multicast Tunnel, z - MDT-data group sender,
Y - Joined MDT-data group, y - Sending to MDT-data group
V - RD & Vector, v - Vector
@andrewkroh
andrewkroh / Vagrantfile
Last active April 15, 2016 19:34
Beats Vagrant Files
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Version of go to download from ports. http://ports.su/lang/go,-main
go_version = '1.5.3'
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
# Source: https://atlas.hashicorp.com/kaorimatz/boxes/openbsd-5.9-amd64/versions/20160402.0.0
@andrewkroh
andrewkroh / fstab.pp
Created August 9, 2014 16:55
Configuring /etc/fstab with Puppet Augeas
augeas{ '/etc/fstab - nosuid on /sys':
context => "/files/etc/fstab",
changes => [
"ins opt after /files/etc/fstab/*[file = '/sys']/opt[last()]",
"set *[file = '/sys']/opt[last()] nosuid",
],
onlyif => "match *[file = '/sys']/opt[. = 'nosuid'] size == 0",
}
augeas{ '/etc/fstab - acl on /sys':
@andrewkroh
andrewkroh / elasticsearch.groovy
Created March 23, 2017 16:02
Elasticsearch Output for SmartThings Events
/**
* Elasticsearch Event Publisher
*
* Copyright 2017 Andrew Kroh
*/
import java.text.DateFormat;
import java.text.SimpleDateFormat;
definition(