Skip to content

Instantly share code, notes, and snippets.

View DerekCrosson's full-sized avatar
💛
Blessed

Derek Crosson DerekCrosson

💛
Blessed
View GitHub Profile
@DerekCrosson
DerekCrosson / docker-compose.yml
Created December 4, 2023 22:12
WordPress Docker local environment
version: "3"
services:
mysql:
image: mariadb
ports:
- "3306:3306"
volumes:
- mysql_data:/var/lib/mysql
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
environment:
@DerekCrosson
DerekCrosson / 1-setup.md
Created August 30, 2023 12:45 — forked from troyfontaine/1-setup.md
Signing your Git Commits using GPG on MacOS

Methods of Signing with a GPG Key on MacOS

Last updated September 21, 2022

This Gist explains how to do this using gpg in a step-by-step fashion. Previously, krypt.co was heavily mentioned, but I've only recently learned they were acquired by Akamai and no longer update their previous free products. Those mentions have been removed.

For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing your commits with GPG.

There has been a number of comments on this gist regarding some issues around the pinentry-program and M1 Macs. I've finally gotten a chance to try things out on an M1 and I've updated the documentation in 2-using-gpg.md to reflect my findings.

@DerekCrosson
DerekCrosson / brew-list.sh
Created December 16, 2022 04:56 — forked from eguven/brew-list.sh
List all packages installed using Homebrew and their sizes
brew list --formula | xargs -n1 -P8 -I {} \
sh -c "brew info {} | egrep '[0-9]* files, ' | sed 's/^.*[0-9]* files, \(.*\)).*$/{} \1/'" | \
sort -h -r -k2 - | column -t
@DerekCrosson
DerekCrosson / gcp_compute_mount_persistent_disk.sh
Created August 17, 2022 20:48 — forked from raj-saxena/gcp_compute_mount_persistent_disk.sh
Use the following script to mount a persistent storage during startup. This is helpful when you provision the compute instance as well as the persistent disk using some automation tool like Terraform. StackOverFlow question - https://stackoverflow.com/questions/53162620/automate-gcp-persistent-disk-initialization
#!/bin/bash
set -uxo pipefail
# DISK_NAME = Name of the disk in terraform
# DEVICE_NAME = When $DISK_NAME is mounted in the compute instance at `/dev/`
MOUNT_DIR=/mnt/disks/persistent_storage
# Check if entry exists in fstab
grep -q "$MOUNT_DIR" /etc/fstab
@DerekCrosson
DerekCrosson / ethereum_deployment_sample.yml
Created August 1, 2022 17:34
A sample Github action to deploy to the Ethereum network
# This is a basic workflow to help you get started with Actions
name: Test & Deploy
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ main ]
pull_request:
branches: [ main ]
@DerekCrosson
DerekCrosson / Ansible_Assert.txt
Created June 8, 2022 08:48 — forked from dmccuk/Ansible_Assert.txt
Prove ansible did what is said it did!
-- Ansible testing using Assert
When we run Ansible to manage server configurations, we assume (if there is no red errors) that it worked. But if you are developing ansible modules for your systems, and want to take the DevOps approach and work on CICD pipelines, you need to have some tests in there to prove that what you asked ansible to do has actually worked.
One of the best ways to do this within ansible, is to use the Assert module. It asserts that a given expression is true. When you combine this with the output of a command that’s registered to a variable, there is almost no limit to what you can test.
I’m going to use the TDD (Test driven development) method where we create the tests before we start writing any ansible code to manage our systems. I expect the tests to fail. Then we’ll write ansible to pass the tests. That’s it.
This demo will cover the following:
• Create some tests using the command and assert modules.
@DerekCrosson
DerekCrosson / audit-on-push.yml
Created April 18, 2022 05:39 — forked from LukeMathWalker/audit.yml
GitHub Actions - Rust setup
name: Security audit
on:
push:
paths:
- '**/Cargo.toml'
- '**/Cargo.lock'
jobs:
security_audit:
runs-on: ubuntu-latest
steps:
@DerekCrosson
DerekCrosson / js-validation-git-pre-commit-hook.sh
Created April 13, 2022 18:24 — forked from tregoning/js-validation-git-pre-commit-hook.sh
Git pre-commit hook script that checks Javascript files against jshint
#!/bin/bash -
###############################################################################
# File: js-validation-git-pre-commit-hook.sh
#
# Description: Git pre-commit that checks your code for js errors before you commit it
#
# Prerequisites: jshint to install run: "npm install jshint -g"
#
# Instructions: Place this file in your project's .git/hooks renamed to "pre-commit"
# run: "chmod +x .git/hooks/pre-commit"
@DerekCrosson
DerekCrosson / deploy.sh
Created April 3, 2022 15:46 — forked from cagartner/deploy.sh
Laravel Push deploy Github actions example
#!/bin/sh
set -e
vendor/bin/phpunit
(git push) || true
git checkout production
git merge master
@DerekCrosson
DerekCrosson / Gemfile
Created March 25, 2022 20:04 — forked from caendekerk/Gemfile
Rails API only with Okta but without Devise
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 6.0.0'
# Shorten boot time
gem 'bootsnap'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', github: 'rails/jbuilder'