Skip to content

Instantly share code, notes, and snippets.

Pavel Brodsky mcouthon

Block or report user

Report or block mcouthon

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
@mcouthon
mcouthon / Dockerfile
Created Jul 24, 2019
Simple Dockerfile to work with Terraform
View Dockerfile
# Use the light version of the image that contains just the latest binary
FROM hashicorp/terraform:light
# The app folder will contain all our files
WORKDIR /app
# Put all your configration files in the same folder as the Dockerfile
COPY . /app
# Initalize terraform with local settings and data
@mcouthon
mcouthon / The Tools I use.md
Last active Aug 22, 2019
The tools I use in Mac + Bash
View The Tools I use.md

The Tools I Use

Alfred [+ Powerpack]

Link

Basic functionality

Web search

  • Customize your search engine (go DDG!)

Clipboard history

@mcouthon
mcouthon / markdown.md
Last active May 23, 2019
Basic Markdown
View markdown.md

Headings

Create headings by adding #'s before the line.

# Heading 1
## Heading 2
### Heading 3

Heading 1

Heading 2

View VS Code (One Monokai) IntelliJ color scheme.icls
<scheme name="One Monokai (PB)" version="142" parent_scheme="Darcula">
<metaInfo>
<property name="created">2019-04-22T17:54:05</property>
<property name="ide">idea</property>
<property name="ideVersion">2019.1.1.0.0</property>
<property name="modified">2019-04-22T17:54:35</property>
<property name="originalScheme">One Monokai (PB)</property>
</metaInfo>
<colors>
<option name="CARET_COLOR" value="f8f8f0" />
View JetBrainsShortcuts.md

JetBrains Shortcuts

Prerequisites: install jetbrains toolbox - use it to install IntelliJ (need ultimate edition for remote debugging; requires a license)

IntelliJ Community vs Ultimate

Full comparison. The main advantages of Ultimate:

  • Has all the functionality of DataGrip (SQL)
  • Has plugins for Ruby, Go, PHP, Node.js, Angular, React, and more
  • Supports Coffee/Type/Javascript
@mcouthon
mcouthon / Profile.sh
Last active Dec 30, 2018
A convenience function to profile a python script
View Profile.sh
# This is the path to snakeviz executable in a dedicated venv
alias snake='/Users/pavel/dev/venvs/snakeviz/bin/snakeviz'
profile() {
tmp_file=$(mktemp)
python -m cProfile -o $tmp_file "$@"
snake $tmp_file
rm $tmp_file
}
View default_heal_workflow.yaml
groups:
heal_group:
members: [{{ members }}]
policies:
host_failure_policy:
type: cloudify.policies.types.host_failure
properties:
service:
- .*host.*.cpu.total.system
interval_between_workflows: 600
@mcouthon
mcouthon / script.sh
Created Mar 4, 2018
Example of script that adds a file
View script.sh
#!/usr/bin/env bash
echo "Deploying SSH key"
cat > ssh_key << _EOF_
-----BEGIN RSA PRIVATE KEY-----
MIIEpQIBAAKCAQEA6jl5GPIGLakcD7Xr+HWDS3NGwT0xmRcqFUnsYCpOsBeRBYcD
58Pq6JBEs2A3+kw+LIEawuFLM2//MZYxkRH0qmM/XosTaJbo1spLTSt67ILdtXmX
xGZqxArZWALekGDpeafcZraBCBY7is3Kn9Sm8ZQaM7uYzP5zYDMP8V+FajmFzMRb
0RV/DprvthC6HE5Z5k+lmZZ/F+vbWOL8PPZBO83A/Lg5h8BFwp9UKbMxHtV7eUKI
...
@mcouthon
mcouthon / New_upgrade_mechanism.md
Last active Oct 19, 2017
New upgrade mechanism for Cloudify Manager
View New_upgrade_mechanism.md

New upgrade mechanism

#cloudify

Abstract

This document is a proposal for completely reworking the Cloudify Manager upgrade mechanism. TL;DR - the current mechanism will be replaced by version-specific self-contained RPMs that will be installed in-place only.

Current problems

  • Massive downtime - teardown/bootstrap are necessary for an upgrade.
  • Fragmentation - the need to support many version combinations makes the upgrade code horrible to maintain (and look at).
@mcouthon
mcouthon / dict_merge.py
Created Sep 7, 2017 — forked from angstwad/dict_merge.py
Recursive dictionary merge in Python
View dict_merge.py
import collections
def dict_merge(dct, merge_dct):
""" Recursive dict merge. Inspired by :meth:``dict.update()``, instead of
updating only top-level keys, dict_merge recurses down into dicts nested
to an arbitrary depth, updating keys. The ``merge_dct`` is merged into
``dct``.
:param dct: dict onto which the merge is executed
:param merge_dct: dct merged into dct
You can’t perform that action at this time.