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 / GenerateAzureCert.txt
Last active March 24, 2016 22:55
Generating an Azure Management Certificate
1. Generate the certificate locally
openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout azurecert.pem -out azurecert.pem -subj "/CN=My Azure Cert"
openssl x509 -inform pem -in azurecert.pem -outform der -out azurecert.cer
2. Navigate to https://manage.windowsazure.com
3. Click on Settings from the Menu
4. Select Management Certificates
5. Upload the cer file
@kenazk
kenazk / CreateUiDefinition.json
Last active August 5, 2016 23:50
CreateUiDefinition
{
"handler": "Microsoft.Compute.MultiVm",
"version": "0.0.1-preview",
"parameters": {
"basics": [
{
"name": "puppetMasterVmName",
"type": "Microsoft.Common.TextBox",
"label": "Puppet Enterprise Master VM Name",
"defaultValue": "puppetmaster",
@kenazk
kenazk / azure_vm_improvement_example.pp
Created July 22, 2016 21:49
Azure VM Improvement Example
azure_vm { 'sample':
location => 'eastus',
image => 'linux:http://puppetimages.blob.core.windows.net/azure/PuppetEnterpriseMaster-2016_1_2-amd64-server-20160708-en-us-30GB.vhd',
# Possible implementation
# user_image_type => 'linux',
# user_image_uri => 'http://puppetimages.blob.core.windows.net/azure/PuppetEnterpriseMaster-2016_1_2-amd64-server-20160708-en-us-30GB.vhd'
user => 'azureuser',
password => 'Password',
size => 'Standard_A0',
resource_group => 'testresacc01',
@kenazk
kenazk / module_build
Last active August 4, 2016 20:19
Building module from source
1. Run 'git rev-parse HEAD' # gets the current commit hash
2. Append the first 7 chars to the version in the metadata.json
3. Run `COPYFILE DISABLE=1 puppet module build`
4. puppet module install $pathto.tar.gz —-force —-ignore-dependencies
@kenazk
kenazk / .bash_profile
Last active August 25, 2016 23:36 — forked from natelandau/.bash_profile
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"newStorageAccountName": {
"type": "string",
"metadata": {
"description": "Unique DNS Name for the Storage Account where the Virtual Machine's disks will be placed."
}
},
@kenazk
kenazk / azure_vm
Created December 1, 2017 18:51
Azure VM API description
There are two API responses associated with an Azure VM: model view and instance view.
Documentation
https://docs.microsoft.com/en-us/rest/api/compute/virtualmachines/virtualmachines-get
Model view example:
{
"id":"/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
"vmId": "{vm-id}",
"name":"virtualMachineName”,
@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
@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 / 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