Skip to content

Instantly share code, notes, and snippets.

@jhg03a
jhg03a / CustomVMwareSecurebootIso.md
Created October 20, 2022 21:44
Some instructions on how to make an UEFI SecureBoot capable custom ISO with menus for Kickstart

I couldn't find instructions on the internet anywhere for how to craft a UEFI secure bootable VMware ESXi installer disk iso. I worked it out using the rEFInd OSS project. This is not perfect or optimal, but it does the job.

Inspirational Links of note

@hussfelt
hussfelt / README.md
Last active July 23, 2020 18:13
How to configure ECS EC2 instances to authenticate to JFrog Artifactory Docker Registry

How to configure ECS EC2 instances to authenticate to JFrog Artifactory Docker Registry

The JFrog documentation is lacking on how to do this in a proper way, expecting to use the normal procedures for logging into docker and not in an automated way. This gets even worse if you try and configure your task to authenticate to a private registry - which does not seem to be possible.

The solution is to adjust your user-data, preferably storing your config and key in Secrets Manager.

Putting the config into Secret Manager:

aws secretsmanager update-secret --secret-id artifactory --region us-west-1 --secret-string '{"https://companyname-repo-virtual.jfrog.io": {"auth": "AUTHKEY_FROM_SETMEUP","email": "EMAIL_FROM_SETMEUP"}}'
@mootpt
mootpt / windows_example.tf
Last active May 17, 2022 16:41
Example using rsadecrypt interpolation function with windows.
# WARNING. DO NOT USE tls_private_key resource like I have done in this example
# Doing so will result in the private key being stored in state. You do not want that
# Instead use an existing key pair and use the file interpolation function to source
# the private key from disk for use in the rsadecrypt interpolation function
resource "tls_private_key" "key" {
algorithm = "RSA"
}
resource "aws_key_pair" "key_pair" {
@jessereynolds
jessereynolds / 0-puppet-node-purging-via-api.md
Last active March 21, 2022 09:42
Puppet - Node Purging via APIs

Puppet Node Purging via API

When you're decomissioning a machine that has been managed by Puppet you may want to programatically clean up the node. There are two parts to this:

  • revoking and deleting the certificate of the node in Puppet's CA
  • deactivating the node in PuppetDB

The following should work for Puppet 4.x and Puppet DB 4.x (including Puppet Enterprise 2016.4.x, 2017.1.x, 2017.2.x).

I've used certificate based auth, and the examples are being run from the puppet master so make use of existing certificates for authentication. When run remotely the cacert, certificate and corresponding private key for authentication will need to be present.

@TomerAdmon
TomerAdmon / DownloadLastBuildArtifact.ps1
Created December 28, 2016 20:33
Download artifacts for the last successful build from TeamCIty
$FOLDER_NAME = "DownlodedFiles"
$TEAM_CITY = 'http://TC'
$BUILD_TYPE_ID = "Trunk_Ci_FastCi_Build"
$FILES_TO_DOWNLOAD = ".zip"
$folderName = (".\" + $FOLDER_NAME)
If (Test-Path $folderName){
Remove-Item $folderName
}
@jaceklaskowski
jaceklaskowski / deployment-tool-ansible-puppet-chef-salt.md
Last active January 3, 2024 22:12
Choosing a deployment tool - ansible vs puppet vs chef vs salt

Requirements

  • no upfront installation/agents on remote/slave machines - ssh should be enough
  • application components should use third-party software, e.g. HDFS, Spark's cluster, deployed separately
  • configuration templating
  • environment requires/asserts, i.e. we need a JVM in a given version before doing deployment
  • deployment process run from Jenkins

Solution

@masutaka
masutaka / Vagrantfile
Last active October 20, 2015 18:18
CI of Chef recipes using CircleCI + Vagrant + AWS + serverspec
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.define :local do |local|
local.vm.box = "ubuntu/trusty64"
local.vm.network "private_network", ip: "192.168.50.13"
@fiedl
fiedl / nas-e2fsck.sh
Created January 20, 2014 01:25
QNAP-NAS: How to check disk if cannot unmount when device is busy.
ssh admin@nas
/etc/init.d/services.sh stop
/etc/init.d/xdove.sh stop
# See if there are still files open on the disk:
lsof |grep /share/MD0_DATA
# Kill the open processes if any.
@mattpascoe
mattpascoe / dhcpparse.awk
Last active April 2, 2024 08:18
An AWK script to parse ISC dhcpd configuration files into dcm.pl output to load into OpenNetAdmin
#!/usr/bin/awk -f
#
# Author: Matt Pascoe - matt@opennetadmin.com
#
# This awk script is used to extract relavant information from a dhcpd.conf
# config file and build dcm.pl output with appropriate fields. This can be
# used to bootstrap a new database from existing site data.
# As usual, inspect the output for accuracy.
# Also you will get three types of output, subnet,pool,host. You must
# add the subnet information first, then pool, then host.
@reidmv
reidmv / filemapper.rb
Created September 17, 2012 20:26
Prefetch match composite namevar(s)
def prefetch(resources = {})
# generate hash of {provider_name => provider}
providers = instances.inject({}) do |hash, instance|
hash[instance.name] = instance
hash
end
# Identify the namevar(s) for the type
nv_properties = resource_type.properties.select(&:isnamevar?).map(&:name)
nv_params = resource_type.parameters.select do |param|