Skip to content

Instantly share code, notes, and snippets.

View cicorias's full-sized avatar

Shawn Cicoria cicorias

View GitHub Profile
- task: Kubernetes@1
name: 'apply'
inputs:
connectionType: 'Kubernetes Service Connection'
kubernetesServiceEndpoint: 'test'
namespace: 'default'
command: 'apply'
arguments: '-f deployment.yaml'
secretType: 'dockerRegistry'
containerRegistryType: 'Azure Container Registry'
@cicorias
cicorias / README.md
Created June 23, 2021 22:37
spring boot getting starting
@cicorias
cicorias / complex.kql
Created June 22, 2021 14:53
Example complex KQL
AppRequests
| project TimeGenerated, Id, invocationId=Properties['InvocationId']
| where TimeGenerated > ago(30d)
//| where cloud_RoleName =~ 'func01spz5txz3vpspbmcg' and operation_Name =~ 'stream_analytics_output_handler'
| order by TimeGenerated desc
| take 10
AppRequests
| project TimeGenerated, Id, OperationName, Success, ResultCode, DurationMs, OperationId, AppRoleName, Properties
@cicorias
cicorias / setting.json
Created June 15, 2021 18:56
Logic Apps dynamic name of file written to blob using YY/MM/DD etc.
concat(formatDateTime(utcNow(), 'yyyy/MM/dd/HH/'), 'coreid-', triggerBody()?['coreid'], formatDateTime(utcNow(),'-mm-ss'),'.json')
@cicorias
cicorias / retry.py
Created May 7, 2021 12:21
Python Retry Decorator
# Copyright 2021 Fabian Bosler
# from: https://towardsdatascience.com/are-you-using-python-with-apis-learn-how-to-use-a-retry-decorator-27b6734c3e6
# 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 copies of the Software, and to permit persons to whom
# the Software is furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
# Software.
@cicorias
cicorias / get_env.py
Created April 30, 2021 14:39
smart getenv for python
import os
from ast import literal_eval
__version__ = '1.1.0'
def getenv(name, **kwargs):
"""
Retrieves environment variable by name and casts the value to desired type.
@cicorias
cicorias / retry.py
Created April 30, 2021 12:20 — forked from FBosler/retry.py
retry.py
#Copyright 2021 Fabian Bosler
# 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 copies of the Software, and to permit persons to whom
# the Software is furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
# Software.

PowerShell things

@cicorias
cicorias / genAndUpload.ps1
Last active April 1, 2021 14:20
Make a test file and upload
#!/usr/bin/env pwsh
[CmdletBinding()]
param (
[Parameter(Mandatory = $true)]
[string]
$subscriptionId,
[Parameter(Mandatory = $true)]
[string]
$resourceGroup,
@cicorias
cicorias / find-delete-az-rg.sh
Created March 28, 2021 14:49
find and delete azure resource groups based upon a tag
#!/usr/bin/env bash
## this script identifies resource groups that have a tag: delete=true and will
## attempt to delete first by examining locks and deleting those locks (only 1 is supported)
## and then delete the group
## CAUTION USE WITH EXTREME CARE AS THERE IS NO GOING BACK WHEN A RESOURCE GROUP IS DELETED
set -u