Skip to content

Instantly share code, notes, and snippets.

@acarril
acarril / bootable-win-on-mac.md
Created November 18, 2022 17:49
Create a bootable Windows USB using macOS

For some reason, it is surprisingly hard to create a bootable Windows USB using macOS. These are my steps for doing so, which have worked for me in macOS Monterey (12.6.1) for Windows 10 and 11. After following these steps, you should have a bootable Windows USB drive.

1. Download a Windows disc image (i.e. ISO file)

You can download Windows 10 or Windows 11 directly from Microsoft.

2. Identify your USB drive

After plugging the drive to your machine, identify the name of the USB device using diskutil list, which should return an output like the one below. In my case, the correct disk name is disk2.

@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