Skip to content

Tag: Scripts

Azure resource tagging using PowerShell

Azure resource tagging is a great way to label or group your Azure resources based on custom names and values. For example you could have a tag named “owner” for specifying the resource owner or “patchphase” for noting what phase to patch the OS or application running on a virtual machine. The issue with Azure resource tagging is the management of the tags when you have more than a handful of resources, so pretty much…

Leave a Comment

Using jq in Bash to manage JSON content

No doubt you already use Bash for a wide range of tasks, consequently are already aware it’s purely a procedural scripting language and not object oriented? For the majority of tasks this is fine, however there are times when objects are useful; enter jq, a lightweight and flexible command-line JSON processor. This post explains how to use jq to convert data into JSON and therefore an object. Say you have a file in /root/ with…

Leave a Comment

Create a PowerShell Object from contents of a file

No doubt you already use PowerShell for a wide range of tasks and consequently are already familiar working with PowerShell objects? This post explains how to turn the contents of a file into a PowerShell object. You can then use this object for whatever you need. Say you have a file in C:\data\ with the content: hostname=file-server-1 os=Windows 2012R2 location=Digbeth city=Birmingham installed=01-06-2015 active=yes Now you create a PowerShell function that will take the above content…

Leave a Comment

SSH User and Key Management

Managing users and more importantly SSH keys across numerous Linux systems can be the bane of any sysadmin’s life. There are tools out there which make this easier, however some don’t work very well, some are complicated and others are costly. All of them tend to require additional software installing and being configured. Essentially there is a simple solution, have the user’s SSH public keys stored in a remote location and have a script which…

Leave a Comment