Skip to content

Instantly share code, notes, and snippets.

@Diagonactic
Diagonactic / gist:f9f3ad2bb41948be6f9a8aecf4d58be7
Created January 20, 2019 23:13
ZShell script to check/correct Keybase RPM Repository and code signing keys for reliable updates
#!/usr/bin/env zsh
#
# Copyright (C) 2019 Matthew S. Dippel
# under the terms of the MIt License at https://opensource.org/licenses/MIT
#
# Description: Checks an openSUSE Tumbleweed (and probably others) installation for the proper
# configuration of keybase's repository and gpg/pgp keys
# Author:
# Matthew S. Dippel :: https://github.com/Diagonactic :: https://keybase.io/mdip
die() { print -- "ERROR: $1"; exit 1 }
<#
.SYNOPSIS
Resets (or creates with confirmation) the Visual Studio Experimental Instance
.DESCRIPTION
Given the parameters provided, will reset or create (if confirmation is given) the Experimental Instance used for Visual Studio Extensions Development located at the given InstanceName
for the given Version of Visual Studio. If the instance isn't found, you'll be prompted to confirm whether or not you want to create a new instance and the existing instances will
be listed to assist you in case you simply mistyped (or in the case of Visual Studio 2017, discovered that it had a hash in front of it).
.PARAMETER InstanceName
param
(
[Parameter(Mandatory=$false)][switch]$Quiet=$false
)
function Get-CodeSigningKey() {
$childItem = Get-ChildItem cert:\CurrentUser\My -codesign | Where-Object {
$($_.EnhancedKeyUsageList | Select-Object -ExpandProperty FriendlyName | Where-Object {
$_ -eq "Code Signing"
}) -ne $null
@Diagonactic
Diagonactic / authorizePublicKeybaseId.sh
Created July 29, 2017 18:02
Add the public key of a keybase.io user to authorized_keys without handling the user's private key or installing the keybase client
#!/bin/bash
function die() {
local message="$1" code=$2
if [[ -z "$code" ]]; then
code=1
fi
(>&2 echo -e "$message")
exit $code
@Diagonactic
Diagonactic / ResetExperimentalInstance.ps1
Last active July 8, 2017 16:49
Use PowerShell to Reset a Visual Studio Experimental Instance
<#
.SYNOPSIS
Resets (or creates with confirmation) the Visual Studio Experimental Instance
.DESCRIPTION
Given the parameters provided, will reset or create (if confirmation is given) the Experimental Instance used for Visual Studio Extensions Development located at the given InstanceName
for the given Version of Visual Studio. If the instance isn't found, you'll be prompted to confirm whether or not you want to create a new instance and the existing instances will
be listed to assist you in case you simply mistyped (or in the case of Visual Studio 2017, discovered that it had a hash in front of it).
.PARAMETER InstanceName
<#
.SYNOPSIS
Looks up the first virtual machine and attempts to connect to it with Secure Shell using Public/Private Key Authentication
.DESCRIPTION
Used to make a connection to a Virtual Machine that has a DHCP address which changes often. Works in a non-elevated prompt, however, requires that the user be able to elevate
a session (ie. the user must know an Administrator password or be logged in as an administrative user in a non-elevated prompt). The script will elevate the user for the purpose
of getting the Hyper-V IP address, but will run the Secure Shell session as the non-elevated user if the session isn't elevated.
The script has the following requirements:

Keybase proof

I hereby claim:

  • I am Diagonactic on github.
  • I am mdip (https://keybase.io/mdip) on keybase.
  • I have a public key whose fingerprint is 93EF 7110 AF4F D5BB 2453 0B08 E299 6B29 F856 02D5

To claim this, I am signing this object: