Skip to content

Instantly share code, notes, and snippets.

View punkrokk's full-sized avatar

JP Bourget punkrokk

View GitHub Profile
@ravibhure
ravibhure / git_rebase.md
Last active April 11, 2025 09:30
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

@bdwyertech
bdwyertech / vmware_fusion_reset_networking.sh
Last active April 25, 2025 10:07
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
@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"
@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`!()\[\]{};:'".,<>?«»“”‘’]))"""
@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