Skip to content

Instantly share code, notes, and snippets.

View dlundgren's full-sized avatar

David Lundgren dlundgren

View GitHub Profile
@dlundgren
dlundgren / sslcrl.check.sh
Last active August 16, 2022 16:30
Zabbix check for CRLs
#!/bin/sh
#
# script: sslcrl.check
# version: 1.0
# author: David Lundgren <dlundgren@syberisle.net>
# description: Checks the given CRL for data
# license: MIT
#
# DETAIL:
# This script uses curl to get the CRL located at the URL, and then openssl to check the CRL attributes.
@dlundgren
dlundgren / setup-ezjail.yml
Last active January 11, 2021 15:34
Sets up ezjail for molecule testing
---
- name: install python
raw: test -e /usr/local/bin/python || (pkg install -y python)
changed_when: False
- name: reload facts
setup:
#
# Instructions for setting up a jail
<?php
namespace Assets;
use Assetic\Asset\AssetCollection;
use Assetic\Asset\AssetReference;
use Assetic\AssetManager;
class ResolveDependencies
{
@dlundgren
dlundgren / generate-cacert
Created September 3, 2020 17:41
Make Mac OS keychain certs available to Brewed python3
#!/bin/sh
CERT_PATH=$(python3 -m certifi)
security find-certificate -a -p /Library/Keychains/System.keychain > ${CERT_PATH}
security find-certificate -a -p /System/Library/Keychains/SystemRootCertificates.keychain >> ${CERT_PATH}
@dlundgren
dlundgren / check_aad_sync_status.py
Last active September 25, 2019 09:33
Nagios plugin for checking Azure AD Sync status in Office 365
#!/usr/bin/env python
#
# Checks the Azure AD Connect status in Office 365
#
# The user used to check the Azure AD Connect status needs to be an Administrator of some sort
#
# Setup:
# pip install mechanize
#
# Usage:
@dlundgren
dlundgren / zabbix-slack.php
Last active March 21, 2019 23:46
Slackify the Zabbix alerts
#!/usr/bin/env php
<?php
/**
* Slackify Zabbix Alerts
*
* @copyright 2019, David Lundgren <dlundgren@syberisle.net>
* @license MIT
*/
function get_key($argv, $pos, $shopts, $lopts)
{
@dlundgren
dlundgren / manual-gs-9.25.yml
Created December 7, 2018 02:34
ghostscript 9.25 on Ubuntu 16.04
---
- hosts: all
gather_facts: no
become: yes
vars:
packages_manual:
- libgs9-common_9.25~dfsg+1-0ubuntu0.16.04.3_all.deb
- libgs9_9.25~dfsg+1-0ubuntu0.16.04.3_amd64.deb
- ghostscript_9.25~dfsg+1-0ubuntu0.16.04.3_amd64.deb
tasks:
@dlundgren
dlundgren / ContextResolver.php
Last active December 20, 2017 03:29
Contextual Resolver for Aura.DI
<?php
/**
*
* This file is part of Aura for PHP.
*
* @license http://opensource.org/licenses/MIT MIT
*
*/
use Aura\Di\Resolver\Resolver;
@dlundgren
dlundgren / IsStaticProxy.php
Created February 27, 2017 08:30
Static Proxy trait
<?php
/**
* Simple static proxy trait
*
* Aura DI is used for lazy loading
*
* Set `const PROXY_IDENTIFIER = "SomeClass" in your proxy class, and use this trait.
*
* Call `Some\Proxy\SomeClass::register(new SomeClassInstance)` to have it register the alias.
*
@dlundgren
dlundgren / MemoryFile.php
Last active February 15, 2017 16:00
Emulated file stream that is Unicode aware
<?php
namespace Feral;
/**
* Represents the given contents as a file.
*
* Uses the php://memory system to handle this
*
* @package Feral
*/