Skip to content

Instantly share code, notes, and snippets.

View REBELinBLUE's full-sized avatar

Stephen Ball REBELinBLUE

  • LendInvest
  • London
View GitHub Profile
@mbierman
mbierman / addremotesyslog.sh
Last active February 28, 2024 21:55
Add a remote syslog server to Firewalla
#!/bin/bash
# v 2.1.0
syslog=/etc/rsyslog.d/09-externalserver.conf
# this logs notice and above. use *.* log everything.
filter=*.notice
server=192.168.0.19 # Change the server to the IP of your syslog server.
port=514
hostname=firewalla
valid=$(grep "$server:$port" $syslog 2>/dev/null)
@richadams
richadams / pd_aws_config_event_transformer.js
Created February 9, 2018 22:55
PagerDuty Custom Event Transformer for handling AWS Config compliance events from SNS. Raising incidents if a resource goes non-compliant, and resolving the incident if they go compliant again (or are deleted).
// Parses AWS Config events from SNS and will raise PagerDuty incidents if resources
// go non-compliant, resolving the incident when they return to compliant.
//
// This file is intended to be used with a PagerDuty Custom Event Transformer.
// https://www.pagerduty.com/docs/guides/custom-event-transformer/
//
// Create a new Custom Event Transformer integration in PagerDuty, and subscribe it's
// Integration URL on the SNS Topic that you send AWS Config events to.
//
// You can see all the different notifications Config sends here:
@ColinLeverger
ColinLeverger / update-images.sh
Created December 8, 2016 11:36
Update all Docker images
docker images | grep -v REPOSITORY | awk '{print $1}' | xargs -L1 docker pull
@ericclemmons
ericclemmons / example.md
Last active February 22, 2024 16:18
HTML5 <details> in GitHub

Using <details> in GitHub

Suppose you're opening an issue and there's a lot noisey logs that may be useful.

Rather than wrecking readability, wrap it in a <details> tag!

<details>
 Summary Goes Here
@Faheetah
Faheetah / Jenkinsfile.groovy
Last active March 6, 2024 18:14
Jenkinsfile idiosynchrasies with escaping and quotes
node {
echo 'Results included as an inline comment exactly how they are returned as of Jenkins 2.121, with $BUILD_NUMBER = 1'
echo 'No quotes, pipeline command in single quotes'
sh 'echo $BUILD_NUMBER' // 1
echo 'Double quotes are silently dropped'
sh 'echo "$BUILD_NUMBER"' // 1
echo 'Even escaped with a single backslash they are dropped'
sh 'echo \"$BUILD_NUMBER\"' // 1
echo 'Using two backslashes, the quotes are preserved'
sh 'echo \\"$BUILD_NUMBER\\"' // "1"
@scottsb
scottsb / casesafe.sh
Last active January 16, 2024 08:47 — forked from Hais/workspace.sh
Create and manage a case-sensitive disk-image on macOS (OS X).
#!/bin/bash
# ---------------------------------------------------------
# Customizable Settings
# ---------------------------------------------------------
MOUNT_POINT="${CASE_SAFE_MOUNT_POINT:-${HOME}/casesafe}"
VOLUME_PATH="${CASE_SAFE_VOLUME_PATH:-${HOME}/.casesafe.dmg.sparseimage}"
VOLUME_NAME="${CASE_SAFE_VOLUME_NAME:-casesafe}"
VOLUME_SIZE="${CASE_SAFE_VOLUME_SIZE:-60g}"
@JordanDalton
JordanDalton / AppServiceProvider.php
Last active August 27, 2019 19:00
Here's a nice, common App Service Provider I created and use in 100% of my applications. It provides a simple way to define and bind contracts, define model observers as well as extend form validation extension.
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Validator;
class AppServiceProvider extends ServiceProvider
{
/**
@taktran
taktran / rpi-led-notes.md
Last active July 22, 2022 14:20
Controlling Raspberry Pi 2 LEDs

Commands for controlling the Raspberry Pi 2 LEDs.

See rpi-leds for a node module that does this.

Power (PWR) LED

  • OK (ACT) LED = led0
  • Power (PWR) LED = led1

Allow access

@jsor
jsor / ddd_cqrs_event-sourcing_in_php.md
Last active April 11, 2024 23:48
DDD, CQRS and Event Sourcing in PHP

DDD, CQRS and Event Sourcing in PHP

  • Broadway - Infrastructure and testing helpers for creating CQRS and event sourced applications
  • EventCentric.Core - Event Sourcing and CQRS in PHP
  • LiteCQRS - Small convention based CQRS library for PHP
  • predaddy - Common DDD classes including an annotation driven message bus and tools for CQRS and Event Sourcing
  • ProophEventSourcing - Provides basic functionality for event-sourced aggregates
  • ProophEventStore - PHP 5.4+ EventStore Implementation
  • ProophServiceBus - PHP Enterprise Service Bus Implementation supporting CQRS and DDD
@prwhite
prwhite / Makefile
Last active April 4, 2024 19:01
Add a help target to a Makefile that will allow all targets to be self documenting
# Add the following 'help' target to your Makefile
# And add help text after each target name starting with '\#\#'
help: ## Show this help.
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
# Everything below is an example
target00: ## This message will show up when typing 'make help'
@echo does nothing