Skip to content

Instantly share code, notes, and snippets.


Peter Neave peterneave

View GitHub Profile
View Microsoft.PowerShell_profile.ps1
Import-Module PSReadLine
Import-Module Posh-Git
oh-my-posh init pwsh --config '$env:UserProfile\jandedobbeleer.omp.json' | Invoke-Expression
Register-ArgumentCompleter -Native -CommandName aws -ScriptBlock {
param($commandName, $wordToComplete, $cursorPosition)
$env:COMP_LINE = $wordToComplete
if ($env:COMP_LINE.Length -lt $cursorPosition) {
peterneave / gitkdiff.setttings
Created November 17, 2022 06:05
Git settings for KDIFF3 on Windows
View gitkdiff.setttings
tool = kdiff3
[mergetool "kdiff3"]
path = C:/Program Files/KDiff3/kdiff3.exe
trustExitCode = false
guitool = kdiff3
[difftool "kdiff3"]
path = C:/Program Files/KDiff3/kdiff3.exe
trustExitCode = false
peterneave / jandedobbeleer.omp.json
Created November 7, 2022 03:02
oh-my-posh theme
View jandedobbeleer.omp.json
"blocks": [{
"type": "prompt",
"alignment": "left",
"segments": [{
"type": "session",
"style": "diamond",
"foreground": "#ffffff",
"background": "#c386f1",
"leading_diamond": "",
peterneave / EncryptDecryptRDCMan.ps1
Created October 7, 2021 22:21 — forked from heiny/EncryptDecryptRDCMan.ps1
Powershell: Encrypt/Decrypt Remote Desktop Connection Manager Credentials
View EncryptDecryptRDCMan.ps1
# There is no facility to replace passwords in RDCMan once they are stored. The only way is to create a new custom credential.
# If you open your *.rdg file in a text editor, locate the stored <password>, you can then decrypt it using this script.
# This script can also encrypt a plain text password in rdg format which can be used to overwrite an existing one in the xml.
Add-Type -AssemblyName System.Security;
Function EncryptPassword {
param([String]$PlainText = $null)
# convert to RDCMan format: (null terminated chars)
peterneave / DotNetVideoDownload.ps1
Last active August 17, 2021 23:31
Download .Net Training Videos for Offline Viewing
View DotNetVideoDownload.ps1
#Download videos from
#Based on script from
function DownloadVideoFromRSSFeed {
Param ([string]$url, [string]$path)
New-Item -ItemType Directory $path -ErrorAction SilentlyContinue
Set-Location -Path $path
$a = ([xml](new-object net.webclient).downloadstring($url))
$items = $
peterneave /
Created December 14, 2018 05:23
Add datetime to log files
adddate() {
while IFS= read -r line; do
printf "%s %s\n" "[$(date +"%F %H:%M:%S")]" "$line"
$1 | adddate
peterneave /
Last active February 5, 2020 14:24
Setup Linux UFW Firewall to accept Atlassian IP addresses only
#!/usr/bin/env bash
> allowed_ranges
#Bamboo Triggers
echo '' >> allowed_ranges
echo '' >> allowed_ranges
echo '' >> allowed_ranges
#Atlassian IP Addresses
curl -s | jq -r '.items[] | .cidr' >> allowed_ranges
echo Allowed Ranges file generated
peterneave / logging.conf
Created December 12, 2018 01:36
Postgres Logging
View logging.conf
#Add to /etc/postgresql/10/main/conf.d/logging.conf and reload config
log_statement = 'none'
log_duration = off
log_min_duration_statement = 10000
log_lock_waits = on
peterneave /
Last active April 16, 2023 15:33
Install pgAgent on Postgres 10 (Debian Linux)

Install pgAgent on Postgres 10 (Debian Linux)

This assumes you will have pgAgent running on the same machine as your database.


  1. Install pgAgent via package manager
sudo apt update
peterneave / .profile
Last active September 20, 2018 06:53
Racher OS
View .profile
#!/usr/bin/env bash
function git () {
(docker run -ti --rm -v ${HOME}:/root -v $(pwd):/git alpine/git "$@")
function htop () {
(docker run --rm --pid=host -it imwithye/htop)
function vim () {