Skip to content

Instantly share code, notes, and snippets.

Avatar
PRO

Gavin Staniforth gsdevme

PRO
View GitHub Profile
@gsdevme
gsdevme / quick-start-postgres-k3s.yaml
Last active Feb 4, 2021
quick-start-postgres for k3s (no docker)
View quick-start-postgres-k3s.yaml
# This is an auto-generated file. DO NOT EDIT
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: clusterworkflowtemplates.argoproj.io
spec:
group: argoproj.io
names:
kind: ClusterWorkflowTemplate
listKind: ClusterWorkflowTemplateList
View dnasmq-install.md

Install dnsmasq

brew install dnsmasq
cat << EOF > /usr/local/etc/dnsmasq.conf
#log-queries
View gist:de8fe52e8b07e15a3258081ac505d484
standard/epel:
pkg.installed:
- pkgs:
- epel-release
standard/install:
pkg.installed:
- pkgs:
- yum-cron
- deltarpm
View index.php
<?php
if(filter_var($_POST['uid'], FILTER_VALIDATE_INT)){//if integer
if((trim($_POST['search']) != '') && ($_POST['uid'] != '') && ($_POST['ip'] != '') && ($_POST['crpyt'] != '') && ($_POST['uid'] != '')){//if they dont equal ''
if(($_POST['crpyt'] == md5($_SERVER['REMOTE_ADDR'])) && ($_POST['ip'] == $_SERVER['REMOTE_ADDR'])){//if md5 hash on the users ip is ok still
include_once($_SERVER['DOCUMENT_ROOT'].'projects/GamePriceComparison/includes/config.php');//include configuration
include_once($root.'includes/preg.php');//includes function & data
include_once($root.'includes/sort.php');//includes function sort2d
//trim & set to vars
$search = trim($_POST['search']);//what the user typed in
View always-online-500.html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Scheduled maintenance | GANT</title>
<meta name="author" content="Gant" />
<meta name="robots" content="noindex, nofollow" />
<meta name="viewport" content="width=960,maximum-scale=1.0" />
<style type="text/css">
#container {
View always-online.html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Scheduled maintenance | GANT</title>
<meta name="author" content="Gant" />
<meta name="robots" content="noindex, nofollow" />
<meta name="viewport" content="width=960,maximum-scale=1.0" />
<style type="text/css">
#container {
@gsdevme
gsdevme / readme.md
Last active Mar 20, 2018
centos-mirror-on-raspberry-pi
View readme.md
sudo raspi-config --expand-rootfs && \
    sudo su - -c 'echo "CONF_SWAPSIZE=1000" > /etc/dphys-swapfile' && \
    sudo reboot

sudo apt-get update && \
    sudo apt-get upgrade -y

sudo apt-get install createrepo rsync avahi-daemon -y
View foobar.tf
variable "name" {}
variable "region" {
default = "eu-west-1"
}
variable "vpc_network" {
"default" = "10.0.0.0/16"
}
variable "public_subnets" {
View main.tf
// https://www.terraform.io/docs/providers/google/index.html
provider "google" {
region = "${var.region}"
project = "${var.project_name}"
}
// https://www.terraform.io/docs/providers/google/d/datasource_compute_network.html
resource "google_compute_network" "default" {
name = "ecom"
}
@gsdevme
gsdevme / controlller.php
Last active Sep 20, 2017
UUID at the controller level
View controlller.php
<?php
class CreateOrderController extends Controller
{
public function createOrderWithCustomer(array $order)
{
// Create the reference here because then we know it for the order and can async everything
$customerReference = uuid::uuid4()->toString();
// Validate `$order`