Skip to content

Instantly share code, notes, and snippets.

@warlord0
warlord0 / maintenance
Last active Feb 25, 2021
Icinga2 Bash Script for Downtime
View maintenance
#!/bin/bash
# Icinga2 Maintenance mode / Downtime
#
# https://icinga.com/docs/icinga2/latest/doc/12-icinga2-api/#icinga2-api-actions
# Program details
PROGNAME=$(basename $0)
RELEASE="Revision 1.0.0"
AUTHOR="(c) 2020 Paul Bargewell (paul.bargewell@opusvl.com)"
@warlord0
warlord0 / template.sh
Last active Nov 9, 2020
Bash Script Template
View template.sh
#!/bin/bash
EXAMPLE="example default"
# Plugin variable description
PROGNAME=$(basename $0)
RELEASE="Revision 1.0.0"
AUTHOR="(c) 2020 Warlord0"
# Functions plugin usage
@warlord0
warlord0 / entry.sh
Created Jan 28, 2020
docker-sshd-rssh
View entry.sh
#!/usr/bin/env bash
set -e
[ "$DEBUG" == 'true' ] && set -x
DAEMON=sshd
echo "> Starting SSHD"
@warlord0
warlord0 / 00-nuxtjs.conf
Last active Oct 2, 2019
Nginx sites-available config for Nuxt.js and Laravel
View 00-nuxtjs.conf
map_hash_max_size 262144;
map_hash_bucket_size 262144;
map $sent_http_content_type $expires {
"text/html" epoch;
"text/html; charset=utf-8" epoch;
default off;
}
server {
@warlord0
warlord0 / FireSyncObserver.php
Created Sep 30, 2019
FireSyncObserver - Synchronise a Laravel Model with Firebase
View FireSyncObserver.php
<?php
/**
* FireSync Observer
*
* Watch for changes and replicate them to the Firebase database
*
* PHP Version 7.1
*
* @category Observer
* @package Firebase
@warlord0
warlord0 / esriFunctions.js
Last active Apr 8, 2019
ESRI ArcGIS Vue Mixin
View esriFunctions.js
import {
loadScript,
loadModules
} from 'esri-loader'
// preload the ArcGIS API
const options = {
url: '//js.arcgis.com/3.27/',
}
@warlord0
warlord0 / config.xml
Created Oct 1, 2018
Crucible config.xml with Reverse Proxy using https
View config.xml
<config control-bind="127.0.0.1:8059" version="1.0">
<!-- see example-config.xml and config.xsd for more documentation -->
<web-server context="/crucible" site-url="https://jira.domain.local/crucible">
<http bind=":8060" proxy-host="jira.domain.local" proxy-port="443" proxy-scheme="https"/>
</web-server>
<security allow-anon="true" allow-cru-anon="true"/>
<repository-defaults>
<linker/>
<allow/>
<tarball enabled="false" maxFileCount="0"/>
@warlord0
warlord0 / .babelrc
Last active Sep 22, 2018
React / Webpack template
View .babelrc
{
"presets":[
"@babel/preset-env", "@babel/preset-react"
]
}
@warlord0
warlord0 / WSDLController.php
Created Aug 17, 2018
Laravel Controller for Lagan Web Services SOAP API (Version 2)
View WSDLController.php
<?php
namespace App\Http\Controllers\Lagan;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
// We need Guzzle for the POST requests
use GuzzleHttp\Exception\GuzzleException;
use GuzzleHttp\Client;
@warlord0
warlord0 / WSDLController.php
Created Aug 17, 2018
Laravel Controller for Lagan Web Services SOAP API
View WSDLController.php
<?php
namespace App\Http\Controllers\Lagan;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
// We need Guzzle for the POST requests
use GuzzleHttp\Exception\GuzzleException;
use GuzzleHttp\Client;