Skip to content

Instantly share code, notes, and snippets.

View adamcrews's full-sized avatar

Adam Crews adamcrews

View GitHub Profile
@adamcrews
adamcrews / better-git-branch.sh
Last active February 22, 2024 16:44 — forked from schacon/better-git-branch.sh
Better Git Branch output
#!/usr/bin/env bash
# Inspired by: https://gist.github.com/schacon/e9e743dee2e92db9a464619b99e94eff
# https://www.youtube.com/watch?v=aolI_Rz0ZqY
# This version available from: https://gist.github.com/adamcrews/b39f7db45b920281942c179a4882fb18
# Install by copying this script to some local directory then add an alias to git:
# git config --global alias.bb '!<path_to_file>/better-branch.sh'
# Colors
@adamcrews
adamcrews / check_email.yaml
Last active July 17, 2023 17:19
github reject non-corp email
# .github/workflows/check_email.yml
jobs:
validate_email:
name: Validate email
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Extract author email
@adamcrews
adamcrews / certificate_synthetic.js
Created June 11, 2019 05:36
New Relic SSL/TLS Synthetic
/*
To use this synthetic, set the following Secure credentials:
NEW_RELIC_INSIGHTS_API_KEY - Your api key from the account settings.
NEW_RELIC_ACCOUNT_ID - Your account ID, also found in the account settings.
CERTS_TO_MONITOR - A list of hosts to check via https, separated by a comma and a space, for example:
host.example.com, foo.example.com
Create a new Synthetic monitor, copy the entire contents of this script to the monitor.
Set the monitor to run once a day from a single location.
@adamcrews
adamcrews / std_yumrepo.pp
Last active February 15, 2017 06:32
purgeable yumrepo
define std_yumrepo (
String $repo_name = $title,
Optional[Enum['absent', 'present', 'absent']] $ensure = present,
Optional[Variant[Enum['absent'], Pattern[/^(true|false|0|1|no|yes)$/]]] $assumeyes = absent,
Optional[Variant[Enum['absent'], Pattern[/^\d+[kMG]?$/]]] $bandwidth = absent,
Optional[String] $baseurl = absent,
Optional[Variant[Enum['absent'], Integer]] $cost = absent,
Optional[Variant[Enum['absent'], Integer]] $deltarpm_metadata_percentage = absent,
Optional[Variant[Enum['absent'], Integer]] $deltarpm_percentage = absent,
Optional[String] $descr = absent,
# Message to display to user after 'vagrant up' completes
config.vm.post_up_message = "Setup of 'vagrant-dspace' is now COMPLETE! DSpace should now be available at:\n\nhttp://localhost:#{CONF['port']}/xmlui/\n\nYou can login using '#{CONF['admin_email']}' with password '#{CONF['admin_passwd']}'.\nYou can also SSH into the new VM via 'vagrant ssh'"
@adamcrews
adamcrews / Vagrantfile
Last active August 29, 2015 14:09
Apache example
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "puppetlabs/ubuntu-14.04-64-puppet"
config.vm.provision "puppet" do |puppet|
Facter.add(:omd_version) do
confine :system_type => 'omd'
setcode do
stack = Facter.value('stack')
omddefault = %x{ omd versions |awk '/default/ {print $1}' }
%x{ basename $(readlink /omd/sites/#{stack}/version) }
end
end
@adamcrews
adamcrews / README.md
Last active August 29, 2015 14:02
GCE setup

The pe-easy-agent.sh script mentioned in the instance_defaults hash is available at pe-easy-agent.sh

NameVirtualHost <%= @vhost_name %>:<%= @port %>
<VirtualHost <%= @vhost_name %>:<%= @port %>>
ServerName <%= @servername %>
DocumentRoot <%= @docroot %>
<Directory <%= @docroot %>>
Options <%= @options %>
AllowOverride None
Order allow,deny
allow from all
</Directory>
@adamcrews
adamcrews / keybase.md
Last active December 3, 2019 21:33
keybase.md

Keybase proof

I hereby claim:

  • I am adamcrews on github.
  • I am doo (https://keybase.io/doo) on keybase.
  • I have a public key ASArJsXtndbm5JTOtYBC5_DCnXRKOfphcoydCqliWie4YQo

To claim this, I am signing this object: