A miscellaneous collection of scripts.
Convert the output of puppet resource into YAML data suitable for use in Hiera + create_resources()
.
puppet resource yumrepo | pp_to_yaml.pp > yumrepos.yaml
Note that this is useful in Puppet 3.x whereas in Puppet 4.x the --to_yaml
option has been added to puppet resource
. ref
To use this:
- Create
spec/classes/init_spec.rb
with the following content:
require 'spec_helper'
describe 'myclass' do
let(:params) do
{
:foo => 'bar',
}
end
it {
File.write('myclass.json',
PSON.pretty_generate(catalogue))
}
end
Then:
$ create_my_spec.rb myclass.json > spec/classes/init_spec.rb
Guesses the files required for a chroot'ed jail on Mac OS X.
Assumes you have the following line in sudoers:
%admin ALL = (ALL) NOPASSWD: /usr/sbin/chroot
This has moved to its own project here.
Change the author on all commits in a Git repo.
$ git_change_author.sh [NEW_EMAIL] OLD_EMAIL
Copied from the Git source code here and converted to a standalone Perl script.
$ diff -u FILE1 FILE2 | perl DiffHighlight.pl