Skip to content

Instantly share code, notes, and snippets.

View jeremymv2's full-sized avatar
🪂

Jeremy J. Miller jeremymv2

🪂
View GitHub Profile
@jeremymv2
jeremymv2 / cluster-admin-rolebinding.yaml
Created November 21, 2022 13:35
Make group cluster admins
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: qadev-team-cluster-admin
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
@jeremymv2
jeremymv2 / usage.md
Last active August 31, 2022 14:11
saml2pf9 usage

How to use the saml2pf9 CLI

Extract

$ tar xvfz saml2pf9_0.2.1_Linux_x86_64.tar.gz

Install

$ sudo install ./saml2pf9 /usr/local/bin

Keybase proof

I hereby claim:

  • I am jeremymv2 on github.
  • I am jeremymv2 (https://keybase.io/jeremymv2) on keybase.
  • I have a public key ASAIkE2h5mpRV69XoYoCuAkRziqwwhiRi8qEoQoHY9_9MAo

To claim this, I am signing this object:

@jeremymv2
jeremymv2 / migration.sh
Last active April 2, 2020 11:49
knife-ec-backup examples
#!/bin/bash
set -e
# Customize all these values
# youre source/destination keys and
# configs will differ
BACKUPDIR="backups"
BACKUPLOG="./migration_backup.log"
RESTORELOG="./migration_restore.log"
@jeremymv2
jeremymv2 / parallel-restorev2.rb
Last active August 21, 2019 17:55
Parrallel (backgrounded) knife ec restores with 1 thread per org
#!/usr/bin/env ruby
# Use this script if you have 3 or more Chef Organizations
# and wish to speed up restores by using parallelism.
require 'fileutils'
require 'optparse'
CONCURRENCY = 1
BACKUP_LOG = "restore_#{Time.now.strftime('%m%d%Y%H%M')}.log".freeze
@jeremymv2
jeremymv2 / client.rb
Last active July 24, 2018 19:34
supermarket-custom-credentials
# this is the secret used for encrypting/decryting encrypted databags
# https://docs.chef.io/data_bags.html#encrypt-a-data-bag-item
# defaults to /etc/chef/encrypted_data_bag_secret
encrypted_data_bag_secret '/path/to/file/with/secret'
@jeremymv2
jeremymv2 / gist:0acb98ab747fef3c04f4fe0522b3ce8a
Last active July 19, 2018 17:34
Running chef-zero on a chef-repo for canary testing

chef-zero

sudo -E /opt/chef/bin/chef-client --local-mode --config /tmp/client.rb --log_level auto --force-formatter --no-color --json-attributes /tmp/dna.json --chef-zero-port 8889

/tmp/client.rb

node_name "default-ubuntu-1604"
checksum_path "/tmp/checksums"
file_cache_path "/tmp/cache"
@jeremymv2
jeremymv2 / gist:0013ec21d3fb0ab3ae33714c59e16425
Created June 4, 2018 16:20
elasticsearch system settings
/etc/security/limits.conf
elasticsearch - nofile 65535
elasticsearch - memlock unlimited
root - memlock unlimited
@jeremymv2
jeremymv2 / parallel-restore.rb
Last active March 30, 2018 04:55
Spread ec-restore across Front Ends
#!/usr/bin/env ruby
require 'fileutils'
require 'optparse'
ARGV << '-h' if ARGV.length != 6
$options = {}
OptionParser.new do |opts|
@jeremymv2
jeremymv2 / gist:cb34e6dfcad040b1cad50636d256b44e
Last active October 30, 2017 13:28
inspec cli Automate
Inspec Profile storage in Automate requires Automate >= 0.6.6, inspec >= 1.7.0
# login via inspec cli with data collector token
inspec compliance login_automate https://automate-server.test --insecure true --user admin --dctoken 93a49a4f2482c64126f7b6015e6b0f30284287ee4054ff8807fb63d9cbd1c506 --ent brewinc
# get user token
delivery token -u jmiller -s automate-server.test -e brewinc
# login with user token
inspec compliance login_automate https://automate-server.test --insecure true --user jmiller --usertoken tzwlbWMtgBC0lo6sxkAYKSShxSJEohnU7IAE4NCUGCg= --ent brewinc