Skip to content

Instantly share code, notes, and snippets.

---
- name: Create a partition with drive letter D and size 1020 GiB
hosts: "{{host}}"
tasks:
- name: do the thing
win_partition:
drive_letter: D
partition_size: 1020 GiB
disk_number: 2
@bunchc
bunchc / gist:8afce8a4fe2f1bbaf352512a6a23a2bc
Created August 21, 2018 16:56 — forked from danielestevez/gist:2044589
GIT Commit to an existing Tag
1) Create a branch with the tag
git branch {tagname}-branch {tagname}
git checkout {tagname}-branch
2) Include the fix manually if it's just a change ....
git add .
git ci -m "Fix included"
or cherry-pick the commit, whatever is easier
git cherry-pick {num_commit}

Setting up netboot.xyz with an EdgeRouter

This document covers how to setup netboot.xyz, a service that provides iPXE-based installation and live boot of a bunch of operating systems, on a Ubiquiti EdgeRouter.

Assumptions

I've made a few assumptions throughout this document that will probably be different for your setup:

@bunchc
bunchc / gpg-import-and-export-instructions.md
Created April 5, 2017 14:36 — forked from chrisroos/gpg-import-and-export-instructions.md
Instructions for exporting/importing (backup/restore) GPG keys

Every so often I have to restore my gpg keys and I'm never sure how best to do it. So, I've spent some time playing around with the various ways to export/import (backup/restore) keys.

Method 1

Backup the public and secret keyrings and trust database

cp ~/.gnupg/pubring.gpg /path/to/backups/
cp ~/.gnupg/secring.gpg /path/to/backups/
cp ~/.gnupg/trustdb.gpg /path/to/backups/

or, instead of backing up trustdb...

#The command to run, built from the raw link of this gist
#START http://boxstarter.org/package/url?https://gist.github.com/bunchc/44e380258384505758b6244e615e75ed/raw/d648fffc21cb3cc7df79e50be6c05b05d29c79cc/0-SystemConfiguration.txt
#########################################
# Set Execution Policy #
#########################################
# Boxstarter options
$Boxstarter.RebootOk=$true # Allow reboots?
$Boxstarter.NoPassword=$false # Is this a machine with no login password?
@bunchc
bunchc / logger.sh
Created February 28, 2017 16:40
Bash Color Logging
# EasyColors
if [ ${libout_color:-1} -eq 1 ]; then
DEF_COLOR="\x1b[0m"
BLUE="\x1b[34;01m"
CYAN="\x1b[36;01m"
GREEN="\x1b[32;01m"
RED="\x1b[31;01m"
GRAY="\x1b[37;01m"
YELLOW="\x1b[33;01m"
fi
@bunchc
bunchc / screen_ssh.sh
Created February 22, 2017 16:34 — forked from res0nat0r/screen_ssh.sh
Set screen window title to remote host.
#!/bin/bash
# screen_ssh.sh by Chris Jones <cmsj@tenshu.net>
# Released under the GPL v2 licence.
# Set the title of the current screen to the hostname being ssh'd to
#
# usage: screen_ssh.sh $PPID hostname
#
# This is intended to be called by ssh(1) as a LocalCommand.
# For example, put this in ~/.ssh/config:
#
oc login -u system:admin
cat <<-EOF > /tmp/pv.yaml
apiVersion: v1
kind: PersistentVolume
metadata:
name: pv0001
spec:
capacity:
storage: 1Gi
@bunchc
bunchc / virt-addr.sh
Created October 11, 2016 16:06 — forked from kevteljeur/virt-addr.sh
Get a KVM guest's IP address
#!/bin/bash
# Returns the IP address of a running KVM guest VM
# Assumes a working KVM/libvirt environment
#
# Install:
# Add this bash function to your ~/.bashrc and `source ~/.bashrc`.
# Usage:
# $ virt-addr vm-name
# 192.0.2.16
#
@bunchc
bunchc / skypecall.py
Created August 9, 2016 20:50 — forked from pwc3/skypecall.py
Python script for Mac OS X to call a number in Skype then send an arbitrary DTMF string.
#!/usr/bin/env python
# Idea taken from:
# http://community.skype.com/t5/Mac/Re-Pause-option-when-dialing/td-p/731820
import argparse
import codecs
import re
import subprocess
import sys