Skip to content

Instantly share code, notes, and snippets.

View adamcrews's full-sized avatar

Adam Crews adamcrews

View GitHub Profile
#! /usr/bin/env ruby
require 'rubygems'
require 'sinatra/base'
require 'webrick'
#require 'webrick/https'
#require 'openssl'
require 'resolv'
require 'json'
#!/bin/bash
#
# webhooks Manage webhooks service
#
# chkconfig: 2345 55 25
# description: Stupidsimple webhooks implementation.
#
# This is a pretty cruddy init script.
# source function library
@jtopjian
jtopjian / puppet-bootstrap.sh
Last active February 20, 2020 11:48
Bash script to bootstrap a Puppet Server
#!/bin/bash
# Set up acng client
echo "Acquire::http { Proxy \"http://acng-yyc.cloud.cybera.ca:3142\"; };" > /etc/apt/apt.conf.d/01-acng
# Set up proper hostname
echo 127.0.1.1 $(hostname).example.com $(hostname) >> /etc/hosts
# Installing curl and wget
apt-get update
@jirutka
jirutka / pg_change_db_owner.sh
Last active February 6, 2024 20:01
Some convenient scripts to manage ownerships and privileges in PostgreSQL.
#!/bin/sh
#
# The MIT License
#
# Copyright 2014-2017 Jakub Jirutka <jakub@jirutka.cz>.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
#!/usr/bin/env bash
set -o errtrace
set -o errexit
facter_version=$1
puppet_version=$2
hiera_version=$3
target_volume=$4
@drhuffman12
drhuffman12 / gem-fetch-dependencies.rb
Last active April 12, 2018 12:40 — forked from Milly/gem-fetch-dependencies
Extend 'gem fetch' command. Fetch all dependencies. Handles OS (Windows vs non-Windows) and Ruby Platform (JRuby vs Ruby).
#!/usr/bin/ruby
=begin
## USAGE:
# Ruby:
ruby gem-fetch-dependencies.rb fetch <gem_name> --dependencies
# JRuby:
jruby gem-fetch-dependencies.rb fetch <gem_name> --dependencies
@ganeshmaharaj
ganeshmaharaj / get-kube-info-with-curl.md
Last active June 15, 2021 20:59
Access Kube API with curl
@jonlabelle
jonlabelle / compare_versions.sh
Last active October 6, 2023 19:02
Compare Semver Versions in Bash
#!/usr/bin/env bash
#
# Performs a simple semver comparison of the two arguments.
#
# Original: https://github.com/mritd/shell_scripts/blob/master/version.sh
# Snippet: https://jonlabelle.com/snippets/view/shell/compare-semver-versions-in-bash
# Gist: https://gist.github.com/jonlabelle/6691d740f404b9736116c22195a8d706
#