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 | |
# Location | |
location=acc | |
# Start size in MB | |
start_size=100 | |
# End size in GB - Note: Bash does not support floating point arithmetic, so we'll work with MB | |
end_size=$((100 * 1024)) # 100GB in MB | |
# Increment size in MB | |
increment=1024 # 1GB increment |
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 # | |
################################################################################################ | |
# Add this to /etc/profile.d/autologout-tty.sh | |
################################################################################################ | |
# Auto-logout for tty sessions after a period of inactivity | |
if [[ "$(tty)" =~ /dev/tty[0-9]+ ]] || [[ "$(tty)" =~ /dev/ttyS[0-9]+ ]]; then | |
# Set TMOUT to 600 seconds (10 minutes) for tty and ttyS sessions | |
export TMOUT=600 |
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" |
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
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
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
# 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
# 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
#!/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
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 |
NewerOlder