Skip to content

Instantly share code, notes, and snippets.

View johnbianchi's full-sized avatar

John Bianchi johnbianchi

View GitHub Profile
@lukechilds
lukechilds / get_latest_release.sh
Created August 9, 2016 19:43
Shell - Get latest release from GitHub
get_latest_release() {
curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api
grep '"tag_name":' | # Get tag line
sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value
}
# Usage
# $ get_latest_release "creationix/nvm"
# v0.31.4
@BretFisher
BretFisher / docker-cli-tips-and-tricks.md
Last active December 6, 2023 19:49
Docker CLI Tips and Tricks
@bohwaz
bohwaz / gitlab-projects-json-to-csv.php
Created February 8, 2017 01:23
Extract Gitlab JSON project list and convert it to CSV
<?php
$projects = [];
$projects[] = [
'Project path',
'Owner',
'Name',
'Description',
'Created',
@sebagomez
sebagomez / enable_https.ps1
Created February 1, 2019 15:23
Enable https via PowerShell
$cert = (New-SelfSignedCertificate -DnsName localhost -CertStoreLocation cert:Localmachine\My).Thumbprint
New-WebBinding -Name "Default Web Site" -IP "*" -Port 443 -Protocol https
Get-Item cert:\LocalMachine\MY\$cert | New-Item IIS:\SslBindings\0.0.0.0!443
@jdhitsolutions
jdhitsolutions / New-WindowsTerminalProfile.ps1
Last active November 5, 2019 04:04
A proof of concept PowerShell function to add a new profile to the Windows Terminal Preview (0.2.1831.0).
Function New-WindowsTerminalProfile {
[cmdletbinding(SupportsShouldProcess)]
Param(
[Parameter(Position = 0, Mandatory)]
[ValidateNotNullOrEmpty()]
[alias("name")]
[string]$ProfileName,
[Parameter( Mandatory)]
[ValidateNotNullOrEmpty()]
@mhitza
mhitza / workflow.md
Last active April 12, 2022 12:54
Faster Ansible playbook iteration with tags and Vagrant snapshots

In the last few months, I had to write multiple Ansible playbooks, to the point that the slow write/test cycle became a major annoyance. What seemed to work well for me was a mix between Ansible tags and Vagrant snapshots. I would be happy to hear what workflow others employ, that specifically minimizes the time they spend testing.

Setup

Vagrantfile

Vagrant.configure("2") do |config|
#!/usr/bin/env python
import argparse
import sys
from collections import Counter
def main(paths, n=100):
counter = Counter()
for path in paths:
print(path)