Skip to content

Instantly share code, notes, and snippets.

View punkrokk's full-sized avatar

JP Bourget punkrokk

View GitHub Profile
@sdeoras
sdeoras / vault-auto-unseal-gcp-kms.md
Last active July 11, 2024 14:28
vault auto-unseal using gcp kms

Steps required to setup auto-unseal of vault using GCP KMS on k8s are as follows:

  • Create a keyring and key
  • Generate a service account credentials with encrypter-decryper role
  • Download https://github.com/hashicorp/vault-helm
  • Checkout a particular version (say tags/v0.3.0)
  • Edit values.yaml and update it as shown below.
  • Install helm/tiller and install vault component

diff for values.yaml

@mirfan899
mirfan899 / urlmarker.py
Created April 16, 2019 16:08
URL regex
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
The regex patterns in this gist are intended to match any URLs,
including "mailto:[email protected]", "x-whatever://foo", etc. For a
pattern that attempts only to match web URLs (http, https), see:
https://gist.github.com/gruber/8891611
"""
ANY_URL_REGEX = r"""(?i)\b((?:[a-z][\w-]+:(?:/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))"""
@issacg
issacg / example-api-gateway-swagger.json
Created November 8, 2017 12:35
Reference code for unsealing a Vault instance using Authy OneTouch push notifications
{
"swagger": "2.0",
"info": {
"version": "2017-11-05T23:36:16Z",
"title": "Vault Unseal API"
},
"host": "myproject.execute-api.us-east-1.amazonaws.com",
"basePath": "/v1",
"schemes": [
"https"
@bdwyertech
bdwyertech / vmware_fusion_reset_networking.sh
Last active December 8, 2021 10:24
VMWare Fusion - Reset Networking
#!/bin/bash
# Reset VMware Fusion Networking
# Clear out the Configuration
sudo rm -f /Library/Preferences/VMware\ Fusion/networking*
sudo rm -f /Library/Preferences/VMware\ Fusion/*location*
sudo rm -rf /Library/Preferences/VMware\ Fusion/vmnet*
sudo rm -rf /var/db/vmware/vmnet-dhcpd-vmnet*
# Reconfigure Networking
@ravibhure
ravibhure / git_rebase.md
Last active November 9, 2024 05:19
Git rebase from remote fork repo

In your local clone of your forked repository, you can add the original GitHub repository as a "remote". ("Remotes" are like nicknames for the URLs of repositories - origin is one, for example.) Then you can fetch all the branches from that upstream repository, and rebase your work to continue working on the upstream version. In terms of commands that might look like:

Add the remote, call it "upstream":

git remote add upstream https://github.com/whoever/whatever.git

Fetch all the branches of that remote into remote-tracking branches, such as upstream/master:

git fetch upstream

@LukeMurphey
LukeMurphey / modular_alert.py
Last active January 9, 2019 21:23
This is a base class that makes the creation of a Splunk modular alert easier. #splunk
import logging
from logging import handlers
import traceback
import sys
import re
import os
import json
import socket # Used for IP Address validation
from splunk.appserver.mrsparkle.lib.util import make_splunkhome_path
@andreicristianpetcu
andreicristianpetcu / ansible-summary.md
Created May 30, 2016 19:25
This is an ANSIBLE Cheat Sheet from Jon Warbrick

An Ansible summary

Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)

Configuration file

intro_configuration.html

First one found from of

@d0c-s4vage
d0c-s4vage / autopypi.py
Created March 13, 2016 13:32
A simple script to auto-install packages from pypi when they are imported.
#!/usr/bin/env python
# encoding: utf-8
import imp
import os
import pdb
import pip
import readline
from pip.commands.search import SearchCommand
import sys
@ygorth
ygorth / centos_python_dev_env_setup
Last active July 24, 2022 13:26 — forked from iDevPy/centos_python_env_setup
CentOS 7: Install Python 3.6.1, pip, virtualenv, and virtualenvwrapper
#!/bin/bash
#####################################################################
## IMPORTANT ##
# Run this script with root (sudo su -), wont work if run as sudo.
# Change the variables as needed.
######################################################################
USER=youruser # User that will have ownership (chown) to /usr/local/bin and /usr/local/lib
USERHOME=/home/${USER} # The path to the users home, in this case /home/youruser
PYSHORT=3.6 # The Python short version, e.g. easy_install-${PYSHORT} = easy_install-3.6
PYTHONVER=3.6.1 # The actual version of python that you want to download from python.org
@kmassada
kmassada / README.md
Last active September 4, 2021 12:22
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