Skip to content

Instantly share code, notes, and snippets.

@DanyC97
DanyC97 / .docker-alias.bash
Created March 21, 2018 15:46 — forked from jverdeyen/.docker-alias.bash
A set of docker aliases
# ------------------------------------
# Docker alias and function
# ------------------------------------
# Get latest container ID
alias dl="docker ps -l -q"
# Get container process
alias dps="docker ps"
apiVersion: v1
kind: ServiceAccount
metadata:
name: foo-sa
namespace: foo
---
kind: SecurityContextConstraints
apiVersion: v1
metadata:
annotations:
oc get po glusterblock-storage-provisioner-dc-1-864g5 -o yaml
apiVersion: v1
kind: Pod
metadata:
annotations:
kubernetes.io/created-by: |
{"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"}}
openshift.io/deployment-config.latest-version: "1"
openshift.io/deployment-config.name: glusterblock-storage-provisioner-dc
openshift.io/deployment.name: glusterblock-storage-provisioner-dc-1
@DanyC97
DanyC97 / ca.md
Created August 21, 2018 09:56 — forked from soarez/ca.md
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.

@DanyC97
DanyC97 / README.md
Created September 18, 2018 17:02 — forked from magnetikonline/README.md
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"

Parameters:
@DanyC97
DanyC97 / README.md
Created September 24, 2018 11:06 — forked from kmassada/README.md
Vagrant and KVM(QEMU) on Centos7

Libvirt

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
DanyC97 / iterm2.md
Created September 27, 2018 05:57 — forked from squarism/iterm2.md
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
DanyC97 / Ansible CloudFormation Macros.md
Created April 17, 2019 11:29 — forked from jheller/Ansible CloudFormation Macros.md
Using Ansible/Jinja macros to generate CloudFormation templates

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.

Keybase proof

I hereby claim:

  • I am DanyC97 on github.
  • I am danyc97 (https://keybase.io/danyc97) on keybase.
  • I have a public key whose fingerprint is 9877 6060 14EA 006E A062 22A2 19C5 1144 19FC 78AD

To claim this, I am signing this object:

@DanyC97
DanyC97 / gitcheats.txt
Created April 29, 2020 09:49 — forked from chrismccoy/gitcheats.txt
git cheats
# shortform git commands
alias g='git'
# pretty tab'd git log
git log --graph --pretty="tformat:%h*(%ar)*<%an>*%d %s" $* | sed -Ee 's/(^[^<]*) ago\)/\1)/' | sed -Ee 's/(^[^<]*), [[:digit:]]+ .*months?\)/\1)/' | column -s '*' -t | cat
# change author of all git repos
git filter-branch -f --env-filter "GIT_AUTHOR_NAME='yourname'; GIT_AUTHOR_EMAIL='youremail@example.com'; GIT_COMMITTER_NAME='yourname'; GIT_COMMITTER_EMAIL='youremail@example.com';" HEAD;
# stage only deleted files