Skip to content

Instantly share code, notes, and snippets.

Avatar

Pavel Brodsky mcouthon

View GitHub Profile
@mcouthon
mcouthon / list-all-repos.py
Last active Mar 17, 2020 — forked from ralphbean/list-all-repos.py
Script to list all repos for a github organization
View list-all-repos.py
#!/usr/bin/env python
""" Print all of the clone-urls for a GitHub organization.
It requires the pygithub3 module, which you can install like this::
$ sudo yum -y install python-virtualenv
$ mkdir scratch
$ cd scratch
$ virtualenv my-virtualenv
@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).
You can’t perform that action at this time.