alexharv074 / scripts

miscellaneous scripts

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Scripts

A miscellaneous collection of scripts.

pp_to_yaml.pl

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

create_my_spec.rb

To use this:

  1. 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

make_jail.sh

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

gen_markdown_toc.rb

This has moved to its own project here.

git_change_author.sh

Change the author on all commits in a Git repo.

$ git_change_author.sh [NEW_EMAIL] OLD_EMAIL

DiffHighlight.pl

Copied from the Git source code here and converted to a standalone Perl script.

$ diff -u FILE1 FILE2 | perl DiffHighlight.pl

About

miscellaneous scripts


Languages

Language:Perl 46.8%Language:Puppet 30.8%Language:Shell 10.7%Language:Ruby 9.9%Language:HTML 1.9%