Skip to content

Instantly share code, notes, and snippets.

Bryan Dady bcdady

View GitHub Profile
@harryfinn
harryfinn / security.ubuntu.com-timeout-on-apt-get-update.md
Last active Mar 1, 2020
security.ubuntu.com timeout on apt-get update
View security.ubuntu.com-timeout-on-apt-get-update.md

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

@Eyjafjallajokull
Eyjafjallajokull / README.md
Last active Jul 11, 2020
AWS EBS - Find unused snapshots
View README.md

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
@nathanchere
nathanchere / timedinput.ps1
Last active Feb 26, 2020
Powershell: timed input example
View timedinput.ps1
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++
@urasandesu
urasandesu / Get-HelpByMarkdown.ps1
Created Dec 28, 2014
This script converts PowerShell comment-based help to GitHub Flavored Markdown.
View Get-HelpByMarkdown.ps1
#
# File: Get-HelpByMarkdown.ps1
#
# Author: Akira Sugiura (urasandesu@gmail.com)
#
#
# Copyright (c) 2014 Akira Sugiura
#
# This software is MIT License.
#
@KirkMunro
KirkMunro / PowerShell.Signed.gitattributes
Last active Sep 17, 2019
.gitattributes file contents for PowerShell script or manifest modules (signed or unsigned) and binary modules
View PowerShell.Signed.gitattributes
# 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
View compare-directory.ps1
# 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,
@jpoehls
jpoehls / encoding-helpers.ps1
Created Apr 17, 2012
Convert-FileEncoding and Get-FileEncoding
View encoding-helpers.ps1
<#
.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
You can’t perform that action at this time.