Skip to content

Instantly share code, notes, and snippets.

Dani Comnea DanyC97

  • Synamedia
  • UK
Block or report user

Report or block DanyC97

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
DanyC97 / Ansible CloudFormation
Created Apr 17, 2019 — forked from jheller/Ansible CloudFormation
Using Ansible/Jinja macros to generate CloudFormation templates
View Ansible CloudFormation

Generating CloudFormation Templates from YAML Dictionaries

The security group and Network ACLs parts of CloudFormation templates can be difficult to read. This template containing Jinja macros converts easier-to-read YAML dictionaries of security group and NACL rules into JSON.

Here ais a generic macro template and some example files showing how to use it.

  • cloudformation.macros.j2 - the macros
  • cf_vars.yml - YAML dictionaly of security groups and NACLs, including some complex rules for both
  • test.template.j2 - a simple CloudFormation template that uses the macro file
  • cf_test.yml - a simple Ansible playbook that generates CloudFormation JSON from thr previous file.
DanyC97 /
Created Sep 27, 2018 — forked from squarism/
iterm2 cheatsheet

Tabs and Windows

Function Shortcut
Fullscreen + Enter
Previous Tab + Left Arrow
Next Tab + Right Arrow
Go to Tab + Number
Go to Window + Option + Number
Go to Split Pane by Direction + Option + Arrow
DanyC97 /
Created Sep 24, 2018 — forked from kmassada/
Vagrant and KVM(QEMU) on Centos7


yum group install -y "Development Tools"
yum -y install qemu-kvm libvirt virt-install bridge-utils libvirt-devel  libxslt-devel libxml2-devel libvirt-devel libguestfs-tools-c
echo "net.ipv4.ip_forward = 1"|sudo tee /etc/sysctl.d/99-ipforward.conf
sysctl -p /etc/sysctl.d/99-ipforward.conf
DanyC97 /
Created Sep 18, 2018 — forked from magnetikonline/
AWS CloudFormation YAML template - appending to list parameter types.

AWS CloudFormation YAML template - appending to list parameter types

Documenting this here, as I often forget (what I have found) is the best way to do this at the moment.

For example, you have a list of two existing security groups given to a stack and wish to create (and use) a third - attaching all to an ALB:

AWSTemplateFormatVersion: "2010-09-09"
Description: "Example template"

DanyC97 /
Created Aug 21, 2018 — forked from soarez/
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

View GlusterFS-Deployment.yml
oc get po glusterblock-storage-provisioner-dc-1-864g5 -o yaml
apiVersion: v1
kind: Pod
annotations: |
{"kind":"SerializedReference","apiVersion":"v1","reference":{"kind":"ReplicationController","namespace":"glusterfs","name":"glusterblock-storage-provisioner-dc-1","uid":"4a94ebd4-4402-11e8-8ea9-005056a2d8cc","apiVersion":"v1","resourceVersion":"18370005"}} "1" glusterblock-storage-provisioner-dc glusterblock-storage-provisioner-dc-1
View Foo-SCC.yml
apiVersion: v1
kind: ServiceAccount
name: foo-sa
namespace: foo
kind: SecurityContextConstraints
apiVersion: v1
DanyC97 / .docker-alias.bash
Created Mar 21, 2018 — forked from jverdeyen/.docker-alias.bash
A set of docker aliases
View .docker-alias.bash
# ------------------------------------
# Docker alias and function
# ------------------------------------
# Get latest container ID
alias dl="docker ps -l -q"
# Get container process
alias dps="docker ps"
DanyC97 /
Created Jan 8, 2018 — forked from geerlingguy/
Ansible Role Test Shim Script
# Ansible role test shim.
# Usage: [OPTIONS] ./tests/
# - distro: a supported Docker distro version (default = "centos7")
# - playbook: a playbook in the tests directory (default = "test.yml")
# - cleanup: whether to remove the Docker container (default = true)
# - container_id: the --name to set for the container (default = timestamp)
# - test_idempotence: whether to test playbook's idempotence (default = true)
from pyVim.connect import SmartConnect, Disconnect
from pyVmomi import vim
import ssl
import atexit
if __name__ == '__main__':
# 接続情報
host = 'vCenter IP or Host Name'
username = 'administrator@vsphere.local'
You can’t perform that action at this time.