Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
: << =cut
=head1 NAME
Packetfence Clients
=head1 AUTHOR
# Local and established are just fine
-A INPUT -i lo -j ACCEPT
-A INPUT -d 127.0.0.0/8 ! -i lo -j REJECT --reject-with icmp-port-unreachable
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
# SSH Rate Limiting
-I INPUT -p tcp --dport 22 -m state --state NEW -m recent --set
-I INPUT -p tcp --dport 22 -m state --state NEW -m recent --update --seconds 60 --hitcount 3 -j DROP
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
<?php
# For Moodle 3.3
# This script belongs in ./admin/cli/
# Copyright 2017 Paul Verrall
define('CLI_SCRIPT', true);
require(__DIR__.'/../../config.php');
require_once($CFG->dirroot.'/lib/csslib.php');

Keybase proof

I hereby claim:

  • I am mrverrall on github.
  • I am mrverrall (https://keybase.io/mrverrall) on keybase.
  • I have a public key ASD1zgZPt7UftFI0emlJP1DCXJb47n5VQln14qgbOzV0Ugo

To claim this, I am signing this object:

@mrverrall
mrverrall / rhel7-moodle.sh
Last active February 1, 2024 15:00
A script that installs and configures all the core components for moodle on RHEL/Centos 7 leaving you with a running site complete with AV scanning and Memcached
#!/bin/bash
#
# This Bash script installs Moodle (http://moodle.org) and all it's
# requirements into a freshly installed Centos or RHEL 7 operating system.
# It assumes an 'Enforced' SELinux environment and configures the system
# accordingly.
#
# It is designed to be instructional and clear to read to persons unfamiliar
# with Bash and as such does *no* sanity checking before taking actions.
# Becasue of this *great* care should be taken if you feel the urge to run
@mrverrall
mrverrall / 0_reuse_code.js
Last active August 29, 2015 14:07
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@mrverrall
mrverrall / bt_audio_udev
Created May 3, 2013 08:58
Bluetooth UDEV even definition
SUBSYSTEM="input", GROUP="input", MODE="0660"
KERNEL=="input[0-9]*", RUN+="/usr/lib/udev/bluetooth"
Did you remember to call setType() for 'definition'? Defaulting to PARAM_RAW cleaning.
line 1289 of /lib/formslib.php: call to debugging()
line 281 of /lib/formslib.php: call to moodleform->detectMissingSetType()
line 202 of /lib/formslib.php: call to moodleform->_process_submission()
line 134 of /cache/admin.php: call to moodleform->moodleform()
Did you remember to call setType() for 'action'? Defaulting to PARAM_RAW cleaning.
line 1289 of /lib/formslib.php: call to debugging()
line 281 of /lib/formslib.php: call to moodleform->detectMissingSetType()
line 202 of /lib/formslib.php: call to moodleform->_process_submission()
line 134 of /cache/admin.php: call to moodleform->moodleform()
@mrverrall
mrverrall / vbox_auto_snapshots
Last active December 14, 2015 02:29
This script will automatically take and mergeback VirtualBox snapshots to keep a rolling archive of a running machine. Call with, # ./vbox_auto_snapshots vm_name_1 [vm_name_n...]
#! /bin/bash
# This script will automatically take and mergeback VirtualBox snapshots to
# keep a rolling archive of a running machine.
# Call with,
# ./vbox_auto_snapshots vm_name_1 [vm_name_n...]
# Define snapshot retention periods
KEEP_WEEKLY=4
KEEP_DAILY=6
#!/bin/bash
# This script belongs in /usr/lib/udev/bluetooth and should be executable
PA_SINK='alsa_output.platform-bcm2835_AUD0.0.analog-stereo'
LOG_FILE=/var/log/bluetooth_a2dp
MAC=$(echo "$NAME" | sed 's/:/_/g' | sed 's/\"//g')
# Set the user you want to run as, 'pi' would be fine for most.
BT_USER=btaudio