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
| function Remove-DeletedGitBranches | |
| { | |
| param | |
| ( | |
| [Parameter()] | |
| [Switch] | |
| $Force | |
| ) | |
| $null = (git fetch --all --prune); |
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
| $containersToKeep = @("postgis") | |
| $runningContainers = docker ps -q | |
| foreach ($container in $runningContainers) { | |
| $containerName = (docker inspect --format "{{.Name}}" $container).TrimStart('/') | |
| if ($containersToKeep -contains $containerName) { | |
| continue | |
| } | |
| Write-Host "Stopping container $container ($containerName)" | |
| docker stop $container | |
| Write-Host "Removing container $container ($containerName)" |
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
| docker ps -q | % { docker stop $_ } | |
| docker container prune -f | |
| $containerName = "postgis" | |
| docker run -d --name $containerName -p 5432:5432 -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=postgres postgis/postgis:13-3.2 | |
| $maxWaitTime = 15000 # milliseconds | |
| $checkInterval = 500 | |
| $startTime = Get-Date | |
| $dbnames = @( |
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
| package main | |
| import ( | |
| "context" | |
| "fmt" | |
| "io" | |
| "net/http" | |
| "os" | |
| "time" |
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
| options := &C.GDALGridLinearOptions{dfRadius: C.double(-1.0), dfNoDataValue: C.double(0.0)} | |
| C.someCall(unsafe.Pointer(options)) | |
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
| cd /proc | |
| for pid in [0-9]* | |
| do | |
| echo "PID = $pid with $(ls /proc/$pid/fd/ | wc -l) file descriptors" | |
| done | sort -rn -k5 | head | while read -r _ _ pid _ fdcount _ | |
| do | |
| command=$(ps -o cmd -p "$pid" -hc) | |
| printf "pid = %5d with %4d fds: %s\n" "$pid" "$fdcount" "$command" | |
| done |
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
| package main | |
| import ( | |
| "fmt" | |
| "os/exec" | |
| "syscall" | |
| "time" | |
| "unsafe" | |
| ) |