Skip to content

Instantly share code, notes, and snippets.

@devops-school
devops-school / Terraform-Code-Azure-Linux-provisioner.tf
Last active May 11, 2024 14:17
Terraform: Example Code for Create Azure Linux/Windows VM with file, remote-exec & local-exec provisioner
# Create a resource group if it doesn't exist
resource "azurerm_resource_group" "myterraformgroup" {
name = "myResourceGroup"
location = "eastus"
tags = {
environment = "Terraform Demo"
}
}
@salman2learn
salman2learn / secure-azure-storage-accts.sh
Last active May 2, 2023 18:54
Bash script to secure azure storage accounts including existing containers (secure by default, remove anonymous access, restrict to cidrs/ip). Runs from Azure CLI or cloudshell.
set -ex # fail on first exception
#az login
#az account show
subs="My-Subs-Name"
az account set --subscription "$subs"
rg=$1
# Or use a fixed value of rg
rg=my-rg-name
@kasuken
kasuken / 00 - A collection of free DNS Servers
Last active May 24, 2024 10:31
Set and Reset DNS Settings with PowerShell
A collection of my favorites DNS
@Ioan-Popovici
Ioan-Popovici / Install-CMClient.ps1
Last active April 3, 2024 13:31
Installs the configuration manager client using the script location as source.
<#
.SYNOPSIS
Installs the configuration manager client.
.DESCRIPTION
Installs the configuration manager client using the script location as source.
.EXAMPLE
Powershell.exe -File Install-CMClient.ps1 -ExecutionPolicy 'Bypass' -WindowStyle 'Hidden'
.INPUTS
None.
.OUTPUTS
resource "azurerm_virtual_machine_extension" "domjoin" {
name = "domjoin"
location = "${var.location}"
resource_group_name = "${var.image_resource_group}"
virtual_machine_name = "${var.prefix}"
publisher = "Microsoft.Compute"
type = "JsonADDomainExtension"
type_handler_version = "1.3"
# What the settings mean: https://docs.microsoft.com/en-us/windows/desktop/api/lmjoin/nf-lmjoin-netjoindomain
settings = <<SETTINGS
@makeittotop
makeittotop / install-apache-passenger.sh
Last active April 19, 2023 19:18
Install Puppet master and agent with Apache and Phusion Passenger web server as the webserver running puppet master
yum update
yum -y install ntpd git htop telnet tmux nc
chkconfig ntpd on
chkconfig | grep ntpd
// puppet repo - install it on master and clients/agents
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm