Skip to content

Instantly share code, notes, and snippets.

View kenazk's full-sized avatar

Kenaz Kwa kenazk

  • FOSSA
  • Portland, OR
View GitHub Profile
@kenazk
kenazk / filter.py
Created August 23, 2021 16:18
Filtering the VMs (and exiting 1 if empty)
#!/usr/bin/env python
# File: filter-vms.py
# Description: This is an example script that you can author or modify that retrieves
# a list of Azure Virtual Machines from the Relay Interface (in the form of parameters)
# and filters the VMs that have no tags. It then sets the output variable `resourceIDs`
# to the list of Azure Virtual Machines resource IDs that are untagged.
# Inputs:
# - virtualMachines - list of Azure Virtual Machines
# Outputs:
@kenazk
kenazk / victorops.yaml
Created July 17, 2020 20:25
victorops.yaml
parameters:
id:
default: ""
name:
default: ""
state:
default: ""
service:
default: ""
timestamp:
@kenazk
kenazk / hello.sh
Last active July 17, 2020 20:13
Hello World
#! /bin/sh
echo $(ni get -p {.name})
echo "hello world"
@kenazk
kenazk / workflow.yaml
Last active June 15, 2020 17:03
Updating Relay workflow on Github PR merge
apiVersion: v1
description: Update a Relay workflow when a GitHub PR is merged
parameters:
branch:
default: master
repository:
default: "kenazk/testing"
triggers:
@kenazk
kenazk / script.py
Created May 25, 2020 04:51
Relay: Delete Unused Key Pairs
#!/usr/bin/env python
import boto3
sess = boto3.Session(
aws_access_key_id='MYAWSACCESSKEYID',
aws_secret_access_key='MYSECRETACCESSKEY',
region_name='us-east-1'
)
# Creating lists for all, used, and unused key pairs
@kenazk
kenazk / volumes.py
Created April 28, 2020 17:04
Finding and deleting unattached EBS volumes
#!/usr/bin/env python
import boto3
sess = boto3.Session(
aws_access_key_id="MYAWSACCESSKEYID",
aws_secret_access_key="MYSECRETACCESSKEY",
region_name="us-east-1",
)
@kenazk
kenazk / filter.py
Last active April 24, 2020 04:42
Filter Load Balancers
#!/usr/bin/env python
import re
from nebula_sdk import Interface, Dynamic as D
ni = Interface()
if __name__ == '__main__':
# For each load balancer => Get target groups => Get targets under target group
@kenazk
kenazk / token.md
Last active August 21, 2019 15:40
Getting Kubernetes Service Account Token

Retrieving a Kubernetes Service Account Token

Prerequisites: Kubernetes cluster and local kubectl configuration

  1. Look for which service account you want to use
$ kubectl -n kube-system get serviceaccount
  1. Retrieve the token name
@kenazk
kenazk / config.yml
Created January 26, 2018 00:10
JIRA CLI Config
endpoint: https://tickets.puppetlabs.com
user: kenaz
project: DI
editor: vim
custom-commands:
- name: env
help: print the JIRA environment variables available to custom commands
script: |
env | grep JIRA
@kenazk
kenazk / config.yml
Created January 26, 2018 00:10
JIRA CLI
endpoint: https://tickets.puppetlabs.com
user: kenaz
project: DI
editor: vim
custom-commands:
- name: env
help: print the JIRA environment variables available to custom commands
script: |
env | grep JIRA