Skip to content

Instantly share code, notes, and snippets.

param ([switch]$wait)
# Note: this script isn't as reliable as actions taken right-clicking Docker Desktop tray icon and selecting Restart
# Can't seem to invoke that functionality or otherwise restart programmatically in same fashion that clears issues.
"Stopping containers"
docker ps -q | % { docker stop $_ }
docker ps -a -q | % { docker rm $_ }
"Starting / restarting Docker..."
namespace Microsoft.Azure.Management.ServiceBus.Models
{
/// <summary>Defines values for EntityStatus.</summary>
[JsonConverter(typeof (StringEnumConverter))]
public enum EntityStatus
{
[EnumMember(Value = "Active")] Active,
[EnumMember(Value = "Disabled")] Disabled,
[EnumMember(Value = "Restoring")] Restoring,
[EnumMember(Value = "SendDisabled")] SendDisabled,
@thnk2wn
thnk2wn / Dockerfile
Last active April 25, 2020 18:34
Used in Post: Deploying to Raspberry Pi with GitHub Actions and Docker
# Global build arguments to be used in later step. Mostly metadata for labels.
ARG GIT_SHA
ARG GIT_REF
ARG BUILD_DATE
ARG BUILD_VER
# Stage 1 - build
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-alpine AS build
ENV DOTNET_CLI_TELEMETRY_OPTOUT 1
@thnk2wn
thnk2wn / Dockerfile
Last active April 25, 2020 21:39
Debug version. Deploying to Raspberry Pi with GitHub Actions and Docker
ARG QEMU="false"
# Stage 1 - build
FROM mcr.microsoft.com/dotnet/core/sdk:3.1.102 AS build
ARG QEMU
ENV DOTNET_CLI_TELEMETRY_OPTOUT 1
WORKDIR /build
COPY . .
[CmdletBinding()]
param(
[Parameter(Mandatory=$false)]
[ValidateRange(1, 180)]
[int]$daysBack = 7,
[Parameter(Mandatory=$false)]
[string]$author,
[Parameter(Mandatory=$false)]
function Remove-MergedBranches
{
Get-ChildItem -Recurse -Depth 2 -Force |
Where-Object { $_.Mode -match "h" -and $_.FullName -like "*\.git" } |
ForEach-Object {
$dir = Get-Item (Join-Path $_.FullName "../")
pushd $dir
"removing merged branches in $($dir.Name)"
git branch --merged | %{$_.trim()} | ?{$_ -notmatch 'develop' -and $_ -notmatch 'master'} | %{git branch -d $_}
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)]
[ValidateScript({
if (-Not ($_ | Test-Path) ) {
throw "repos root path does not exist"
}
if (-Not ($_ | Test-Path -PathType Container) ) {
throw "Repos root must be a folder"
}
function Remove-MergedBranches
{
Get-ChildItem -Recurse -Depth 2 -Force |
Where-Object { $_.Mode -match "h" -and $_.FullName -like "*\.git" } |
ForEach-Object {
$dir = Get-Item (Join-Path $_.FullName "../")
pushd $dir
"removing merged branches in $($dir.Name)"
git branch --merged | %{$_.trim()} | ?{$_ -notmatch 'develop' -and $_ -notmatch 'master'} | %{git branch -d $_}
param([string]$checkoutBranch = "develop")
function Get-AllRepos ([string]$checkoutBranch = "develop")
{
Get-ChildItem -Recurse -Depth 2 -Force |
Where-Object { $_.Mode -match "h" -and $_.FullName -like "*\.git" } |
ForEach-Object {
$dir = Get-Item (Join-Path $_.FullName "../")
pushd $dir
#!/bin/bash
# Bring system current
sudo apt-get update && sudo apt-get -y upgrade
# Install required pi-gen dependencies
sudo apt-get -y install coreutils quilt parted qemu-user-static debootstrap zerofree zip \
dosfstools bsdtar libcap2-bin grep rsync xz-utils file git curl bc
# Get pi-gen git repo