Skip to content

Instantly share code, notes, and snippets.

View hunner's full-sized avatar

Hunter Haugen hunner

View GitHub Profile
require 'json'
class Hunner
end
class Hunner::Render < Redcarpet::Render::Base
# Add manifest introspection for parameters
# Do we really want hash keys?
# Error on duplicate keys
# Define a spec which they should adhere to (Check against rendered structure)
attr_accessor :last_header
attr_accessor :last_level
include postgresql::server
# fails because you can't override from outside a class
Fail['/var/lib/postgresql9.5/datadir'] {
mode => '0755',
}
# succeeds because inheritance lets you override, but inheritance is spaghetti code
class test inherits postgresql::server::initdb {
File['/var/lib/postgresql9.5/datadir'] {
mode => '0755',
$file_defaults = {
mode => '0600',
owner => 'root',
group => 'root',
ensure => file,
}
file {'/etc/ssh_host_dsa_key':
* => $file_defaults,
}
file { '/etc/ssh_host_key':
(gdb) print Window->Application->Name
$4 = {<std::__1::__basic_string_common<true>> = {<No data fields>},
__r_ = {<std::__1::__libcpp_compressed_pair_imp<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__rep, std::__1::allocator<char>, 2>> = {<std::__1::allocator<char>> = {<No data fields>}, __first_ = {{__l = {__cap_ = 29680635209667340, __size_ = 0,
__data_ = 0x0}, __s = {{__size_ = 12 '\f', __lx = 12 '\f'},
__data_ = "Safari", '\000' <repeats 16 times>}, __r = {__words = {29680635209667340,
0, 0}}}}}, <No data fields>}, static npos = 18446744073709551615}
@hunner
hunner / transition.txt.asc
Created May 7, 2016 04:56
OpenPGP transition statement
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1,SHA512
Sat May 7 04:34:52 UTC 2016
I've recently set up a new OpenPGP key and will be transitioning away from my
old one.
The old key will be valid for a little while, but I prefer all future
correspondence to use the new one. I would also like this new key to be
HOSTS:
genericnode:
roles:
- default
platform: el-7-x86_64
hypervisor: none
ip: 127.0.0.1
CONFIG:
type: foss
set_env: false
HOSTS:
ubuntu-1404-x64-master:
roles:
- master
- agent
- dashboard
- database
platform: ubuntu-1404-x86_64
hypervisor: vagrant
box: puppetlabs/ubuntu-14.04-64-nocm
@hunner
hunner / openpilot to cleanflight
Last active February 12, 2016 22:17
Custom motor mappings
mixer custom
mmix reset
mmix 0 1 1 -1 -1
mmix 1 1 -1 -1 1
mmix 2 1 -1 1 -1
mmix 3 1 1 1 1
@hunner
hunner / xbacklight.sh
Created November 2, 2015 18:32
xbacklight shell script replacement for gmux (ie, apple macbook pro)
#!/bin/sh
brightness=$(cat /sys/class/backlight/gmux_backlight/brightness)
if [ $1 = '-inc' ] ; then
newbrightness=$(expr $brightness + $2 \* 3)
elif [ $1 = '-dec' ] ; then
newbrightness=$(expr $brightness - $2 \* 3)
fi
if [ $newbrightness -lt 0 ] ; then
# Find the type of a given profile in the profile cache, or if it is not found
# try reloading the cache and looking again.
def self.find_profile_type(profile)
profiles = @@profile_cache ||= sort_profiles
if profiles[profile]
profiles[profile]
else
@@profile_cache = sort_profiles
@@profile_cache[profile]
end