Skip to content

Instantly share code, notes, and snippets.

View peterneave's full-sized avatar

Peter Neave peterneave

  • Melbourne, Australia
  • 22:24 (UTC +11:00)
View GitHub Profile
@peterneave
peterneave / readme.md
Last active October 17, 2024 13:36
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.

Terminal

  1. Install pgAgent via package manager
sudo apt update
@peterneave
peterneave / devcontainer.json
Created October 14, 2024 03:50
Rust Dev Container for VS Code
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/rust
{
"name": "Rust",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/rust:latest",
"customizations": {
"vscode": {
"settings": {
"todo-tree.regex.regex": "(//|#|<!--|;|/\\*|^|^[ \\t]*(-|\\d+.))\\s*($TAGS)|todo!",
#!/usr/bin/env bash
set -e
# Examples of call:
# git-clone-bare-for-worktrees git@github.com:name/repo.git
# => Clones to a /repo directory
#
# git-clone-bare-for-worktrees git@github.com:name/repo.git my-repo
# => Clones to a /my-repo directory
@peterneave
peterneave / ReplaceMe.ps1
Created June 26, 2023 06:20
Multi Search and Replace with Powershell
$Dictionary = @{
"key1" = "value1";
"key2" = "value2";
}
$sourceFilename = "template.txt"
$destinationFilename = "output.txt"
$delimStart = "<"
$delimEnd = ">"
$templateContent = Get-Content $sourceFilename
Import-Module PSReadLine
Import-Module Posh-Git
oh-my-posh init pwsh --config '$env:UserProfile\jandedobbeleer.omp.json' | Invoke-Expression
# AWS CLI
Register-ArgumentCompleter -Native -CommandName aws -ScriptBlock {
param($commandName, $wordToComplete, $cursorPosition)
$env:COMP_LINE = $wordToComplete
if ($env:COMP_LINE.Length -lt $cursorPosition) {
@peterneave
peterneave / gitkdiff.setttings
Created November 17, 2022 06:05
Git settings for KDIFF3 on Windows
[merge]
tool = kdiff3
[mergetool "kdiff3"]
path = C:/Program Files/KDiff3/kdiff3.exe
trustExitCode = false
[diff]
guitool = kdiff3
[difftool "kdiff3"]
path = C:/Program Files/KDiff3/kdiff3.exe
trustExitCode = false
@peterneave
peterneave / jandedobbeleer.omp.json
Created November 7, 2022 03:02
oh-my-posh theme
{
"blocks": [{
"type": "prompt",
"alignment": "left",
"segments": [{
"type": "session",
"style": "diamond",
"foreground": "#ffffff",
"background": "#c386f1",
"leading_diamond": "",
@peterneave
peterneave / GoToJira.ps1
Last active March 1, 2022 23:51
Go to Jira from Source Tree
#Script to Run: C:\Program Files\PowerShell\7\pwsh.exe
#param: c:\dev\GoToJira.ps1 $REPO $SHA
Param(
[string]$REPO,
[string]$SHA
)
pushd $REPO
$var = (git log -n 1 --pretty=medium $SHA) | Out-String
@peterneave
peterneave / GoToBitBucket.ps1
Last active March 1, 2022 23:35
SourceTree Go To Bitbucket
#Script to Run: C:\Program Files\PowerShell\7\pwsh.exe
#param: c:\dev\GoToBitBucket.ps1 $REPO $SHA
Param(
[string]$REPO,
[string]$SHA
)
pushd $REPO
$var = (git remote get-url origin) | Out-String
@peterneave
peterneave / EncryptDecryptRDCMan.ps1
Created October 7, 2021 22:21 — forked from heiny/EncryptDecryptRDCMan.ps1
Powershell: Encrypt/Decrypt Remote Desktop Connection Manager Credentials
# 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 {
[CmdletBinding()]
param([String]$PlainText = $null)
# convert to RDCMan format: (null terminated chars)