Skip to content

Instantly share code, notes, and snippets.

View scrthq's full-sized avatar
☁️
daydreaming of pipelines and standards

Nate Ferrell scrthq

☁️
daydreaming of pipelines and standards
View GitHub Profile
@indented-automation
indented-automation / Import-PSCmdlet.ps1
Created August 25, 2017 13:23
Cmdlets without a DLL
using namespace System.Management.Automation.Runspaces
using namespace System.Reflection
function Import-PSCmdlet {
param (
[String]$Name,
[Type]$Type
)
@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@subfuzion
subfuzion / github-wiki-how-to.md
Last active March 13, 2025 09:40
GitHub Wiki How-To

How do I clone a GitHub wiki?

Any GitHub wiki can be cloned by appending wiki.git to the repo url, so the clone url for the repo https://myorg/myrepo/ is: [email protected]:myorg/myrepo.wiki.git (for ssh) or https://github.com/my/myrepo.wiki.git (for https).

You make edits, and commit and push your changes, like any normal repo. This wiki repo is distinct from any clone of the project repo (the repo without wiki.get appended).

How do I add images to a wiki page?

@devblackops
devblackops / chefquery.ps1
Created January 7, 2016 00:25
PowerShell script to query Chef nodes via REST API. Assumes you have the BouncyCastle.Crypto.dll in the same folder as the script.
function Get-Base64 {
param (
$data
)
# if the $data is a string then ensure it is a byte array
if ($data.GetType().Name -eq "String") {
$data = [System.Text.Encoding]::UTF8.GetBytes($data)
}
@squarism
squarism / iterm2.md
Last active May 14, 2025 18:42
An iTerm2 Cheatsheet

Tabs and Windows

Function Shortcut
New Tab + T
Close Tab or Window + W (same as many mac apps)
Go to Tab + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction + Option + Arrow Key
Cycle iTerm Windows + backtick (true of all mac apps and works with desktops/mission control)
@ctigeek
ctigeek / PowershellAes.ps1
Last active August 12, 2024 13:05
Aes Encryption using powershell.
function Create-AesManagedObject($key, $IV) {
$aesManaged = New-Object "System.Security.Cryptography.AesManaged"
$aesManaged.Mode = [System.Security.Cryptography.CipherMode]::CBC
$aesManaged.Padding = [System.Security.Cryptography.PaddingMode]::Zeros
$aesManaged.BlockSize = 128
$aesManaged.KeySize = 256
if ($IV) {
if ($IV.getType().Name -eq "String") {
$aesManaged.IV = [System.Convert]::FromBase64String($IV)
}
@seanbamforth
seanbamforth / AmazonEtagHashForFile.ps1
Last active September 21, 2023 13:48
Calculate Amazon eTag hash for named file. Powershell
#Calculates an eTag for a local file that should match the S3 eTag of the uploaded file.
$md5 = new-object -TypeName System.Security.Cryptography.MD5CryptoServiceProvider
$blocksize = (1024*1024*5)
$startblocks = (1024*1024*16)
function AmazonEtagHashForFile($filename) {
$lines = 0
[byte[]] $binHash = @()
@jtimberman
jtimberman / default.rb
Created June 7, 2010 14:47
Chef version checking in recipes
# access chef's version constant directly
if Chef::VERSION.to_f >= 0.8
# 0.8+ only features here
end
# node attribute, requires ohai version 0.5.4:
if node.chef_packages.chef.version.to_f >= 0.8
# 0.8+ only features here