Skip to content

Instantly share code, notes, and snippets.

@terminalmage
terminalmage / README.md
Last active February 13, 2024 14:44
Salt Debugging Best Practices (SaltConf 18)

Salt Debugging Best Practices

These notes should prove useful for those looking for tips on how to find and fix bugs, as well as those who are developing Salt and would like to improve/streamline the process.

NOTE: These notes are written from the perspective of a developer working in a Linux environment. Those on MacOS may need to make some adjustments. Those on Windows may need to make several adjustments.

@dpino
dpino / ns-inet.sh
Last active April 19, 2024 18:12
Setup a network namespace with Internet access
#!/usr/bin/env bash
# set -x
if [[ $EUID -ne 0 ]]; then
echo "You must be root to run this script"
exit 1
fi
# Returns all available interfaces, except "lo" and "veth*".
@DavidWittman
DavidWittman / supermicro-ipmi-mac-address.md
Last active August 17, 2023 08:05
Pull the LAN1/eth0 MAC address from SuperMicro IPMI

You can find the MAC address for LAN1/eth0 (not the BMC MAC) via the SuperMicro IPMI interface by running the following command:

$ ipmitool -U $IPMI_USER -P $IPMI_PASS -H $IPMI_HOST raw 0x30 0x21 | tail -c 18

The eth0 MAC address will be output in this format:

00 25 90 f0 be ef
@Chaser324
Chaser324 / GitHub-Forking.md
Last active April 25, 2024 04:57
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j

@Integralist
Integralist / Hash Keys to Symbols.rb
Last active September 2, 2020 08:50
Convert Ruby Hash keys into symbols
hash = { 'foo' => 'bar' }
# Version 1
hash = Hash[hash.map { |k, v| [k.to_sym, v] }]
# Version 2
hash = hash.reduce({}) do |memo, (k, v)|
memo.tap { |m| m[k.to_sym] = v }
end
@rcoup
rcoup / rsync_parallel.sh
Created April 10, 2013 21:52
Parallel-ise an rsync transfer when you want multiple concurrent transfers happening,
#!/bin/bash
set -e
# Usage:
# rsync_parallel.sh [--parallel=N] [rsync args...]
#
# Options:
# --parallel=N Use N parallel processes for transfer. Defaults to 10.
#
# Notes:
@alanivey
alanivey / gist:4709843
Created February 4, 2013 21:24
Chef MySQL Server use encrypted data bag for passwords
diff --git a/cookbooks/mysql/recipes/server.rb b/cookbooks/mysql/recipes/server.rb
index 8229adc..0caf44e 100644
--- a/cookbooks/mysql/recipes/server.rb
+++ b/cookbooks/mysql/recipes/server.rb
@@ -35,10 +35,21 @@ if Chef::Config[:solo]
].join(' '))
end
else
- # generate all passwords
- node.set_unless['mysql']['server_debian_password'] = secure_password
@saetia
saetia / gist:1623487
Last active March 19, 2024 15:21
Clean Install – OS X 10.11 El Capitan

OS X Preferences


most of these require logout/restart to take effect

# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false

# Set a shorter Delay until key repeat