Skip to content

Instantly share code, notes, and snippets.

View larryclaman's full-sized avatar

Larry Claman larryclaman

View GitHub Profile
@Daniel-ltw
Daniel-ltw / from.yaml
Last active August 25, 2023 21:11
Github Actions repository_dispatch example
name: Build Artifacts
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
@PiDayDev
PiDayDev / cherry-picky.sh
Last active October 8, 2023 18:16
Partial cherry-pick
#!/usr/bin/env bash
# Usage: ./cherry-pick <commit SHA or tag>
# It will cherry-pick given commit, but will only commit files in "src/" folder, skipping the rest.
# Bonus: the commit message and authorship information including the timestamp are copied from cherry-picked commit
# Credits to https://stackoverflow.com/a/5717615/7193150
git cherry-pick -n $1
git reset HEAD
git add src/
@BretFisher
BretFisher / docker-for-windows.md
Last active June 5, 2024 10:16
Getting a Shell in the Docker for Windows Moby VM

2018 Update: Easiest option is Justin's repo and image

Just run this from your CLI and it'll drop you in a container with full permissions on the Moby VM. Only works for Moby Linux VM (doesn't work for Windows Containers). Note this also works on Docker for Mac.

docker run -it --rm --privileged --pid=host justincormack/nsenter1

more info: https://github.com/justincormack/nsenter1

@devigned
devigned / sp-w-cert-azps-1-0.ps1
Last active October 25, 2023 12:34
Create a service principal to auth with a certificate in Azure PowerShell 1.0
# Login to Azure PowerShell
Login-AzureRmAccount
# Create the self signed cert
$currentDate = Get-Date
$endDate = $currentDate.AddYears(1)
$notAfter = $endDate.AddYears(1)
$pwd = "P@ssW0rd1"
$thumb = (New-SelfSignedCertificate -CertStoreLocation cert:\localmachine\my -DnsName com.foo.bar -KeyExportPolicy Exportable -Provider "Microsoft Enhanced RSA and AES Cryptographic Provider" -NotAfter $notAfter).Thumbprint
$pwd = ConvertTo-SecureString -String $pwd -Force -AsPlainText
@sheerun
sheerun / certgen.rb
Last active April 10, 2022 15:39
Docker TLS certificate generator
# Generates necessary certificates to ~/.docker
#
# Usage:
# bundle install
# ruby certgen.rb <domain>
require 'certificate_authority'
require 'fileutils'
if ARGV.empty?