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 | |
# Login to Az Cli | |
#az login | |
# Find all subscriptions: | |
for subs in $(az account list -o tsv | awk '{print $3}'); do | |
# Find current logged in username | |
username=$(az account show --query user.name --output tsv) | |
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 | |
######################################################################################################### | |
# Description: Update walinuxagent from repository or, if latest version not available, from github # | |
# Author: Marin Nedea # | |
# Created: Sep 14th, 2020 # | |
# Usage: Just run the script with sh (e.g. sh script.sh) # | |
# Requires: AzCli 2.0 installed on the machine you're running this script on # | |
# https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest # | |
# If enabled, you can run it through the bash Cloud Shell in your Azure Portal page. # | |
# WARNING: Tested only with CentOS/RHEL 7+, SLES 12+, Oracle 7+, Debian 9+, Ubuntu 16.04 +. # |
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 | |
######################################################################################################### | |
# Title: Find Windows Azure Agent version on all VMs in all subscriptions # | |
# Author: Marin Nedea # | |
# Created: June 24th, 2020 # | |
# Usage: Just run the script with sh (e.g. sh script.sh) # | |
# Requires: AzCli 2.0 installed on the machine you're running this script on # | |
# https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest # | |
# If enabled, you can run it through the bash Cloud Shell in your Azure Portal page. # |
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 | |
####### Check if root is running this script, and bail if not root | |
# be root or exit | |
if [ "$EUID" -ne 0 ] | |
then echo "Please run as root" | |
exit | |
fi | |
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
#!/usr/bin/env bash | |
# THIS IS A SAMPLE FILE! | |
# USE ACTUAL DATA WHEN DEPLOYING IT! | |
# AzCli 2.0 command: | |
# az vmss extension set \ | |
# --publisher Microsoft.Azure.Extensions \ | |
# --version 2.0 \ | |
# --name CustomScript \ | |
# --resource-group myResourceGroup \ | |
# --vmss-name myScaleSet \ |
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
# !/usr/bin/env bash | |
# Setting the logfile location | |
logfile=/var/log/mount_enc_disk.log | |
# Logging all actions | |
exec 3>&1 4>&2 | |
trap 'exec 2>&4 1>&3' 0 1 2 3 | |
exec 1>$logfile 2>&1 |
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
# !/usr/bin/env bash | |
# Setting the logfile location | |
logfile=/var/log/mount_disks.log | |
# Logging all actions | |
exec 3>&1 4>&2 | |
trap 'exec 2>&4 1>&3' 0 1 2 3 | |
exec 1>$logfile 2>&1 |
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 | |
################################################################################# | |
# Script to partition automatically new disks added to a linux machine. # | |
# The script will create a single partition on the whole free space of the disk # | |
################################################################################# | |
# Setting the logfile location | |
logfile=/var/log/disk_part.log |
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 | |
# The MIT License (MIT) | |
# | |
# Copyright (c) 2015 Microsoft Azure | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
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
#!/usr/bin/env bash | |
# This script is provided as it is and | |
# there's no guarantee that this will | |
# work for you. | |
# Please adapt it to your needs! | |
# Get the variables | |
read -p 'Resource Group: ' my_resource_group | |
read -p 'VM Name:' vmname |
NewerOlder