This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#delete versions from a bucket, this will work with Scaleway | |
bucket=$1 | |
location=$2 | |
endpoint=".scw.cloud" | |
set -e | |
set -x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Resources | |
| where type in ('microsoft.sql/servers', 'microsoft.dbformysql/servers', 'microsoft.dbforpostgresql/servers', 'microsoft.documentdb/databaseaccounts', 'microsoft.cache/redis', 'microsoft.web/sites', 'microsoft.compute/virtualmachines', 'microsoft.containerinstance/containergroups' ) | |
| extend resourceType = case( | |
type == 'microsoft.compute/virtualmachines', 'Virtual Machines', | |
type == 'microsoft.containerinstance/containergroups', 'Containers', | |
type in ('microsoft.sql/servers', 'microsoft.dbformysql/servers', 'microsoft.dbforpostgresql/servers', 'microsoft.documentdb/databaseaccounts', | |
'microsoft.cache/redis', 'microsoft.web/sites', 'Unknown' ), 'PaaS', | |
'Unknown' | |
) | |
| summarize count() by resourceType |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ConfigurationData | |
| where ConfigDataType == "Software" | |
| where SoftwareName contains "Java" or SoftwareName contains "Oracle" | |
| summarize SoftwareInstalled = strcat(iif(countif(SoftwareName contains "Java") > 0, "Java, ", ""), iif(countif(SoftwareName contains "Oracle") > 0, "Oracle", "")) by Computer | |
| order by SoftwareInstalled desc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Prune all unattached volumes | |
linode-cli volumes list --json | jq -r '.[] | select(.linode_id == null) | .id' | xargs -I {} linode-cli volumes delete {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
################################################################################################ | |
# Usage # | |
################################################################################################ | |
# Ensure a tag is created in the form: "tld: yourdomain.com" and applied to the Linode | |
# Add this to /usr/bin/local/acc-set-hostname.sh | |
# Call this file during the cloud-init <runcmd> block | |
################################################################################################ | |
METADATA_TOKEN="$(curl -s -X PUT -H 'Metadata-Token-Expiry-Seconds: 3600' 'http://169.254.169.254/v1/token')" | |
METADATA_URL="http://169.254.169.254/v1/instance" |