Skip to content

Instantly share code, notes, and snippets.

View hughesjj's full-sized avatar

James Hughes (Splunk) hughesjj

  • Splunk
  • Seattle, WA
View GitHub Profile
@olljanat
olljanat / Find-OrphanDockerLayers.ps1
Last active June 19, 2024 13:03
Find Windows containers orphan layers
param (
[switch]$RenameOrphanLayers
)
If ($RenameOrphanLayers) {
Write-Warning "$($env:COMPUTERNAME) -RenameOrphanLayers option enabled, will rename all orphan layers"
}
# Get known layers on Docker images
[array]$ImageDetails += docker images -q | ForEach { docker inspect $_ | ConvertFrom-Json }
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# ref: https://github.com/i3/i3status/blob/master/contrib/wrapper.py
#
# To use it, ensure your ~/.i3status.conf contains this line:
# output_format = "i3bar"
# in the 'general' section.
# Then, in your ~/.i3/config, use:
# status_command i3status | ~/i3status/contrib/wrapper.py
@stephenLee
stephenLee / bithack.cc
Created November 6, 2012 13:56
bit manipulation tricks(collections)
/*
* Reference:
* http://www.quora.com/Computer-Programming/What-are-some-cool-bit-manipulation-tricks-hacks
* http://www.catonmat.net/blog/low-level-bit-hacks-you-absolutely-must-know/
*/
#include <iostream>
#include <string.h>
using namespace std;