Skip to content

Instantly share code, notes, and snippets.

@bunchc
bunchc / console.out
Created December 26, 2016 14:57
Console output after rm -rf ~/.vagrant.d/
[bunchc@arngeir:~/.vagrant.d]
[08:52:13] $ rm -rf *
[bunchc@arngeir:~/.vagrant.d]
[08:52:23] $ vagrant plugin list
vagrant-share (1.1.6, system)
[bunchc@arngeir:~/.vagrant.d]
[08:53:24] $ vagrant plugin install vagrant-cumulus
Installing the 'vagrant-cumulus' plugin. This can take a few minutes...
oc login -u system:admin
cat <<-EOF > /tmp/pv.yaml
apiVersion: v1
kind: PersistentVolume
metadata:
name: pv0001
spec:
capacity:
storage: 1Gi
@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:
#
@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 / names.sh
Created March 8, 2017 13:44
Names for Noller
#!/bin/bash -
# For our random naming
export ADJS=(autumn hidden bitter misty silent empty dry dark summer icy delicate quiet white cool spring winter patient twilight dawn crimson wispy weathered blue billowing broken cold damp falling frosty green long late lingering bold little morning muddy old red rough still small sparkling shy wandering withered wild black young holy solitary fragrant aged snowy proud floral restless divine)
export NOUNS=(waterfall river breeze moon rain wind sea morning snow lake sunset pine shadow leaf dawn glitter forest hill cloud meadow sun glade bird brook butterfly bush dew dust field fire flower firefly feather grass haze mountain night pond darkness snowflake silence sound sky shape surf thunder violet water wildflower wave water resonance sun wood dream cherry tree fog frost voice paper)
sample() {
# Generate random name
eval "echo \${$1[\$RANDOM%\${#$1[@]}]}"
@bunchc
bunchc / ubuntu-14.04.json
Created March 8, 2017 16:52
packer template for ubuntu
{
"variables": {
"vsphere_host": "vcenter65-1.vghetto.local",
"vsphere_user": "administrator@vghetto.local",
"vsphere_pass": "VMware1!",
"vsphere_datacenter": "Datacenter",
"vsphere_cluster": "\"VSAN-Cluster\"",
"vsphere_datastore": "virtual_machines",
"vsphere_network": "\"VM Network\""
},
#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 / 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...

@bunchc
bunchc / domain_controller.ps1
Last active April 10, 2017 17:11
BoxStarter to bootstrap a simple Windows DC
$newDomainName="orangutan.local"
$newDomainNetBios="orangutan"
Set-ExplorerOptions -showHiddenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions
Enable-RemoteDesktop
# Install some useful packages
cinst git
cinst git-credential-winstore
cinst console-devel
@bunchc
bunchc / CSV.zip
Last active April 12, 2017 02:48
Build and Populate Windows AD