Skip to content

Instantly share code, notes, and snippets.

View big-samantha's full-sized avatar

Samantha Smith big-samantha

View GitHub Profile
@big-samantha
big-samantha / Code Manager Nuclear Option.md
Last active October 26, 2018 15:06
How to completely wipe your code manager install and resync from scratch.

The best way to ensure we completely address this would be to just clear the File Sync cache. To do so:

  1. On the master, shutdown the pe-puppetserver service: service pe-puppetserver stop

  2. On the master, delete all the files inside /etc/puppetlabs/code, and /etc/puppetlabs/code-staging including all hidden files, leaving only the production environment:

# find /etc/puppetlabs/code -mindepth 1 -delete
# mkdir -p /etc/puppetlabs/code/environments/production
# mv /etc/puppetlabs/code-staging /etc/puppetlabs/code-staging.old
@big-samantha
big-samantha / example.pp
Created October 25, 2016 01:01
Control a command with a variable or class parameter in Puppet
# Run a command saved as a variable:
$desired_command = '/bin/ls -ld /etc'
exec { 'some arbitrary command':
command => $desired_command,
}
# Run a command inside a class, with a parameter to control the command:
class oracle::setup (
class apache (
$package = $apache::params::package,
) inherits apache::params {
package { 'apache':
name => $package,
}
}
class apache::params (
case $osmajrelease {
---
roles:
vim-mode:
provisioners:
- type: shell
inline: |
yum install -y vim
echo 'set -o vi' > /etc/profile.d/setovi.sh
echo 'set editing-mode vi' > /etc/profile.d/seteditvi.sh
echo 'export EDITOR=vim' > /etc/profile.d/editorvim.sh
case $::osfamily {
'debian' {
case $::operatingsystemmajrelease {
'8': { }
'7': { }
}
}
'redhat' {
case $::operatingsystemmajrelease {
'7': { }
@big-samantha
big-samantha / dbadmins.pp
Created July 19, 2016 20:54
dbadmins.pp
class system::dbadmins {
require mysql::server
mysql_user { 'zack@localhost':
ensure => present,
max_queries_per_hour => 1200,
}
mysql_user { 'monica@localhost':
ensure => present,
max_queries_per_hour => 600,
}
$mounts = hiera('autofs::mountpoint')
notify { 'mounts':
message => $mounts,
}
@big-samantha
big-samantha / Puppet Debugging Kit on Windows.md
Last active January 31, 2017 22:10
Puppet Debugging Kit on Windows

Running the Puppet Debugging Kit on Windows

Up and running with Vagrant, VirtualBox and the Puppet Debugging Kit on Windows.

Why?

Running the Puppet Debugging Kit on Windows is fairly straightforward, in that the setup process is nearly identical to setup on OSX and Linux.

However, the typical "Vagrant on Windows" caveats apply.

I've attempted to cover the entire setup process here, going from a system with no virtualization tools installed, to a working Vagrant + Oscar + Puppet Debugging Kit environment

# class tomcat
# class java
# modules/profiles
# modules/profiles/java_webapp.pp
class profiles::java_webapp {
require java
class { 'tomcat':
enable_special_feature => true,

I had a hell of a time getting my volume keys to work in i3 4.12 + Ubuntu 16.04

Mute toggle worked, but the unmute + volume raise/lower would only unmute master, and not "speaker".

The following worked to ensure that raising or lowering the volume also unmutes master AND speaker.

bindsym XF86AudioRaiseVolume exec amixer -q -D pulse -c 1 -q sset Master 2dB+ unmute && amixer -D pulse set Master unmute
bindsym XF86AudioLowerVolume exec amixer -q -D pulse -c 1 -q sset Master 2dB- unmute && amixer -D pulse set Master unmute
bindsym XF86AudioMute exec amixer -q -D pulse sset Master toggle