Skip to content

Instantly share code, notes, and snippets.

View NickCrew's full-sized avatar

Nick Ferguson NickCrew

View GitHub Profile
@NickCrew
NickCrew / live-snap.sh
Created August 22, 2018 17:58
Libvirt Live Snapshot with Block Commit
#!/bin/bash
#
# Take an external snapshot with virsh using live block commit feature
#
# Usage: ./snap domain-name backup-destination prune_lvl(integer)
#
# Creates log collection directory in backup-destination
#
# PRUNE_LVL variable determines how many snapshots will be kept for each
# domain. 4 is the default.
@NickCrew
NickCrew / settings.json
Last active February 14, 2019 17:02
vscode config
{
"powershell.codeFormatting.openBraceOnSameLine": false,
"powershell.codeFormatting.newLineAfterCloseBrace": false,
"powershell.codeFormatting.newLineAfterOpenBrace": true,
"powershell.codeFormatting.whitespaceBeforeOpenBrace": true,
"powershell.codeFormatting.whitespaceBeforeOpenParen": true,
"powershell.codeFormatting.whitespaceAroundOperator": true,
"powershell.codeFormatting.whitespaceAfterSeparator": true,
"powershell.codeFormatting.ignoreOneLineBlock": false,
"powershell.codeFormatting.preset": "Custom",
@NickCrew
NickCrew / .vimrc
Created October 26, 2018 21:21
.vimrc for Windows
call plug#begin()
Plug 'scrooloose/nerdtree'
Plug 'mbbill/undotree'
Plug 'unblevable/quick-scope'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'chriskempson/base16-vim'
Plug 'jremmen/vim-ripgrep'
Plug 'ervandew/supertab'
call plug#end()
@NickCrew
NickCrew / preseed.cfg
Created December 1, 2018 16:23
Ubuntu 18.04 Preseed
# Ubuntu 18.04 preseed config
# Larry Smith Jr.
# @mrlesmithjr
# http://everythingshouldbevirtual.com
### Localization
d-i debian-installer/locale string en_US
d-i console-setup/ask_detect boolean false
d-i keyboard-configuration/layoutcode string us
@NickCrew
NickCrew / ks.cfg
Created December 1, 2018 16:24
(Red Hat) Kickstart - Auto-partition
#version=DEVEL
# System authorization information
auth --enableshadow --passalgo=sha512
# Use CDROM installation media
#cdrom
# Run the Setup Agent on first boot
firstboot --disable
ignoredisk --only-use=vda
# Keyboard layouts
keyboard --vckeymap=us --xlayouts='us'
@NickCrew
NickCrew / ks.cfg
Created December 1, 2018 16:25
(Red Hat) Kickstart Snippet - Single Partition
part pv.008002 --size=1 --grow --ondisk=sda
volgroup VolGroup --pesize=4096 pv.008002
logvol swap --name=lv_swap --vgname=VolGroup --size=2016 --maxsize=2016
logvol / --name=lv_root --vgname=VolGroup --fstype=ext4 --grow --size=1
part /boot --fstype=ext4 --size=500
@NickCrew
NickCrew / preseed.cfg
Created December 1, 2018 16:26
Ubuntu 16.04 Preseed
# Ubuntu 16.04 preseed config
# Larry Smith Jr.
# @mrlesmithjr
# http://everythingshouldbevirtual.com
### Localization
d-i debian-installer/locale string en_US
d-i console-setup/ask_detect boolean false
d-i keyboard-configuration/layoutcode string us
@NickCrew
NickCrew / ks.cfg
Created December 1, 2018 16:26
(Fedora Atomic) Kickstart Snippet
ostreesetup --osname="fedora-atomic" --remote="fedora-atomic" --url="file:///ostree/repo" --ref="fedora/28/x86_64/atomic-host" --nogpg
%post --erroronfail
rm -f /etc/ostree/remotes.d/fedora-atomic.conf
ostree remote add --set=gpg-verify=true --set=gpgkeypath=/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-28-primary fedora-atomic 'https://dl.fedoraproject.org/atomic/repo/'
cp /etc/skel/.bash* /root
@NickCrew
NickCrew / .vimrc
Created December 1, 2018 16:27
Vim Virtualenv Support
" Add the virtualenv's site-packages to vim path
if has('python')
py << EOF
import os.path
import sys
import vim
if 'VIRTUAL_ENV' in os.environ:
project_base_dir = os.environ['VIRTUAL_ENV']
sys.path.insert(0, project_base_dir)
activate_this = os.path.join(project_base_dir, 'bin/activate_this.py')
@NickCrew
NickCrew / check_mk_install.sh
Created December 1, 2018 16:28
Install Check_MK and LibreNMS
#!/bin/bash
set -e
git clone https://github.com/librenms/librenms-agent.git /opt/librenms-agent
cp /opt/librenms-agent/check_mk_agent /usr/bin/check_mk_agent
mkdir -p /usr/lib/check_mk_agent/plugins
mkdir -p /usr/lib/check_mk_agent/local