Skip to content

Instantly share code, notes, and snippets.

View JeremyNevill's full-sized avatar
🎯
Focusing

Jeremy Nevill JeremyNevill

🎯
Focusing
View GitHub Profile
@JeremyNevill
JeremyNevill / HandyDockerAliases.sh
Created March 18, 2019 11:40
Handy aliases for working with Docker and docker-compose
# Handy shell commands for Docker (inc Swarm)
alias dx='docker exec -it'
alias dsl='docker service ls'
alias dil='docker image ls'
alias dsd='docker stack deploy -c docker-compose.yml'
alias dsr='docker stack rm'
alias dc='docker-compose'

Jenkins Blue Ocean Pipeline Branch Buildnum Update

Jenkins.instance.getItemByFullName("WakeboardUK/master").updateNextBuildNumber(200)
@JeremyNevill
JeremyNevill / Windows_OpenSSH_Install.ps1
Last active December 14, 2017 17:19
Windows_OpenSSH_Install
choco install openssh
cd "C:\Program Files\OpenSSH-Win64"
powershell -ExecutionPolicy Bypass -File install-sshd.ps1
.\ssh-keygen.exe -A
powershell -ExecutionPolicy Bypass '.\FixHostFilePermissions.ps1 -Confirm:$false'
Set-Service sshd -StartupType Automatic
Set-Service ssh-agent -StartupType Automatic
Start-Service ssh-agent
Start-Service sshd
@JeremyNevill
JeremyNevill / WindowsSSHKeygen.md
Created October 17, 2017 21:24
Windows SSH Keygen
ssh-keygen -t rsa -b 4096 -C "you@yourname.net"

Show Hidden Files on Macos Sierra

defaults write com.apple.finder AppleShowAllFiles YES

Then restart Finder by Alt-Right Click on the Finder icon, select restart.

Remove Origin Branches from Local Cache

If you are trying to count your remote origin branches, the local version caches remote branches even if they have been deleted on origin.

git fetch --prune

The command above will fetch and clean up the local cache of origin's branches!

Get-Content .\filetotail.log -Tail 20 -Wait
@JeremyNevill
JeremyNevill / SqlServerVersion.sql
Last active June 2, 2017 09:27
Sql Server Version
-- Display the Version of Microsoft Sql Server that you are running
select @@VERSION
@JeremyNevill
JeremyNevill / AutoInstallAndRegisterVSTSAgent2017.ps1
Created April 3, 2017 13:08
AutoInstallAndRegisterVSTSAgent2017.ps1
$VSTSAgentFileName="vsts-agent-win7-x64-2.105.7.zip"
$VSTSAgentDownloadUrl="http://yourvstsagentdownloadserver/" + $VSTSAgentFileName
$TempFolder="c:/Temp/"
$VSTSAgentDownloadPath=$TempFolder + $VSTSAgentFileName
$VSTSAgentFolder="c:/vsts_agent"
$TFSServerUrl="http://yourtfsserver:8080/tfs"
function Download-VSTSAgent{
Write-Host("Downloading: " + $VSTSAgentDownloadUrl)
Write-Host("To: " + $VSTSAgentDownloadPath)
@JeremyNevill
JeremyNevill / Count_Git_Remote_Branches.md
Created March 21, 2017 13:16
Count_Git_Remote_Branches

From Bash count the number of remote branches a git repo contains:

git branch -r | wc -l