Skip to content

Instantly share code, notes, and snippets.

@subudear
subudear / Event Hubs Namespace.postman_collection.json
Last active November 21, 2022 12:53
postman collection for creating azure eventhubs
{
"info": {
"_postman_id": "05e77eff-391e-4804-8ac9-d64969d38575",
"name": "Event Hubs Namespace",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "Get Access Token For Event Hubs Namespace",
"event": [
@subudear
subudear / Azure_storage_acc_env.postman_environment.json
Created September 23, 2021 09:57
postman environment for azure storage account
{
"id": "db953e65-3c4c-4121-b413-316b75767d23",
"name": "Azure_storage_acc_env",
"values": [
{
"key": "client_id",
"value": "",
"enabled": true
},
{
@subudear
subudear / Azure Storage Account.postman_collection.json
Created September 23, 2021 09:55
postman_collection for azure storage account
{
"info": {
"_postman_id": "bfba77ea-dd5a-40a4-93f8-4a603619df84",
"name": "Azure Storage Account",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "Get Access Token",
"event": [
@subudear
subudear / push_to_AWSECR.yaml
Created September 23, 2021 01:08
Azure pipeline to push image to AWS ECR
trigger:
- master
pool:
name: Self-Hosted-Agent
variables:
- group: dev
steps:
package main
import "fmt"
import "net/http"
func index(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "<h1>Hello World</h1>")
}
@subudear
subudear / lambda.py
Last active November 21, 2022 12:54
Lambda function to update security group rules with CloudFront IPs
# Ports your application uses that need inbound permissions from the service for
# If all you're doing is HTTPS, this can be simply { 'https': 443 }
INGRESS_PORTS = { 'https': 443 }
# Tags which identify the security groups you want to update
GLOBAL_SG_TAGS = { 'Name': 'Update_CloudFront_IPs', 'AutoUpdate': 'true' }
import boto3
@subudear
subudear / master.yaml
Created April 10, 2020 21:42
kops master template
{{range $i, $id := .availability_zone_names.value}}
apiVersion: kops.k8s.io/v1alpha2
kind: InstanceGroup
metadata:
creationTimestamp: null
labels:
kops.k8s.io/cluster: {{$.cluster_name.value}}
name: master-{{.}}
spec:
image: kope.io/k8s-1.15-debian-stretch-amd64-hvm-ebs-2020-01-17
@subudear
subudear / cluster_template.yaml
Created April 10, 2020 21:41
kops cluster yaml template for Nodes and Bastion
apiVersion: kops.k8s.io/v1alpha2
kind: Cluster
metadata:
creationTimestamp: null
name: {{.cluster_name.value}}
spec:
api:
loadBalancer:
type: Internal
authorization:
[cmdletbinding()]
Param (
[Parameter(Mandatory=$true)]
$apimServiceName,
[Parameter(Mandatory=$true)]
$resourceGroupName,
[Parameter(Mandatory=$true)]
$location,
[Parameter(Mandatory=$true)]
$organisation,
@subudear
subudear / keyvault.ps1
Created August 6, 2019 21:52
This script is to create keyvault, secret and policy access to user through powershell
#this scripts will create keyvault, assign permissions to users, apps, and groups.
#pipeline service principal App ObjectID will be assigned list,get and set permissions.
[CmdletBinding()]
Param(
[Parameter(Mandatory=$true)]$location,
[Parameter(Mandatory=$true)]$resourceGroupName,
[Parameter(Mandatory=$true)]$keyVaultName,
[Parameter(Mandatory=$true)]$secretName,