Skip to content

Instantly share code, notes, and snippets.

View marinnedea's full-sized avatar
:atom:
3rd rock from the Sun, Sol system

Marin N. marinnedea

:atom:
3rd rock from the Sun, Sol system
View GitHub Profile
@marinnedea
marinnedea / rhel_invoke.sh
Last active December 16, 2020 17:23
Run run-invoke command on all RHEL VMs in all subscriptions
#!/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)
#!/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 +. #
#!/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. #
#!/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
#!/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 \
# !/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
# !/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
#!/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
#!/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
@marinnedea
marinnedea / linux_coomand_invoke_sample_script.sh
Last active May 8, 2018 10:43
Interactiv Deployment Linux VM script that, post deployment, will run a custom script from your local Linux box on the newly deployed VM.
#!/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