This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
eval `ssh-agent -s` | |
ls ~/.ssh/*_rsa | xargs echo Loading | |
ssh-add ~/.ssh/*_rsa | |
echo SSH Agent Loaded |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 () { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
adddate() { | |
while IFS= read -r line; do | |
printf "%s %s\n" "[$(date +"%F %H:%M:%S")]" "$line" | |
done | |
} | |
$1 | adddate |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
> allowed_ranges | |
#Bamboo Triggers | |
echo '18.205.93.0/25' >> allowed_ranges | |
echo '18.234.32.128/25' >> allowed_ranges | |
echo '13.52.5.0/25' >> allowed_ranges | |
#Atlassian IP Addresses | |
curl -s https://ip-ranges.atlassian.com/ | jq -r '.items[] | .cidr' >> allowed_ranges | |
echo Allowed Ranges file generated |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |
OlderNewer