Skip to content

Instantly share code, notes, and snippets.

View peterneave's full-sized avatar

Peter Neave peterneave

  • Melbourne, Australia
  • 10:47 (UTC +11:00)
View GitHub Profile
@peterneave
peterneave / gitrandom.txt
Last active March 29, 2018 00:00
Git Random
#Make it easier working with upstream branches
git config --global pull.rebase true
git config --global rebase.autoStash true
#log difference between branches
git log --oneline --graph --all --decorate --abbrev-commit master..release/5.1.0
#https://til.hashrocket.com/posts/18139f4f20-list-different-commits-between-two-branches
git log --left-right --graph --cherry-pick --oneline release/5.1.0...master
@peterneave
peterneave / .bashrc_windows
Last active June 12, 2018 23:45
Linux Run Commands
#! /bin/bash
eval `ssh-agent -s`
ls ~/.ssh/*_rsa | xargs echo Loading
ssh-add ~/.ssh/*_rsa
echo SSH Agent Loaded
@peterneave
peterneave / keybase.md
Created April 23, 2018 00:34
keybase.md

Keybase proof

I hereby claim:

  • I am peterneave on github.
  • I am peterneave (https://keybase.io/peterneave) on keybase.
  • I have a public key ASAK7gjJL7N0emCuCMYAc0LbVrKc68X3KnlNsk4K-WmLxQo

To claim this, I am signing this object:

@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 / CreateNewBindings.ps1
Created June 6, 2018 01:21
Powershell Create IIS Web Binding
#Based on https://stackoverflow.com/a/26512480/7818494
function CreateNewBindings(
[parameter(Mandatory = $true, HelpMessage = 'Missing Argument WebsiteName')][string]$WebsiteName,
[parameter(Mandatory = $true, HelpMessage = 'Missing Argument HostHeader')][string]$HostHeader,
[parameter(Mandatory = $true, HelpMessage = 'Missing Argument CertCommonName')][string]$CertCommonName) {
Write-Host Creating new http binding $HostHeader on $WebsiteName
New-WebBinding -Name $WebsiteName -IPAddress "*" -Port 80 -Protocol http -HostHeader $HostHeader
Write-Host Creating new https binding $HostHeader on $WebsiteName with certificate $CertCommonName
New-WebBinding -Name $WebsiteName -IPAddress "*" -Port 443 -Protocol https -HostHeader $HostHeader -SslFlags 1
@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 / gist:334856152dcbd574b0eee0b7546cf17f
Created July 11, 2018 03:29
Setup Firewall with UFW on Debian/Ubuntu
#See https://www.digitalocean.com/community/tutorials/how-to-set-up-a-firewall-with-ufw-on-ubuntu-16-04 for more details on UFW commands
#change to root
sudo -i
#install ufw
apt install ufw
#enable writing logs to separate file https://askubuntu.com/a/728657
sed -i '/^#& ~/s/^#//' /etc/rsyslog.d/20-ufw.conf
@peterneave
peterneave / .profile
Last active September 20, 2018 06:53
Racher OS
#!/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 () {
@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 / logging.conf
Created December 12, 2018 01:36
Postgres Logging
#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