Skip to content

Instantly share code, notes, and snippets.

View bcdady's full-sized avatar
👨‍💻
:terraform:

Bryan Dady bcdady

👨‍💻
:terraform:
View GitHub Profile
@jpoehls
jpoehls / encoding-helpers.ps1
Created April 17, 2012 14:54
Convert-FileEncoding and Get-FileEncoding
<#
.SYNOPSIS
Converts files to the given encoding.
Matches the include pattern recursively under the given path.
.EXAMPLE
Convert-FileEncoding -Include *.js -Path scripts -Encoding UTF8
#>
function Convert-FileEncoding([string]$Include, [string]$Path, [string]$Encoding='UTF8') {
$count = 0
# Compare-Directory.ps1
# Compare files in one or more directories and return file difference results
# Victor Vogelpoel <victor@victorvogelpoel.nl>
# Sept 2013
#
# Disclaimer
# This script is provided AS IS without warranty of any kind. I disclaim all implied warranties including, without limitation,
# any implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or
# performance of the sample scripts and documentation remains with you. In no event shall I be liable for any damages whatsoever
# (including, without limitation, damages for loss of business profits, business interruption, loss of business information,
@KirkMunro
KirkMunro / PowerShell.Signed.gitattributes
Last active February 15, 2023 10:24
.gitattributes file contents for PowerShell script or manifest modules (signed or unsigned) and binary modules
# Treat all files in this project as binary. This enables atomic
# checkins (no merges, these are signed files) and it preserves
# CRLF line endings
* binary
@urasandesu
urasandesu / Get-HelpByMarkdown.ps1
Last active August 5, 2023 04:12
This script converts PowerShell comment-based help to GitHub Flavored Markdown.
#
# File: Get-HelpByMarkdown.ps1
#
# Author: Akira Sugiura (urasandesu@gmail.com)
#
#
# Copyright (c) 2014 Akira Sugiura
#
# This software is MIT License.
#
@nathanchere
nathanchere / timedinput.ps1
Last active February 26, 2020 15:22
Powershell: timed input example
Function TimedPrompt($prompt,$secondsToWait){
Write-Host -NoNewline $prompt
$secondsCounter = 0
$subCounter = 0
While ( (!$host.ui.rawui.KeyAvailable) -and ($count -lt $secondsToWait) ){
start-sleep -m 10
$subCounter = $subCounter + 10
if($subCounter -eq 1000)
{
$secondsCounter++
@Eyjafjallajokull
Eyjafjallajokull / README.md
Last active December 25, 2023 02:53
AWS EBS - Find unused snapshots

This script can help you find and remove unused AWS snapshots and volumes.

There is hardcoded list of regions that it searches, adjust the value to suit your needs.

Use snapshot.py snapshot-report to generate report.csv containing information about all snapshots.

snapshot.py snapshot-cleanup lets you interactively delete snapshot if it finds it is referencing unexisting resources.

./snapshots.py --help
@harryfinn
harryfinn / security.ubuntu.com-timeout-on-apt-get-update.md
Last active October 9, 2023 05:39
security.ubuntu.com timeout on apt-get update

security.ubuntu.com timeout on apt-get update

Issue

When running the apt-get update command, the process 'hangs' when checking security.ubuntu.com endpoints. This is apparantely due to an issue some sites face when trying to connect over IPv6 and whilst it is assumed that this will be fixed at some point in the future (sooner rather than later judging by the transition to IPv6 by most), the fix below resolves this issue, allowing the update process to complete successfully.

Fix