Skip to content

Instantly share code, notes, and snippets.

@briped
briped / nginx-plexpy-jail.conf
Last active March 29, 2019 07:36
Fail2Ban configuration files for PlexPy behind NGINX Reverse Proxy Raw
# Fail2Ban jail configuration file for PlexPy behind NGINX Reverse Proxy.
# nginx-plexpy.conf
#
# The X-Forwarded-For IP (or any IP for that matter) isn't logged in the PlexPy
# log, and so any failed attempts cannot be blocked using Fail2Ban.
#
# Workaround is to look at all attempts and then set the maxretry number to 5.
# This doesn't protect against distributed attempts.
#
# Author: Brian Schmidt Pedersen
@briped
briped / nginx-domoticz-jail.conf
Last active September 15, 2017 02:13
Fail2Ban configuration files for Domoticz behind NGINX Reverse Proxy
# Fail2Ban jail configuration file for Domoticz behind NGINX Reverse Proxy.
# nginx-domoticz.conf
#
# The X-Forwarded-For IP isn't logged in the Domoticz log, and so any failed
# attempts will show the NGINX reverse proxy IP rather than the actual IP.
#
# Workaround is to look at all attempts and then set the maxretry number to 5.
# This doesn't protect against distributed attempts.
#
# Author: Brian Schmidt Pedersen
--
-- Tellstick Switch Handler
-- Created by: Brian Schmidt Pedersen (@briped)
--
-- The device names from the Tellstick MUST be the same as the device names
-- defined in domoticz, or this script will not work.
--
-- The script is hacked together from several sources, without any knowledge of
-- Lua, so just about everything can probably be done better than my attempt.
-- This also means that no support is given beyond the comments found in this
@briped
briped / ipa2mdx.sh
Last active October 31, 2015 21:49
#!/bin/bash
clear
if [ $# -lt 2 ]; then
echo "usage: $0 -i inputIpaFile -p provisioning [-c replacementIconFile] [-n 'name to display'] [-b bundleId] [-o outputIpa]" >&2
exit 1
fi
function abspath() {
python -c "import os; print os.path.abspath(\"$1\")"
}
Param(
[parameter(Mandatory=$true,
HelpMessage="Enter one or more AD groups to merge/copy from.")]
[string[]]
$SourceGroups,
[parameter(Mandatory=$true,
HelpMessage="Enter AD group to merge/copy to.")]
[string]
$TargetGroup,
[parameter(Mandatory=$false,
Param(
[parameter(Mandatory=$true,
HelpMessage="Enter AD group to move from.")]
[string]
$SourceGroup,
[parameter(Mandatory=$true,
HelpMessage="Enter AD group to move to.")]
[string]
$TargetGroup
)
@briped
briped / 0_reuse_code.js
Last active August 29, 2015 14:06
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
@briped
briped / Update-GratisDNS.ps1
Created May 30, 2014 15:56
Quick PowerShell script to update GratisDNS.dk DDNS. Requires PowerShell v3
Param(
$Username = "user",
$Password = "pass",
$Domainname = "domain",
$Hostname = "host"
)
$UpdateURL = "https://ssl.gratisdns.dk/ddns.phtml?u=$Username&p=$Password&d=$Domainname&h=$Hostname"
$ScriptPath = $script:MyInvocation.MyCommand.Path
$IPCacheFile = $ScriptPath.Substring(0,$ScriptPath.LastIndexOf(".")) + "-CachedIP.txt"
@briped
briped / deployment.config
Last active August 29, 2015 13:57
Java Deployment Files
deployment.system.config=file\:C\:/Windows/Sun/Java/Deployment/deployment.properties
deployment.system.config.mandatory=true
Function Create-Password {
<#
.SYNOPSIS
Create-Password creates a random password
.DESCRIPTION
This function is used to create random passwords. You can specify what
character types (lowercase letters, uppercase letters, numbers and symbols)
as well as the minimum amount of those character types.