Skip to content

Instantly share code, notes, and snippets.

View chris-rock's full-sized avatar

Christoph Hartmann chris-rock

View GitHub Profile
@chris-rock
chris-rock / gist:74c9415ef60bcd8aeae3483026cd27c0
Created December 12, 2016 15:20
Apache Serverspec verification
KITCHEN_YAML=.kitchen.docker.yml b kitchen verify default-centos-72
Expected array default value for '--driver'; got "kitchen-vagrant" (string)
-----> Starting Kitchen (v1.13.2)
-----> Setting up <default-centos-72>...
Finished setting up <default-centos-72> (0m0.00s).
-----> Verifying <default-centos-72>...
Preparing files for transfer
-----> Installing Busser (busser)
Fetching: thor-0.19.0.gem (100%)
Successfully installed thor-0.19.0
# encoding: utf-8
# -*- mode: ruby -*-
# vi: set ft=ruby :
# make chef-server known by hostname
CHEF_AUTOMATE_SCRIPT = <<EOF.freeze
# update system
apt-get update
apt-get -y install curl
@chris-rock
chris-rock / gist:fcdae97e664b48ad0c8a55e040ddfb68
Last active September 25, 2016 21:09
Windows ADSI Groups
# inspired by https://social.technet.microsoft.com/Forums/windowsserver/en-US/b8973045-3412-4aea-b156-c33c9b8ce44b/adsi-local-groups-users-users-type-etc-?forum=winserverpowershell
# https://msdn.microsoft.com/en-us/library/aa706032(v=vs.85).aspx
Function ConvertTo-SID { Param([byte[]]$BinarySID)
(New-Object System.Security.Principal.SecurityIdentifier($BinarySID,0)).Value
}
$Computername = $Env:Computername
$adsi = [ADSI]"WinNT://$Computername"
$groups = $adsi.Children | where {$_.SchemaClassName -eq 'group'} | ForEach {
$name = $_.Name[0]
@chris-rock
chris-rock / gist:a30592b0b82d13136772c10162dc5752
Created August 9, 2016 17:07
bundle exec bin/inspec env zsh
function _inspec() {
local curcontext="$curcontext" state line
typeset -A opt_args
local -a _top_level_commands _msccm_commands _scap_commands _secrets_chef_vault_commands _compliance_commands _init_commands _supermarket_commands
_top_level_commands=(
'help:Describe available commands or one specific command'
'json:read all tests in PATH and generate a JSON summary'
'check:verify all tests at the specified PATH'
webpack --watch --progress --display-error-details
<?xml version="1.0" encoding="utf-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:oval-def="http://oval.mitre.org/XMLSchema/oval-definitions-5" xmlns:oval="http://oval.mitre.org/XMLSchema/oval-common-5" xmlns:unix-def="http://oval.mitre.org/XMLSchema/oval-definitions-5#unix" xmlns:x-ihdo="http://oval.mitre.org/XMLSchema/x-unix-invalidhomedirownership" xmlns:sch="http://purl.oclc.org/dsdl/schematron" targetNamespace="http://oval.mitre.org/XMLSchema/x-unix-invalidhomedirownership" elementFormDefault="qualified" version="5.11">
<xsd:import namespace="http://oval.mitre.org/XMLSchema/oval-definitions-5" schemaLocation="oval-definitions-schema.xsd"/>
<xsd:annotation>
<xsd:documentation>The following is a description of the elements, types, and attributes that compose generic UNIX tests found in Open Vulnerability and Assessment Language (OVAL). Each test is an extension of the standard test element defined in the Core Definition Schema. Through extension, each test inherits a set
@chris-rock
chris-rock / gist:6b7648c692fb3c758646
Created February 8, 2016 13:50
bundler does not consider ruby version
Worker information
hostname: travis-worker-gce-org-prod-11:fd10c29f-77b4-4c71-a0a6-dc7a73ae96fb
version: v2.1.0-44-ge7ef5db https://github.com/travis-ci/worker/tree/e7ef5db4f469f8e76792dee8309e601b6e53e56b
instance: testing-gce-3480b3ea-cb86-4576-b927-c9754154ef5b:travis-ci-mega-trusty-1445287562
startup: 21.863668428s
Build system information
Build language: ruby
Build group: stable
Build dist: trusty
Build image provisioning date and time
$chef_omnibus_root = "$env:systemdrive\opscode\chef"
$msi = "$env:TEMP\chef-12.6.0.msi"
$chef_metadata_url = "https://www.chef.io/chef/metadata?p=windows&m=x86_64&pv=2008r2&v=12.6.0"
$pretty_version = "12.6.0"
$version = "12.6.0"
Function Check-UpdateChef($root, $version) {
if (-Not (Test-Path $root)) { return $true }
elseif ("$version" -eq "true") { return $false }
@chris-rock
chris-rock / gist:23d6a120d07c553ffdc7
Last active December 28, 2015 13:47
Inspec AIX 6.1
"You are currently running on OS family: aix, OS release: 6.1"
...........F....................F......F.....F...........................................FFFF....F.F.......F.
Failures:
1) Csv /tmp/example.csv name should eq ["addressable", "ast", "astrolabe", "berkshelf"]
Failure/Error: rspec_runner.run_specs(@tests.ordered_example_groups)
expected: ["addressable", "ast", "astrolabe", "berkshelf"]
got: ["addressable", "ast", "astrolabe", "berkshelf", nil]
"You are currently running on OS family: aix, OS release: 7.2"
...........F....................F......F.....F...........................................FFFF..............F.
Failures:
1) Csv /tmp/example.csv name should eq ["addressable", "ast", "astrolabe", "berkshelf"]
Failure/Error: rspec_runner.run_specs(@tests.ordered_example_groups)
expected: ["addressable", "ast", "astrolabe", "berkshelf"]
got: ["addressable", "ast", "astrolabe", "berkshelf", nil]