Skip to content

Instantly share code, notes, and snippets.

@craigforr
craigforr / tmux.conf
Created February 18, 2021 17:03 — forked from spicycode/tmux.conf
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
@craigforr
craigforr / efs_targets.j2
Created December 15, 2020 01:45 — forked from halberom/efs_targets.j2
ansible - example of using lookup and a template to generate dynamic list entries for modules
#jinja2:trim_blocks: True, lstrip_blocks: True
targets:
{% for privnet in all_private_subnets %}
- subnet_id: "{{ privnet }}"
security_groups: [ "{{ sg.group_id }}" ]
{% endfor %}
{% for pubnet in all_public_subnets %}
- subnet_id: "{{ pubnet }}"
security_groups: [ "{{ sg.group_id }}" ]
{% endfor %}
@craigforr
craigforr / terraform_bash_completion.sh
Created November 5, 2020 21:31 — forked from zish/terraform_bash_completion.sh
Better Terraform Bash Completion
# Bash Terraform completion
# Originally adapted from: https://gist.github.com/cornfeedhobo/8bc08747ec3add1fc5adb2edb7cd68d3
#
# Author: Jeremy Melanson
#
# Features of this update:
# - Use built-in bash routines for text processing, instead of external tools (awk, sed, grep, ...).
# - fixes the retrieval of options from the Terraform executble.
# - Optional _init_terraform_completion function, which can enable command-completion for multiple Terraform executables.
#
bind-key C-b send-prefix
bind-key C-o rotate-window
bind-key C-z suspend-client
bind-key Space next-layout
bind-key ! break-pane
bind-key " split-window
bind-key # list-buffers
bind-key $ command-prompt -I #S "rename-session '%%'"
bind-key % split-window -h
bind-key & confirm-before -p "kill-window #W? (y/n)" kill-window
@craigforr
craigforr / autopart.sh
Created October 15, 2019 15:40 — forked from trentmswanson/autopart.sh
Linux bash script to partition and format all data disks in azure
#!/bin/bash
# An set of disks to ignore from partitioning and formatting
BLACKLIST="/dev/sda|/dev/sdb"
# Base directory to hold the data* files
DATA_BASE="/media"
usage() {
echo "Usage: $(basename $0) <new disk>"
}
@craigforr
craigforr / tmux-cheatsheet.markdown
Created April 25, 2019 21:10 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@craigforr
craigforr / qrcode-bookmarklet.js
Created December 19, 2018 20:29 — forked from ThomasR/qrcode-bookmarklet.js
A bookmarklet that generates a QR Code of the current URL. Click to return to page content.
javascript: void (function (main) {
var script = document.createElement('script');
script.onload = main;
script.src = 'https://davidshimjs.github.io/qrcodejs/qrcode.min.js';
document.head.appendChild(script).parentNode.removeChild(script);
})(function () {
var size = 400;
var qr = new QRCode(document.body, {
text: location.href,
width: size,
@craigforr
craigforr / titleUrlMarkdownClip.js
Created December 18, 2018 16:06 — forked from bradleybossard/titleUrlMarkdownClip.js
Bookmarklet to copy current page title and url in Markdown format to clipboard, like [title](url) - Usual for posting links to resources in README.md files
javascript:(function() {
function copyToClipboard(text) {
if (window.clipboardData && window.clipboardData.setData) {
/*IE specific code path to prevent textarea being shown while dialog is visible.*/
return clipboardData.setData("Text", text);
} else if (document.queryCommandSupported && document.queryCommandSupported("copy")) {
var textarea = document.createElement("textarea");
textarea.textContent = text;