Skip to content

Instantly share code, notes, and snippets.

@larryebaum-nz
larryebaum-nz / extractMP4audio.sh
Last active March 28, 2022 16:14
Extract Audio from MP4 on MacOS
#locate instance of ffmpeg on workstation and set as variable if not in path
ffmpegPATH="/Applications/Descript.app/Contents/Resources/app.asar.unpacked/node_modules/beamcoder/build/Release/ffmpeg"
for i in *.MP4
do
if test -f "$i"
then
name=$(echo $i | cut -f 1 -d '.')
$ffmpegPATH -i "$i" -vn "$name.wav"
fi
## MacOS Stuff
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db

Jupyter Lab Notebooks

Setups

Install Jupyter Lab to your laptop/workstation. Brew is a OSX package manager and makes it super easy if you follow these steps. Jupyter Lab documentation describes the installation steps for non-Brew users.

Many of the Jupyter Lab notebooks contain graphic images as headers. You can easily add/change these graphics to suit your needs using the base Google document Demo Headers. To change a header, create a new slide in the deck, arrange the image as you'd like, and use a screen grab tool (or on OSX, press CMD-CTRL-OPT-4) to select the image boundaries and 'copy'. Then highlight the intended cell in your Jupyter notebook and 'paste'.

Library of Vault Demo Use Cases

| Use Case | Description / Repo Link | Author |

@larryebaum-nz
larryebaum-nz / upload-key-aws-regions
Created July 20, 2020 19:12
Upload SSH Key to AWS Regions
#!/bin/bash
## Specify as the 1st parameter the keyname to display in AWS;
## use 1st param or current user
aws_keypair_name="${1:-$USER}"
## Specify as the 2nd parameter the full path to ssh public key file name to upload to AWS;
## use 2nd param or default id_rsa.pub will be used.
publickeyfile="${2:-$HOME/.ssh/id_rsa.pub}"
keydata=$(cat $publickeyfile | base64)
regions=$(aws ec2 describe-regions \

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

chef-run chef@node1 file '/etc/motd'
content='Welcome to Chef’ --password Cod3Can!
chef-run chef@node1 motd.rb --password Cod3Can!
chef-run winrm://Administrator@winnode1
file_experiment.rb --password Cod3Can!
chef generate cookbook -P setup
chef generate template motd
kitchen converge
kitchen verify
kitchen destroy
@larryebaum-nz
larryebaum-nz / gist:e02262ba850a724bd612f3406d94e88a
Created October 3, 2017 14:44
Chef Automate Supermarket Cert Append for SSL Issue with Self Signed Cert
# on Supermarket server
sudo su -
echo "\nSelf-Signed Chef Server Cert (you should feel bad about this)\n=====================" >> /opt/supermarket/embedded/ssl/certs/cacert.pem
openssl s_client -showcerts -connect phl-du-cfbc1.devfwh.lan:443 </dev/null 2>/dev/null|openssl x509 -outform PEM >> /opt/supermarket/embedded/ssl/certs/cacert.pem
# on Chef Server
sudo su -
echo "\nSelf-Signed Supermarket Cert (you should feel bad about this)\n=====================" >> /opt/opscode/embedded/ssl/certs/cacert.pem
openssl s_client -showcerts -connect phl-du-cfsm1.devfwh.lan:443 </dev/null 2>/dev/null|openssl x509 -outform PEM >> /opt/opscode/embedded/ssl/certs/cacert.pem
@larryebaum-nz
larryebaum-nz / README.md
Last active September 26, 2017 20:55 — forked from afiune/README.md
Automate LDAP Bulking User Creation

LDAP Bulking User Creation Process

This is temporal automation to create/update multiple LDAP users in Chef Automate. If a user appears in the input file and already exists as a user, the user roles will be updated as specified within the input file. If the user does not exist, it will be created with the specified roles.

Prerequisites

The minimum prerequisites to be able to use this automation are:

@larryebaum-nz
larryebaum-nz / AuditConfig.html
Last active June 9, 2017 18:17
Audit Cookbook Configuration Cheatsheet
<!-- Sourced from http://htmlpreview.github.io/?https://github.com/jeremymv2/audit-docs/blob/master/grid.html-->
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
@larryebaum-nz
larryebaum-nz / chef_local_development_workflow.md
Created November 30, 2016 22:19 — forked from smford22/chef_local_development_workflow.md
Chef Local Development Workflow - ChefDK, Vagrant, VirtualBox, Test Kitchen

Chef Local Development Workflow with ChefDK, Vagrant, VirtualBox, and Test Kitchen

Overview

The following document is intended to be a quick guide to getting you setup for doing local development with Chef. This guide was created on my MacBook, but should work fine with Linux, and Windows workstations as well.

Quick review on fundamental tenets of Chef

  • Workstation - A workstation is a computer that is configured to run various Chef command-line tools that synchronize with a chef-repo, author cookbooks, interact with the Chef server, interact with nodes, or applications like Chef Delivery
  • Node - A node is any machine—physical, virtual, cloud, network device, etc.—that is under management by Chef.
  • Chef Server- The Chef server acts as a hub for configuration data. The Chef server stores cookbooks, the policies that are applied to nodes, and metadata that describes each registered