Skip to content

Instantly share code, notes, and snippets.

View Wicaeed's full-sized avatar

Craig Gill Wicaeed

View GitHub Profile
@Jegeva
Jegeva / httpcache.py
Last active August 15, 2022 07:55
a simple caching http proxy
#! /usr/bin/python3
# A simple HTTP proxy which does caching of requests.
# "Inspired" by: https://gist.github.com/justinmeiners/24dcf5904490b621220bed643651f681
# but updated with
#- a clean exit on signal allowing it to be easily popped by another script using subprocess
#- tcp socket reuse to avoid the tcp socket already in use if popped often
#- a cache directory to avoid a lot of files just being in the middle
#
# use it by getting 'http://localhost:8000/www.kernel.org' to get http://www.kernel.org
@penguinpowernz
penguinpowernz / nwinfo.rb
Created February 28, 2016 03:33
Ruby network interface information parser
#!/usr/bin/env ruby
require 'json'
ifaces = []
whitelist = [ "eth", "wlan", "en" ]
names = `ip link sh`.scan(/^\d+: (.*):/).flatten.select do |name|
whitelist.any? {|pattern| name.start_with?(pattern) }
end
@sethvargo
sethvargo / secret.rb
Created February 1, 2016 21:36
Example Chef extension to extract secrets from HashiCorp's Vault
# Please see the following blog post for more information:
#
# https://www.hashicorp.com/blog/using-hashicorp-vault-with-chef.html
#
resource_name :vault_secret
property :path, String, name_property: true
property :destination, String