Skip to content

Instantly share code, notes, and snippets.

@mrdrup
mrdrup / awscli-ami-with-enc-boot.txt
Created July 26, 2019 15:52 — forked from amphied/awscli-ami-with-enc-boot.txt
AWS CLI: creating and sharing an AMI with encrypted root volume
$ aws --region eu-west-1 ec2 copy-image --description "test-enc" --encrypted --kms-key-id "alias/test-enc" --name "test-enc" --source-image-id ami-0b0aea60d5230c42c --source-region eu-west-1
--------------------------------------
| CopyImage |
+----------+-------------------------+
| ImageId | ami-0504c6aba12345678 |
+----------+-------------------------+
$ aws --region eu-west-1 ec2 modify-image-attribute --image-id ami-0504c6aba12345678 --launch-permission "Add=[{UserId=234567890123}]"
$ aws --region eu-west-1 ec2 describe-images --image-id ami-0504c6aba12345678
@mrdrup
mrdrup / osx-setup.sh
Created October 20, 2018 19:57 — forked from somebox/osx-setup.sh
Set up an OSX machine from zero to awesome. Uses Homebrew (and cask, fonts, etc). Focused on Ruby/Rails development, includes rvm, xquartz, editor fonts, sublime text, and many tools.
#!/bin/bash
# A script to set up a new mac. Uses bash, homebrew, etc.
# Focused for ruby/rails development. Includes many utilities and apps:
# - homebrew, rvm, node
# - quicklook plugins, terminal fonts
# - browsers: chrome, firefox
# - dev: iterm2, sublime text, postgres, chrome devtools, etc.
# - team: slack, dropbox, google drive, skype, etc
# create keytab for radius user
ipa-getkeytab -p 'radius/HOSTNAME' -k /etc/raddb/radius.keytab
chown root:radiusd /etc/raddb/radius.keytab
chmod 640 /etc/raddb/radius.keytab
# make radius use the keytab for SASL GSSAPI
mkdir -p /etc/systemd/system/radiusd.service.d
cat > /etc/systemd/system/radiusd.service.d/krb5_keytab.conf << EOF
[Service]
Environment=KRB5_CLIENT_KTNAME=/etc/raddb/radius.keytab
@mrdrup
mrdrup / infra-secret-management-overview.md
Created May 18, 2018 16:32 — forked from maxvt/infra-secret-management-overview.md
Infrastructure Secret Management Software Overview

Currently, there is an explosion of tools that aim to manage secrets for automated, cloud native infrastructure management. Daniel Somerfield did some work classifying the various approaches, but (as far as I know) no one has made a recent effort to summarize the various tools.

This is an attempt to give a quick overview of what can be found out there. The list is alphabetical. There will be tools that are missing, and some of the facts might be wrong--I welcome your corrections. For the purpose, I can be reached via @maxvt on Twitter, or just leave me a comment here.

There is a companion feature matrix of various tools. Comments are welcome in the same manner.

@mrdrup
mrdrup / config.yml
Created February 9, 2016 18:46
Parse YAML from bash with sed and awk.
development:
adapter: mysql2
encoding: utf8
database: my_database
username: root
password:
apt:
- somepackage
- anotherpackage
@mrdrup
mrdrup / supermicro-ipmi-mac-address.md
Created February 5, 2016 17:46 — forked from DavidWittman/supermicro-ipmi-mac-address.md
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 <redacted> -P <redacted> -H 10.4.0.10 raw 0x30 0x21 | tail -c 18
00 25 90 f0 be ef
@mrdrup
mrdrup / gist:ecf8013ef6137b33bd7c
Created December 22, 2015 10:56 — forked from sgergely/gist:3793166
Midnight Commander Keyboard Shortcuts for Mac OSX
----- Esc -----
Quick change directory: Esc + c
Quick change directory history: Esc + c and then Esc + h
Quick change directory previous entry: Esc + c and then Esc + p
Command line history: Esc + h
Command line previous command: Esc + p
View change: Esc + t (each time you do this shortcut a new directory view will appear)
Print current working directory in command line: Esc + a
Switch between background command line and MC: Ctrl + o
Search/Go to directory in active panel: Esc + s / Ctrl + s then start typing directory name