Skip to content

Instantly share code, notes, and snippets.

@johnybradshaw
johnybradshaw / wiz-gcp-discovery.sql
Created March 22, 2023 16:37
Google Asset Query (https://console.cloud.google.com/iam-admin/asset-inventory/query) to extract all components for licensing in Wiz
# Google Asset Query (https://console.cloud.google.com/iam-admin/asset-inventory/query)
# This extracts all components for licensing in Wiz
SELECT
assetType,
COUNT(*) AS cnt
FROM
STANDARD_METADATA
WHERE
assetType IN
('compute.googleapis.com/Instance',
@johnybradshaw
johnybradshaw / wiz-azure-discovery.kql
Created March 21, 2023 12:26
Run this KQL in the Azure Resource Explorer to quickly out put all of the resources in a given tenant that would carry a cost as part of the Wiz platform
# KQL query to output the resource counts for Wiz to price against
Resources
| where type in (
"microsoft.compute/virtualmachines",
"microsoft.containerservice/managedclusters",
"microsoft.web/sites",
"microsoft.storage/storageaccounts",
"microsoft.classicstorage/storageaccounts",
"microsoft.dbformysql/servers",
"microsoft.dbformysql/flexibleservers")
@johnybradshaw
johnybradshaw / delete_all_object_versions.sh
Last active March 4, 2022 09:23 — forked from weavenet/delete_all_object_versions.sh
Delete all versions of all files in s3 versioned bucket using AWS CLI and jq.
#!/bin/bash
#delete versions from a bucket, this will work with Scaleway
bucket=$1
location=$2
endpoint=".scw.cloud"
set -e
set -x
apiVersion: v1
baseDomain: skytap.ninja #Change this to match your domain
compute:
- hyperthreading: Enabled
name: worker
replicas: 0
controlPlane:
hyperthreading: Enabled
name: master
replicas: 3
@johnybradshaw
johnybradshaw / AzureLogCreator.py
Created December 27, 2019 13:52
Simple python script to create a log source configured to work with Skytap audit logs (courtesy Ken Reycraft)
import json
import requests
import datetime
import hashlib
import hmac
import base64
# Update the customer ID to your Log Analytics workspace ID
customer_id = 'XXXXXXXXXXXXXXXXXX'
@johnybradshaw
johnybradshaw / SkytapLogCollectorOnAzure.json
Created December 27, 2019 13:50
An Azure Log Analytics data collector function app
{
"definition": {
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"actions": {
"For_each": {
"actions": {
"Send_Data": {
"inputs": {
"body": "@{items('For_each')}",
"headers": {
provider "skytap" {
username = "username"
api_token = ""
}
# Create a new environment
resource "skytap_environment" "two_lpar" {
template_id = "1498907"
name = "Two Node LPAR environment"
description = "Two deployed AIX LPARs with an iSCSI network"

Keybase proof

I hereby claim:

  • I am johnybradshaw on github.
  • I am johnybradshaw (https://keybase.io/johnybradshaw) on keybase.
  • I have a public key ASCTwQLHtu-eKfSoQSblIvKyoDvsMuQenCi42pJB_lvaNQo

To claim this, I am signing this object:

@johnybradshaw
johnybradshaw / ocp_builder.sh
Last active December 27, 2019 20:29
OpenShift Cluster Platform 4 - 3 master nodes, 3 worker nodes, network building script to be run on the Networking host
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root"
exit 1
fi
#############################
#
# OCP4 on Skytap Builder
#
#############################
@johnybradshaw
johnybradshaw / main.tf
Created February 4, 2019 21:42
Building two AIX 7.2 LPARs in Skytap using Terraform
provider "skytap" {
username = "${var.skytap_username}"
api_token = "${var.skytap_api_token}"
}
# Create a new environment
resource "skytap_environment" "two_lpar" {
template_id = "1498907"
name = "Two Node LPAR environment"
description = "Two deployed AIX LPARs with an iSCSI network"