Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bash
# Colours picked from https://robinpowered.com/blog/best-practice-system-for-organizing-and-tagging-github-issues/
###
# Label definitions
###
declare -A LABELS
# Platform
@DanyC97
DanyC97 / gist:16e6a6c167e211f01bc9
Created January 11, 2016 12:35
saltstack make html doc
Script started on Mon Jan 11 12:14:12 2016
No need to update translations. Skipping...
sphinx-build -b html -d _build/doctrees . _build/html
Running Sphinx v1.3.3
making output directory...
loading translations [en]... done
loading pickled environment... not yet created
[autosummary] generating autosummary for: contents-1.rst, contents-2.rst, contents-3.rst, contents-4.rst, contents.rst, faq.rst, glossary.rst, index.rst, ref/auth/all/index.rst, ref/auth/all/salt.auth.auto.rst, ..., topics/tutorials/walkthrough.rst, topics/tutorials/walkthrough_macosx.rst, topics/tutorials/writing_tests.rst, topics/virt/disk.rst, topics/virt/index.rst, topics/virt/nic.rst, topics/windows/index.rst, topics/windows/windows-package-manager.rst, topics/windows/windows-specific-behavior.rst, topics/yaml/index.rst
Failed to import 'salt.modules.system_rest_sample': no module named salt.modules.system_rest_sample
Failed to import 'salt.proxy.junos': no module named salt.proxy.junos
@DanyC97
DanyC97 / vault_module.py
Created January 12, 2016 19:03 — forked from ryancurrah/vault_module.py
SaltStack Module and Renderer for HashiCorp Vault
# -*- coding: utf-8 -*-
'''
Execution module to work with HashiCorp's Vault
:depends: - python-requests
In order to use an this module, a profile must be created in the master
configuration file:
Token example:
@DanyC97
DanyC97 / mint141516.md
Created January 24, 2016 10:32 — forked from hgomez/mint141516.md
Mint 14 -> Mint 15 -> Mint 16

Mint upgrade procedures

Some investigation and tests on how to upgrade Mint machine.

Tests performed on Mint Cinnamon 14/15/16, on physical machine 14->15 and VirtualBox VMs for 14->15->16 and 14->16.

As usual you could break your machine, so please do backups before and cross fingers.

Mint 14 -> Mint 15

To clone all repos from your organisation, try the following one-liner:
ORG=company; curl "https://api.github.com/orgs/$ORG/repos?per_page=1000" | grep -o 'git@[^"]*' | xargs -L1 git clone
For user repos, try:
USER=foo; curl "https://api.github.com/users/$USER/repos?per_page=1000" | grep -o 'git@[^"]*' | xargs -L1 git clone
@DanyC97
DanyC97 / curl.jinja
Created October 18, 2016 13:58 — forked from kevinburke/curl.jinja
Turn a requests request back into (roughly) the HTTP request that went over the wire. Also translates the request into a curl command
curl -X{{ method }} {{ url }}
{%- if query_string|length %}?{% endif %}
{{- query_string }} \
{%- for header, value in headers.iteritems() %}
-H '{{ header|urlencode }}: {{ value|urlencode }}'{% if not loop.last or params|length or auth %} \{% endif %}
{%- endfor -%}
{% if params|length %}{% for param, value in params.iteritems() %}
-d '{{ param.decode('utf-8')|urlencode }}={{ value.decode('utf-8')|urlencode }}'{% if not loop.last or auth %} \{% endif %}
{%- endfor %}{%- endif %}
{%- if auth %}
@DanyC97
DanyC97 / old.yml
Created January 11, 2017 13:14 — forked from halberom/old.yml
ansible - example of looping yum packages with different setting for one of them
- name: Install the required rpms
yum: name={{ item }} state=latest
with_items:
- wget
- git
- net-tools
- bind-utils
- iptables-services
- bridge-utils
- bash-completion
@DanyC97
DanyC97 / NOTES.md
Created February 6, 2017 18:51 — forked from DenisIzmaylov/NOTES.md
Step By Step Guide to Configure a CoreOS Cluster From Scratch

Step By Step Guide to Configure a CoreOS Cluster From Scratch

This guide describes how to bootstrap new Production Core OS Cluster as High Availability Service in a 15 minutes with using etcd2, Fleet, Flannel, Confd, Nginx Balancer and Docker.

Content

#!/usr/bin/python3
from pyVim.connect import SmartConnect, Disconnect
from pyVmomi import vim
import ssl
import atexit
if __name__ == '__main__':
# 接続情報
host = 'vCenter IP or Host Name'
username = '[email protected]'
@DanyC97
DanyC97 / ansible-role-test.sh
Created January 8, 2018 17:05 — forked from geerlingguy/ansible-role-test.sh
Ansible Role Test Shim Script
#!/bin/bash
#
# Ansible role test shim.
#
# Usage: [OPTIONS] ./tests/test.sh
# - 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)