Skip to content

Instantly share code, notes, and snippets.

View kmf's full-sized avatar
🍇
Grape expectations

Karl Fischer kmf

🍇
Grape expectations
View GitHub Profile
Verifying my Blockstack ID is secured with the address 13zWJbNRNrkPfRUkrpEhm6tZFRwAPKShez https://explorer.blockstack.org/address/13zWJbNRNrkPfRUkrpEhm6tZFRwAPKShez
@kmf
kmf / processes.rb
Created June 20, 2018 19:23
How I would like to see processes in OHAI
# Encoding: utf-8
Ohai.plugin(:Processes) do
provides 'processes'
collect_data(:linux) do
processes Mash.new
so = shell_out('ps -axco command,pid,euser')
so.stdout.lines do |line|
[2019-05-16T20:18:38+00:00] DEBUG: Reading products and relationships...
[2019-05-16T20:18:38+00:00] DEBUG: Successfully read products and relationships
[2019-05-16T20:18:38+00:00] DEBUG: Searching for the following licenses: ["infra-client", "inspec"]
[2019-05-16T20:18:38+00:00] DEBUG: Found license chef_infra_client at /etc/chef/accepted_licenses/chef_infra_client
[2019-05-16T20:18:38+00:00] DEBUG: Found license inspec at /etc/chef/accepted_licenses/inspec
[2019-05-16T20:18:38+00:00] DEBUG: Missing licenses remaining: []
[2019-05-16T20:18:38+00:00] DEBUG: All licenses present
[2019-05-16T20:18:38+00:00] DEBUG: Running Ohai with the following configuration: {:logger=>Chef::Log}
Starting Chef Infra Client, version 15.0.293
[2019-05-16T20:18:38+00:00] INFO: *** Chef Infra Client 15.0.293 ***
@kmf
kmf / .vimrc
Created April 24, 2020 14:55
.vimrc
set nocompatible " be iMproved, required
filetype off " required
syntax on
set background=dark
set encoding=UTF-8
let mapleader = "\<Space>"
set number relativenumber
set guifont=MesloLGSNerdFontComplete-Regular:h18
set path+=**
@kmf
kmf / .kitchen.yml
Created August 1, 2020 07:02 — forked from grv87/.kitchen.yml
Test Kitchen - use SSH transport for Windows
driver:
name: ec2
image_search:
name: Windows_Server-2016-English-Full-Base-*
region: eu-west-1
subnet_id: subnet-3615b351
instance_type: t2.micro
aws_ssh_key_id: kitchen
security_group_ids:
- sg-496eaa31
@kmf
kmf / convertjsoncsv.rb
Created October 21, 2020 10:15 — forked from jordan-thoms/convertjsoncsv.rb
Code to convert json to csv, with correct headings Usage: ruby convertjsoncsv.rb <input file> <output file>
require 'csv'
require 'json'
require "set"
json = JSON.parse(File.open(ARGV[0]).read)["results"]
# Pass 1: Collect headings
headings = SortedSet.new
json.each do |hash|
headings.merge(hash.keys)
end
@kmf
kmf / private.xml
Created October 30, 2020 15:48 — forked from localghost666/private.xml
Karabiner setting file for Logitech K360 & M545
<?xml version="1.0"?>
<root>
<!-- Logitech K360 Keyboard -->
<item>
<name>Logitech K360 Keyboard for Mac OS X</name>
<devicevendordef>
<vendorname>LOGITECH</vendorname>
<vendorid>0x046d</vendorid>
</devicevendordef>
<deviceproductdef>
Get-WindowsCapability -Online | ? Name -like 'OpenSSH*'
Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
Start-Service sshd
Set-Service -Name sshd -StartupType 'Automatic'
Get-NetFirewallRule -Name *ssh*
New-NetFirewallRule -Name sshd -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22
@kmf
kmf / api-curl.sh
Created February 23, 2021 07:55 — forked from paulmooring/api-curl.sh
curl request script for Chef servers
#!/usr/bin/env bash
# Author:: Paul Mooring (<paul@opscode.com>)
# Author:: Steven Danna (<steve@opscode.com>)
# Copyright:: Copyright (c) 2013 Opscode, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
{
"__inputs": [
{
"name": "DS_INFLUXDB",
"label": "InfluxDB",
"description": "",
"type": "datasource",
"pluginId": "influxdb",
"pluginName": "InfluxDB"
}