Skip to content

Instantly share code, notes, and snippets.

View bgshacklett's full-sized avatar

Brian G. Shacklett bgshacklett

View GitHub Profile
@bgshacklett
bgshacklett / Jenkinsfile.groovy
Created January 29, 2022 15:19
Test case for groovy syntax file problem
def foo(
) {
sh '''
Lorem ipsum dolor sit amet, consectetur adipiscing elit,
sed do eiusmod tempor incididunt ut labore et dolore
magna aliqua. Adipiscing diam donec adipiscing tristique
risus. Aenean vel elit scelerisque mauris pellentesque
pulvinar pellentesque. Ullamcorper dignissim cras
tincidunt lobortis feugiat vivamus at. Nunc sed velit
dignissim sodales ut eu sem integer. Amet est placerat
@bgshacklett
bgshacklett / settings.json
Created February 12, 2021 13:57
Windows Terminal
// To view the default settings, hold "alt" while clicking on the "Settings" button. // For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"defaultProfile": "{dba43f41-44c5-4686-8615-6d4bf260f608}",
"profiles":
[
{
@bgshacklett
bgshacklett / ConvertFrom-PosixEnvironment.ps1
Created November 21, 2019 14:25
A PowerShell Script/Function which takes a Posix environment (output by env, for instance) and converts it to a PowerShell environment format.
param
(
[Parameter(ValueFromPipeline="true")]
[String]$PosixVars
)
Process
{
$PosixVars `
| ForEach-Object {
$certParams =
@{
Type = 'Custom'
KeyUsage = 'DigitalSignature'
FriendlyName = 'WindowsTerminal'
CertStoreLocation = 'Cert:\LocalMachine\My'
Subject = (
'CN=Microsoft Corporation',
'O=Microsoft Corporation',
'L=Redmond',
@bgshacklett
bgshacklett / Reduce-Object.ps1
Created December 17, 2017 03:21
An Implementation of the Reduce Function for PowerShell
function Reduce-Object
{
[CmdletBinding()]
Param
(
[Parameter(Mandatory = $true)]
$InitialValue,
[Parameter(ValueFromPipeline = $true)]
$InputObject,
@bgshacklett
bgshacklett / VimSnippets.md
Last active May 26, 2017 22:39
Vim Snippets

A collection of useful Vim snippets

@bgshacklett
bgshacklett / powerShellOneLiners.ps1
Created March 2, 2017 21:53
Useful PowerShell One-Liners
# Get any command that has $ParameterName as an available parameter:
Get-Command | Where-Object { $_.parametersets.parameters.Name -eq "$ParameterName" }
@bgshacklett
bgshacklett / README.md
Last active November 18, 2016 20:57
Useful Git Commands

These are some commands that I've found useful over my time working with Git.

@bgshacklett
bgshacklett / gist:4fd3fc1fb6e777dbfad853614ee5b735
Last active September 1, 2016 03:35
Useful Bash OneLiners
# From http://stackoverflow.com/questions/191364/quick-unix-command-to-display-specific-lines-in-the-middle-of-a-file
# Print lines 20 to 40 of a text file:
sed -n '20,40p;41q' file_name
@bgshacklett
bgshacklett / Get-Ec2InstanceDetails
Last active September 3, 2016 04:02
Powershell Snippets
Get-EC2Instance | Select-Object -ExpandProperty instances | Select-Object InstanceId, @{Name='Name'; Expression={$_.Tags | Where-Object { $_.Key -like 'Name'} | Select-Object -ExpandProperty Value }}, InstanceType, @{Name='AMI'; Expression={Get-EC2Image -ImageId $_.ImageID | Select-Object -ExpandProperty name}}, @{Name='StorageConfig'; Expression={"Storage"}}, @{Name='SubnetName'; Expression={Get-Ec2Subnet -SubnetId $_.SubnetId | Select-Object -ExpandProperty Tags | Where-Object { $_.Key -like 'Name' } | Select-Object -ExpandProperty Value }} | Sort-Object -Property Name | Out-GridView