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 | |
#get the running waagent PID | |
waagentpid=$(ps axf | grep waagent | grep -v grep | awk '{print $1}') | |
#all waagent.pid files in /var/run/ directory | |
dir=/var/run/*waagent.pid | |
#for each file in $dir | |
for f in $dir |
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/kill_output.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 | |
# 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 |
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
#!/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
# !/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
# !/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 | |
# 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
#!/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
#!/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. # |
OlderNewer