Skip to content

Instantly share code, notes, and snippets.

View mefellows's full-sized avatar

Matt Fellows mefellows

View GitHub Profile
@mefellows
mefellows / BundleConfig.ps1
Last active December 25, 2023 23:33
Sysprepped Windows AMI using Packer
$EC2SettingsFile="C:\\Program Files\\Amazon\\Ec2ConfigService\\Settings\\BundleConfig.xml"
$xml = [xml](get-content $EC2SettingsFile)
$xmlElement = $xml.get_DocumentElement()
foreach ($element in $xmlElement.Property)
{
if ($element.Name -eq "AutoSysprep")
{
$element.Value="Yes"
}
@mefellows
mefellows / .gitignore
Last active July 29, 2023 00:26
AVJ All of repro
node_modules
@mefellows
mefellows / Vagrantfile
Created December 7, 2014 21:24
Example Vagrant Windows SMB Setup
VAGRANTFILE_API_VERSION = "2"
require 'io/console'
# Capture login details if starting up vagrant or provisioning it
# Required for AD operations.
#
# Environment variables prevent explicit user input. Useful for CI.
username = ENV["VAGRANT_USER"] || nil
password = ENV["VAGRANT_PASSWORD"] || nil
@mefellows
mefellows / tools.md
Last active August 30, 2022 22:40
Networking Tools - Cheat Sheet

*nix Networking Tools Cheat Sheet

## Network Performance

iperf (all)

Setup the server:

iperf -s
@mefellows
mefellows / readme.md
Created July 22, 2022 05:49
MOV to GIF recordings
# Create a full colour palette from a source
ffmpeg -y -i <input> -vf fps=15,scale=1024:-1:flags=lanczos,palettegen palette.png

# Export a GIF from the source, using the palette
ffmpeg -y -i <input> -i palette.png -filter_complex "fps=15,scale=800:-1:flags=lanczos[x];[x][1:v]paletteuse" output.gif

See other useful combinations here: https://gist.github.com/dergachev/4627207

@mefellows
mefellows / osx.txt
Last active January 12, 2022 00:57
Shared library debugging tips
# Print out demangled symbols referenced in a library
nm -C myaddon.node
# list libraries another lib depends on
otool -L /path/to/lib.dylib # OSX
ldd /path/to/lib.so # linux
# List rpath of a library
# https://stackoverflow.com/questions/12521802/print-rpath-of-an-executable-on-macos
# https://www.lekensteyn.nl/rpath.html#what-is-rpath
@mefellows
mefellows / gist:aa919375a2df819c59e7fd005fd62d56
Created December 6, 2021 03:13
Removing OSX code sign / untrusted binary
xattr -d com.apple.quarantine <path to file>
@mefellows
mefellows / sublime-preferences
Created July 26, 2013 13:42
My Sublime Preferences file. Kudos to http://ryantvenge.com/2013/07/sublime-text-preferences-file/ where this originated.
{
// Reduces red-eye (tip: red bull may undo this)
"font_size": 18.0,
// Love Vim < love Sublime
"ignored_packages":
[
"Vintage"
],
@mefellows
mefellows / gist:6088915
Created July 26, 2013 13:39
My VIM Preferences (~/.vimrc)
set nocompatible
set nowrap " don't wrap lines
set tabstop=4 " a tab is four spaces
set backspace=indent,eol,start
" allow backspacing over everything in insert mode
set autoindent " always set autoindenting on
set paste " Prepare for paste
set copyindent " copy the previous indentation on autoindenting
set number " always show line numbers
set shiftwidth=4 " number of spaces to use for autoindenting
@mefellows
mefellows / ec2-user-data.ps1
Last active May 28, 2021 11:44
Packer Community Plugins - Example Windows 2012 Setup
<powershell>
write-output "Running User Data Script"
write-host "(host) Running User Data Script"
cmd.exe /c net user /add vagrant FooBar@123
cmd.exe /c net localgroup administrators vagrant /add
Set-ExecutionPolicy -ExecutionPolicy bypass -Force
# RDP