Skip to content

Instantly share code, notes, and snippets.

View aussielunix's full-sized avatar
🤠
G`Day

Mick Pollard aussielunix

🤠
G`Day
View GitHub Profile
@aussielunix
aussielunix / vpnc-script-sshd
Created January 24, 2013 00:45
alternate vpnc-script with some special ssh lurve
#!/bin/sh
#
# © 2009 David Woodhouse <dwmw2@infradead.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@aussielunix
aussielunix / node.pp
Last active December 13, 2015 20:29
how to set ordering at a node level. This includes ensuring your apt repo is installed before installing packages.
node default {
include mongo
# Apt::Source things must always happen before Package things
#
Apt::Source <| |> -> Package <| |>
# ensure your apt repo is available
# this is where I have graylog2 and elasticsearch packages
#
@aussielunix
aussielunix / cap_cli.rb
Last active December 14, 2015 04:09
consuming cap tasks from ruby proper
require 'capistrano/cli'
config = ::Capistrano::Configuration.new
# This loads up the tasks into the current scope
#
config.load 'tasks/foo.rb'
# run task 'foo'
#
#!/usr/bin/env bash
if [ $(/sbin/iptables -L INPUT | wc -l) -le 3 ]; then
exit 1
else
exit 0
fi
#!/usr/bin/env ruby
require 'rubygems'
require 'pp'
require 'fog'
require 'highline/import'
def get_password(prompt="Enter password:")
ask(prompt) {|q| q.echo = false}
end
@aussielunix
aussielunix / fog_vsphere_clone_vm.rb
Created April 1, 2013 08:28
fog_vsphere_clone_vm.rb
#!/usr/bin/env ruby
require 'fog'
require 'pp'
connection = Fog::Compute[:vsphere]
puts "Connected to #{connection.vsphere_server} as #{connection.vsphere_username} (API version #{connection.vsphere_rev})"
options = {
:datacenter => 'syd07',
@aussielunix
aussielunix / git-fixup-email.sh
Created May 3, 2013 11:46
git: change commit details
#!/bin/sh
git filter-branch -f --env-filter '
an="$GIT_AUTHOR_NAME"
am="$GIT_AUTHOR_EMAIL"
cn="$GIT_COMMITTER_NAME"
cm="$GIT_COMMITTER_EMAIL"
if [ "$GIT_COMMITTER_EMAIL" = "otter@example.com" ]
# Setup variables
BUNDLE_PATH=$JENKINS_HOME/jobs/$JOB_NAME/shared/bundle
# Setup dependencies
mkdir -p $BUNDLE_PATH
bundle install --path=$BUNDLE_PATH
bundle exec fpm-cook
#!/bin/sh
#
# An example hook script to verify what is about to be committed.
# Called by "git commit" with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
#
# To enable this hook, rename this file to "pre-commit".
echo "in git pre-commit hook"
@aussielunix
aussielunix / precise64.ks
Last active May 3, 2021 05:48
Ubuntu Precise amd64 kickstart with working LVM
#System language
lang en_AU
#Language modules to install
langsupport en_AU
#System keyboard
keyboard us
#System mouse