Skip to content

Instantly share code, notes, and snippets.

View gilleyj's full-sized avatar
🎯
Focusing on stuff

Joel Gilley gilleyj

🎯
Focusing on stuff
View GitHub Profile
Onion
garlic
ginger root
lemon
tomato paste
thyme sprig
chicken stock
shallots
rosemary
creme fraiche

Keybase proof

I hereby claim:

  • I am gilleyj on github.
  • I am gilleyj (https://keybase.io/gilleyj) on keybase.
  • I have a public key whose fingerprint is 790A 5790 B474 ED32 75DD 0716 8882 7BF6 3DAC 3E2D

To claim this, I am signing this object:

@gilleyj
gilleyj / rotate.py
Last active January 18, 2019 15:07
A Lambda Function to set the desired count of running tasks in a service based on a cluster's containter instances.
#!/usr/bin/env python
"""
A Lambda Function to set the desired count of running tasks
in a service based on a cluster's containter instances.
Designed to be triggered by a CloudWatch Event rule.
"""
from __future__ import print_function
import os
@gilleyj
gilleyj / deadman.c
Last active January 18, 2019 15:09
A deadman's switch in C for a cronjob
/**
Original Request:
****
A dead man's switch is a switch that is automatically operated if the human operator
becomes incapacitated, such as through death, loss of consciousness, or being bodily
removed from control. Originally applied to switches on a vehicle or machine, it has
since come to be used to describe other intangible uses like in computer software.
In alerting systems such a control can be useful, for instance in the case that a
cron job or backup process doesn't complete.
@gilleyj
gilleyj / slackbot.sh
Created July 31, 2018 14:21
shell script to broadcast to slack channel
#!/bin/bash
# send message to slack channel
# define the boundaries after which the message will be sent will be sent as an attachment
# count "c" characters or "l" lines from stdin
stdin_check="l"
# define number of characters or lines from stdin
stdin_count="2"
# define usage function
@gilleyj
gilleyj / deis_setup.sh
Last active January 18, 2019 15:12
A shell script for help automating deis deployments in a CD environment... This would be the "initial" setup of the CD pipeline where needed things are installed and checked for.
#!/bin/bash
echo "DEIS integration setup...V0.6..."
# v0.6 - limit app name to 50 chars
# required variable testing blocks
if [ -z "$DEIS_HOME" ] || [ -z "$DEIS_USER" ] || [ -z "$DEIS_PASS" ]; then
echo "ERROR: missing DEIS env variables"
if [ -z "$DEIS_HOME" ]; then echo "Missing DEIS_HOME"; fi
if [ -z "$DEIS_USER" ]; then echo "Missing DEIS_USER"; fi
if [ -z "$DEIS_PASS" ]; then echo "Missing DEIS_PASS"; fi
@gilleyj
gilleyj / deis_deploy.sh
Last active January 18, 2019 15:13
A shell script for help automating deis deployments in a CD environment... This would be the "second stage" where the project is delivered and a notification sent to slack...
#!/bin/bash
echo "DEIS deploy...V0.5..."
# v0.5 limit app name to 50 chars
# check for deis
deis_cmd=$(which deis)
if [ -z "${deis_cmd}" ] || [ ! -x ${deis_cmd} ] ; then
echo "DEIS command does not exist, please run the deis_setup earlier in your deploy build..."
exit 1
fi
@gilleyj
gilleyj / Vagrantfile
Created August 15, 2018 19:23
for zee puppets
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.synced_folder "./", "/etc/puppet/"
config.vm.box = "mvbcoding/awslinux"
config.vm.provision :shell, :inline => "sudo rpm -ivh https://yum.puppetlabs.com/puppetlabs-release-el-5.noarch.rpm"
config.vm.provision :shell, :inline => "sudo yum install --disableplugin=priorities --enablerepo=puppetlabs-products -y puppet-3.3.0-1.el5.noarch ruby1.8"
config.vm.provision :shell, :inline => "sudo update-alternatives --set ruby /usr/bin/ruby1.8"
config.vm.provision :shell, :inline => "echo base > /etc/ROLE"
@gilleyj
gilleyj / array_merge.c
Last active November 29, 2018 17:57
C solution for merging two given *SORTED* arrays
//
// solve the problem joel ...
//
// compile & test with: cc array_merge.c -o testit && testit
//
#include <stdio.h>
int main() {
# -*- coding: utf-8 -*-
# Gunicorn(v19.3) Configuration File
# Reference - http://docs.gunicorn.org/en/19.3/settings.html
#
# To run gunicorn by using this config, run gunicorn by passing
# config file path, ex:
#
# $ gunicorn --config=gunicorn.py MODULE_NAME:VARIABLE_NAME
#