Skip to content

Instantly share code, notes, and snippets.

@popsikle
popsikle / chef_server_backup.rb
Created July 24, 2015 14:58
knife exec chef_server_backup.rb
#
# Author:: Joshua Timberman (<joshua@opscode.com>)
# Author:: Adam Jacob (<adam@opscode.com>)
# Author:: Salvatore Poliandro (<popsikle@gmail.com>)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
@popsikle
popsikle / .bash_profile
Created September 19, 2015 02:43
osx profiles
# Local profile
source ~/.profile
# Prrrrrommmmmpmppppttpttptpt
export PS1="\[$(tput setaf 5)\]\W\[$(tput setaf 1)\]]\[$(tput setaf 7)\]\\$ \[$(tput sgr0)\]"
export CLICOLOR=1
export LSCOLORS=ExFxCxDxBxegedabagacad
# Hist all things!
HISTFILESIZE=100000
@popsikle
popsikle / library.rb
Created September 22, 2015 21:10
mariadb_gem_requirements
module DBGems
module Mariadb
def mariadb_gem_requirements
system "apt-get install -y software-properties-common"
system "apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db"
system "add-apt-repository 'deb http://nyc2.mirrors.digitalocean.com/mariadb/repo/10.0/ubuntu trusty main'"
system "apt-get update -y"
system "apt-get install -y mariadb-client libmariadbclient-dev"
end
@popsikle
popsikle / edb.rb
Last active September 28, 2015 22:02
key_path = 'secret_key'
data_path = databags/test.json'
secret = Chef::EncryptedDataBagItem.load_secret(key_path.realpath)
data = JSON.parse(File.read(data_path.realpath))
encrypted_data = Chef::EncryptedDataBagItem.encrypt_data_bag_item(data, secret)
puts JSON.pretty_generate(encrypted_data)
plain_data = ::Chef::EncryptedDataBagItem.new(encrypted_data, secret).to_hash
#!/usr/bin/env bash
if ! type brew > /dev/null 2>&1 ; then
log_info "Installing Brew"
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
if [ -z "$BREW_PREFIX" ]; then
BREW_PREFIX=$(brew --prefix)
export PATH="${BREW_PREFIX}/bin:$PATH"
--- /usr/src/ixgbevf-2.16.1/src/kcompat.h.orig 2015-02-03 18:34:22.901474028 +0000
+++ /usr/src/ixgbevf-2.16.1/src/kcompat.h 2015-02-03 18:35:32.577440102 +0000
@@ -3219,8 +3219,6 @@
#define u64_stats_update_begin(a) do { } while(0)
#define u64_stats_update_end(a) do { } while(0)
#define u64_stats_fetch_begin(a) do { } while(0)
-#define u64_stats_fetch_retry_bh(a) (0)
-#define u64_stats_fetch_begin_bh(a) (0)
#if (RHEL_RELEASE_CODE && RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(6,1))
@popsikle
popsikle / Makefile
Created December 17, 2015 22:31
JSON to BSON conversion in C
all: json2bson
clean:
rm -f json2bson
json2bson: json2bson.c
${CC} $(shell pkg-config --cflags json libmongo-client glib-2.0) -Wall -O0 -ggdb3 -std=c99 ${CFLAGS} \
$(shell pkg-config --libs json libmongo-client glib-2.0) -o $@ $^
check: all
./json2bson <test.json >test.bson
@popsikle
popsikle / cloud-service.yaml
Created March 6, 2015 00:17
CoreOS Baremetal cluster cloud configs, worker and service nodes
#cloud-config
hostname: <%= shortname %>
ssh_authorized_keys:
- ssh-rsa xxxx rsa-key-20120604
coreos:
units:
- name: settimezone.service
command: start
@popsikle
popsikle / 00_wireless.sh
Created May 24, 2016 12:10
Outset boot-once scripts that wait for network.
#!/bin/bash
#
# This script sets up the Wireless Connection
#
# Sleeping for 30 seconds to allow the new default User Template folder to be moved into place
sleep 30
# Determine OS and build version, as well as serial number
@popsikle
popsikle / cloud-config.yaml
Last active March 30, 2017 02:24
docker_opts cloud config
#cloud-config
coreos:
units:
- name: docker.service
command: restart
content: |
[Unit]
Description=Docker Application Container Engine
Documentation=http://docs.docker.com