Skip to content

Instantly share code, notes, and snippets.

https://groups.google.com/forum/#!topic/puppet-dev/AbXgZEFl3ME
you can dump the entire catalogue to stdout with the following:
it { p subject.resources }
If you are interested in just the one resource, it is probably easier to use:
it { p subject.resource('User', 'foo') }
@spiette
spiette / vimrc
Last active September 28, 2015 02:58
Simple vimrc
set tabstop=4
set softtabstop=4
set shiftwidth=4
set expandtab
set smarttab
set wildmenu
set showcmd
set ignorecase
set smartcase
@spiette
spiette / .LESS_TERMCAP
Created July 5, 2012 04:14
less environment variables for colors in man pages
# to be sourced from .profile, .bash_profile or .bashrc
# http://unix.stackexchange.com/questions/119/colors-in-man-pages
export LESS_TERMCAP_mb=$(tput setaf 2) # green
export LESS_TERMCAP_md=$(tput bold; tput setaf 4) # blue
export LESS_TERMCAP_me=$(tput sgr0)
export LESS_TERMCAP_so=$(tput bold; tput setaf 7; tput setab 4) # white on blue
export LESS_TERMCAP_se=$(tput rmso; tput sgr0) # reset previous line
export LESS_TERMCAP_us=$(tput smul; tput bold;) # underlined and bold
export LESS_TERMCAP_ue=$(tput rmul; tput sgr0)
export LESS_TERMCAP_mr=$(tput rev)
class { 'apt':
always_autoupdate => true
}
Class['apt::update'] -> Package <| |>
@spiette
spiette / gist:5280394
Created March 31, 2013 12:01
yaml dump in rspec puppet
$stdout.puts self.catalogue.to_yaml
@spiette
spiette / gist:5448827
Created April 24, 2013 01:13
How to disable Esc (so you learn to use <Ctrl>-[ instead.
xmodmap -e "keycode 9=Ooblique"
#!/usr/bin/env python
import urllib2
import json
url = 'http://localhost:8080/v3/nodes'
r = urllib2.Request(url)
r.add_header('Accept', 'application/json')
u = urllib2.urlopen(r)
@spiette
spiette / desktop.pp
Created January 20, 2014 20:01
Very very [...] basic desktop setup manifest
case $::osfamily {
'RedHat': {
$vim = 'vim-enhanced'
$mtr = 'mtr'
}
'Debian': {
$vim = 'vim'
$mtr = 'mtr-tiny'
}
default: {

Keybase proof

I hereby claim:

  • I am spiette on github.
  • I am spiette (https://keybase.io/spiette) on keybase.
  • I have a public key whose fingerprint is 4191 7248 B2E0 C612 F7D2 4ECC 2E6E 40D4 0AFF CA06

To claim this, I am signing this object:

@spiette
spiette / Dockerfile
Last active May 16, 2016 19:03
Dockerfile to run Helianthus application
FROM centos:latest
MAINTAINER Simon Piette <simon.piette@savoirfairelinux.com>
RUN yum install --assumeyes sudo vim git ; yum clean all
RUN export uid=1000 gid=1000 && \
cp -a /etc/skel /home/user && \
echo "user:x:${uid}:${gid}:User,,,:/home/user:/bin/bash" >> /etc/passwd && \
echo "user:x:${uid}:" >> /etc/group && \
mkdir -p /etc/sudoers.d && \
echo "user ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/user && \
chmod 0440 /etc/sudoers.d/user && \