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
Assuming 64bit x86 architecture (most common), download the "Standard" x86_64 from here:
https://alpinelinux.org/downloads/
Direct Link:
https://dl-cdn.alpinelinux.org/alpine/v3.14/releases/x86_64/alpine-standard-3.14.2-x86_64.iso
It's a very small iso, <200MB.
Booting should be quick in a VM and it'll prompt you to `login:`
Login with `root`, it will not ask for a password. next you will want to run `setup-alpine`. I'll follow this
# -*- 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
#
@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() {
@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 / 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 / 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 / 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 / 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 / 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

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: