Skip to content

Instantly share code, notes, and snippets.

View dollarpo7's full-sized avatar

Okunsanmi Adedolapo dollarpo7

  • Lagos, Nigeria
View GitHub Profile
@dollarpo7
dollarpo7 / openssl_commands.md
Created October 20, 2022 14:01 — forked from Hakky54/openssl_commands.md
Some list of openssl commands for check and verify your keys

openssl ๐Ÿ”

Install

Install the OpenSSL on Debian based systems

sudo apt-get install openssl
@dollarpo7
dollarpo7 / create-storage.sh
Created April 6, 2022 01:12
Create a Storage Account in Azure
#!/bin/bash
#Create RG for storing State Files
az group create --location westus2 --name dolazrg-terraformstate
#Create Storage Account
az storage account create --name dolazstorage2188 --resource-group dolazrg-terraformstate --location westus2 --sku Standard_LRS
#Create Storage Container
az storage container create --name dolazterraformdemo --account-name dolazstorage2188
@dollarpo7
dollarpo7 / gist:2a8bb566424cf6ab82b1ab79f2cefa8a
Created October 4, 2021 00:31
Docker installation on Ubuntu 18.04
sudo apt-get update
sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get install -y docker-ce
@dollarpo7
dollarpo7 / SP.cli
Created August 20, 2020 03:20
Create Service Principal for Resource Group
az ad sp create-for-rbac --name dolazApp --role contributor --scopes "/subscriptions/3a5ea0a9-8105-4dce-9d6e-d52d517cee2f/resourceGroups/cloudskills" --sdk-auth
@dollarpo7
dollarpo7 / aks.sh
Last active July 30, 2020 02:04
Create an AKS using CLI
#!/bin/bash
az group create --name dolaz-aks-prod-rg --location westus2
az aks create \
--resource-group dolaz-aks-prod-rg \
--name cs-prod \
--node-count 1 \
--generate-ssh-keys
@dollarpo7
dollarpo7 / stopVM.ps1
Created June 24, 2020 10:53
Stop a VM using a Webhook
param
(
[Parameter (Mandatory = $false)]
[object] $WebhookData
)
#Get service principal details from shared resources
$cred = Get-AutomationPSCredential -Name 'SPCreds'
$tenantId = Get-AutomationVariable -Name 'TenantId'
@dollarpo7
dollarpo7 / snapshot2.ps1
Created June 24, 2020 09:30
DiskSnapshot2
#Get service principal details from shared resources
$cred = Get-AutomationPSCredential -Name 'SPCreds'
$tenantId = Get-AutomationVariable -Name 'TenantId'
#Auth with service principal
Connect-AzAccount -ServicePrincipal -Credential $cred -Tenant $tenantId
#Get all Windows VMs in the Subscription
$vms = Get-AzVM | Where-Object {$_.StorageProfile.OsDisk.OsType -eq 'Windows'}
@dollarpo7
dollarpo7 / snaphot.ps1
Created June 24, 2020 09:25
DiskSnapshot
#Get service principal details from shared resources
$cred = Get-AutomationPSCredential -Name 'SPCreds'
$tenantId = Get-AutomationVariable -Name 'TenantId'
#Auth with service principal
Connect-AzAccount -ServicePrincipal -Credential $cred -Tenant $tenantId
#Get all Windows VMs in the WebServers resource group
$vms = Get-AzVM -ResourceGroupName webservers |
Where-Object {$_.StorageProfile.OsDisk.OsType -eq 'Windows'}
@dollarpo7
dollarpo7 / utils.ps1
Created June 24, 2020 08:19
PS Function that creates an Azure Service Principal
function New-Sp {
param($Name, $Password)
$spParams = @{
StartDate = Get-Date
EndDate = Get-Date -Year 2030
Password = $Password
}
$cred= New-Object Microsoft.Azure.Commands.ActiveDirectory.PSADPasswordCredential -Property $spParams