This file contains 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/perl | |
use Cwd; | |
use File::Find; | |
use Getopt::Long; | |
use strict; | |
use warnings; | |
my $dir = cwd() . "/"; |
This file contains 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
#Explanation: | |
# ls -t => Lists the files in a folder in decrescent order of modification time, so it will list newer files first | |
# sed -e '1,50d' => Filters the first Nth (50 in this case) lines leaving only the oldest files | |
# grep -v "lost+found" => Optional, if you are in a backup disk root you will need this probably, otherwise you can omit it | |
# awk '{print "/mnt/backup/"$1}' => Prepend the absolute path to the file name so it's easier to run it in a cron job | |
# xargs -d '\n' rm => Takes every lines from the pipe, strips out the newline char and passes it to the rm command |
This file contains 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
param ( | |
[Parameter(Mandatory=$true)][String[]]$branches | |
) | |
# Default catchall branch for closed branches | |
$closureOldBranchName = "CLOSURE_OLD_BRANCH" | |
$closedBranches = @() | |
# Runs a loop on the branches passed as param |
This file contains 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
namespace Extensions | |
{ | |
public static class TryParseOrElseExtension | |
{ | |
public static int TryParseOrElse(this string value, int orElse) | |
{ | |
return int.TryParse(value, out int result) ? result : orElse; | |
} | |
} | |
} |
This file contains 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
FROM mcr.microsoft.com/dotnet/core/sdk:2.1 AS builder | |
WORKDIR /build | |
COPY dotnetapp.csproj . | |
RUN dotnet restore | |
COPY . . | |
RUN dotnet publish -c Release -o out |