Skip to content

Instantly share code, notes, and snippets.

@aspring
aspring / Guardfile
Last active December 20, 2015 19:29
A General Guardfile to sit at the head of a Chef Repository. (Caveat: Nearly all of our cookbooks are developed in-house, and all internal cookbooks are prefixed with "devops_", which explains why we limit paths the way we do. We also have an internal cookbook named devops which adds another cog into the mix.)
spec_paths = Dir.glob(File.join("cookbooks", "devops_**", "spec"))
guard :rspec,
:spec_paths => spec_paths,
:cli => "--color --format nested --fail-fast",
all_on_start: false do
# If a spec changes, run it
watch(%r{^cookbooks/devops.*/spec/.+_spec\.rb$})
@aspring
aspring / removepersistentnetrules
Last active December 21, 2015 15:39
An init.d script that can be used to overcome the MAC address changes when copying a virtual machine. This has been tested on Centos. To utilize this script, add it to init.d, then link it to rc3.d: ln -s /etc/init.d/removepersistentnetrules /etc/rc.d/rc3.d/S99removepersistentnetrules
#!/bin/bash
FIRSTBOOT="/etc/.firstboot"
if [ ! -f $FIRSTBOOT ];
then
# Remove the first boot files
rm -f /etc/udev/rules.d/70-persistent-net.rules
# Restart the network service
service network restart
@aspring
aspring / Centos-6-AMI-Kickstart.ks
Last active June 8, 2017 13:35
Centos-6-AMI-Kickstart.ks
# This kickstart file is aimed towards creating a Centos 6.5 Amazon AMI
skipx
text
install
lang en_US.UTF-8
keyboard us
timezone America/New_York
auth --useshadow --enablemd5
@aspring
aspring / gist:d4498ca9072f91883329
Last active March 21, 2016 18:55
16-vmhgfs-f_dentry-kernel-4.4.1-1-tools-9.10.5.patch
diff --new-file -ur vmhgfs-only.orig/dir.c vmhgfs-only/dir.c
--- vmhgfs-only.orig/dir.c 2016-03-21 17:58:34.445862148 +0000
+++ vmhgfs-only/dir.c 2016-03-21 18:20:16.493803567 +0000
@@ -31,6 +31,7 @@
#include "compat_kernel.h"
#include "compat_slab.h"
#include "compat_mutex.h"
+#include "compat_dentry.h"
#include "cpName.h"
#!/usr/bin/env bash
# This script is loosely based off of: https://github.com/blalor/ami-creator/blob/master/utils/create-ami.sh
set -e -u
die() {
echo "$@"
exit 1
}
@aspring
aspring / influxdb_measurement_series_count_per_measurement.sh
Created August 9, 2019 03:08 — forked from endeepak/influxdb_measurement_series_count_per_measurement.sh
Influxdb : Print cardinality / series count per measurement
#!/usr/bin/env bash
if [ "$#" -ne 1 ]
then
echo "Usage: $0 <db_name>"
exit 1
fi
db_name=$1