Skip to content

Instantly share code, notes, and snippets.

View akamalov's full-sized avatar

Alex Kamalov akamalov

View GitHub Profile
@akamalov
akamalov / curl_rest_api.md
Created February 27, 2019 14:15 — forked from richardjortega/curl_rest_api.md
cURL REST API for Azure Resource Manager (ARM)

Using cURL and Azure REST API to access Azure Resource Manager (non-interactive)

Note: This guide assumes Azure CLI 2.0 is installed and familiarity with Azure concepts.

Register Client App and Obtain Service Principal (via CLI)

The APP_ID_URI needs to match what is expected in client request calls.

$ az ad sp create-for-rbac --name [APP_ID_URI] --password [PASSWORD]
@akamalov
akamalov / readme.md
Created February 24, 2019 16:34 — forked from thomasdarimont/readme.md
Example for decoding a JWT Payload with your Shell (bash, zsh...)

Setup

Add this to your .profile, .bashrc, .zshrc...

decode_base64_url() {
  local len=$((${#1} % 4))
  local result="$1"
  if [ $len -eq 2 ]; then result="$1"'=='
  elif [ $len -eq 3 ]; then result="$1"'=' 
  fi
 echo "$result" | tr '_-' '/+' | openssl enc -d -base64
@akamalov
akamalov / cf-networking-bosh-lite.yml
Created November 26, 2018 18:06 — forked from vchrisb/cf-networking-bosh-lite.yml
A bosh ops file to allow cloud foundry networking for bosh-lite
# add cf-networking release
- type: replace
path: /releases/-
value:
name: cf-networking
sha1: 689ff1050b49513d5fe889b9655803bcdd265824
url: https://bosh.io/d/github.com/cloudfoundry-incubator/cf-networking-release?v=0.18.0
version: "0.18.0"
- type: replace
@akamalov
akamalov / README.md
Created November 20, 2018 20:22 — forked from keymon/README.md
Proposal of how to track the cf-release/manifests

How to track cf-release/templates files

Different versions of Cloudfoundry can introduce changes in the architecture and requried properties for the manifests:

  • Add/remove/rename jobs, templates, packages
  • Add required configurations, settings
  • change syntax of configutations
@akamalov
akamalov / Gemfile
Created October 27, 2018 15:44 — forked from danhigham/Gemfile
Simple ruby script to download the contents of an application running on Cloud Foundry to a zip file
source :rubygems
gem 'cfoundry'
gem 'uuidtools'
@akamalov
akamalov / gist:699c387107747575ac47339af2eb3c74
Created August 21, 2018 12:35 — forked from Bouke/gist:11261620
Multiple Python installations on OS X

Previous versions used homebrew to install the various versions. As suggested in the comments, it's better to use pyenv instead. If you are looking for the previous version of this document, see the revision history.

$ brew update
$ brew install pyenv
$ pyenv install 3.5.0
$ pyenv install 3.4.3
$ pyenv install 3.3.6
$ pyenv install 3.2.6
$ pyenv install 2.7.10

$ pyenv install 2.6.9

@akamalov
akamalov / USING-VAULT.md
Created July 25, 2018 23:09 — forked from voxxit/USING-VAULT.md
Consul + Vault + MySQL = <3
git clone https://gist.github.com/dd6f95398c1bdc9f1038.git vault
cd vault
docker-compose up -d
export VAULT_ADDR=http://192.168.99.100:8200

Initializing a vault:

vault init
# Install https://www.vaultproject.io/
brew install vault
# Start dev vault server in a separate terminal
vault server -dev
# ==> Vault server configuration:
# ...
# Unseal Key: 7ACQHhLZY5ivzNzhMruX9kSa+VXCah3y87hl3dPSWFk=
# Root Token: 858a6658-682e-345a-e4c4-a6e14e6f7853
@akamalov
akamalov / bosh-cheatsheet.md
Created June 18, 2018 13:23 — forked from allomov-altoros/bosh-cheatsheet.md
BOSH CLI cheatsheet

BOSH command line interface cheatsheet

Introduction

BOSH is a powerful tool to install and manage your deployments. You can find docs on https://bosh.io/docs. Consider using bosh-init tool to install to a cloud of your choice MicroBOSH instance (MicroBOSH is a single VM BOSH installation, it has everything that you need to deploy and manage).

Installing of BOSH CLI

BOSH command line interface is implemented as a ruby gem and can be run on every platform that supports ruby, you'll need to have ruby 2.1.x or higher to run it. To install it you can run gem install bosh_cli and gem update bosh_cli to update to a newer version.

@akamalov
akamalov / test-ansible-role.sh
Created May 29, 2018 12:00 — forked from samdoran/test-ansible-role.sh
Script for testing an Ansible role in containers
#!/bin/bash
# Test Ansile role inside container
#
# Inspired by the wonderful work of Jeff Geerling (@geerlingguy)
# https://gist.github.com/geerlingguy/73ef1e5ee45d8694570f334be385e181
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
NEUTRAL='\033[0m'