Skip to content

Instantly share code, notes, and snippets.

View alistaircol's full-sized avatar
🛑
Stuck at a breakpoint

Ally alistaircol

🛑
Stuck at a breakpoint
View GitHub Profile
#!/bin/bash
R="\x1b[31m"
G="\x1b[32m"
Y="\x1b[33m"
B="\x1b[34m"
W="\x1b[37m"
CLR="\x1b[0m"
if [ "$#" -eq 1 ]; then
echo -e $B"Creating virtual host and structure for: $1."$CLR
@alistaircol
alistaircol / build.yml
Last active December 16, 2020 12:21
github-action-php-tcpdf-build-release-on-tag
name: 'Build & Release'
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
@alistaircol
alistaircol / sample.php
Created September 12, 2020 10:50
MongoDB & PHP Integration
<?php
use MongoDB\BSON\ObjectId;
use MongoDB\Collection;
use MongoDB\Database;
use MongoDB\Model\BSONDocument;
class SemiUnstructuredData
{
public function testMongodb()
@alistaircol
alistaircol / fixtures.sh
Created December 8, 2020 18:28
Simple bash script to dump schema structure, select tables and data
#!/usr/bin/env bash
# --column-statistics=0: https://serverfault.com/a/912677/530593
DUMP_COMMAND="mysqldump \
--column-statistics=0 \
--host=db.ac93.uk \
--user=user \
--password=password"
function dump_crm_structure
{
@alistaircol
alistaircol / create-site.tf
Last active December 15, 2020 21:09
Terraform Create S3 Bucket & Add Cloudflare CNAME
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 2.70"
}
cloudflare = {
source = "cloudflare/cloudflare"
version = "~> 2.0"
}
@alistaircol
alistaircol / buckets.tf
Created February 20, 2021 18:20
Terraform: Minio
resource "minio_s3_bucket" "ac_website" {
bucket = "ac-website"
acl = "public"
}
@alistaircol
alistaircol / inputs.tf
Created February 20, 2021 18:23
Terraform: Graylog
resource "graylog_input" "syslog_udp" {
title = "syslog"
type = "org.graylog2.inputs.syslog.udp.SyslogUDPInput"
global = true
attributes = jsonencode({
bind_address = "0.0.0.0"
port = 514
recv_buffer_size = 262144
decompress_size_limit = 8388608
@alistaircol
alistaircol / docker-compose.yml
Created February 20, 2021 19:21
docker-compose.yml
# docker run --rm -v $(pwd):/data cytopia/yamlfmt -w docker-compose.yml
version: '3.4'
services:
mailhog:
image: mailhog/mailhog:latest
ports:
- 1025:1025
- 8025:8025
minio:
@alistaircol
alistaircol / CommandListenerProvider.php
Created June 21, 2021 20:01
CommandListenerProvider
<?php
namespace App\Providers;
use Event;
use Illuminate\Console\Events\CommandStarting;
use Illuminate\Database\Events\MigrationsEnded;
use Illuminate\Support\ServiceProvider;
class CommandListenerProvider extends ServiceProvider
@alistaircol
alistaircol / Dockerfile
Created July 7, 2021 19:39
Image with default tailwindcss tailwind config viewer multi-stage build exporting static output to be hosted by a caddy server
# build
# docker build --force-rm --tag=alistaircol/tcv .
# run
# docker run --rm -it -p 9999:80 alistaircol/tcv:latest
FROM node:16-alpine AS build
WORKDIR /usr/src/app
RUN npm install tailwindcss tailwind-config-viewer; \
npx tailwindcss init --jit --full; \
npx tailwind-config-viewer export tcv-out