Skip to content

Instantly share code, notes, and snippets.

View jhelmink's full-sized avatar

Josh jhelmink

View GitHub Profile
@jhelmink
jhelmink / 1 - BackupDatabase.ps1
Last active April 7, 2024 18:13
Creates a dacpac file from a SQL Server database, with FULL SCHEMA and TABLE DATA, but optionally EXCLUDES specific table data
# Creates a dacpac file from a SQL Server database, with FULL SCHEMA and TABLE DATA, but optionally EXCLUDES specific table data
# Designed for use in GitHub Actions
# Example Usage:
# .\BackupDatabase.ps1 -DatabaseName "rtlc-prod" -ConnectionString "data source=.\SQLEXPRESS;initial catalog=rtlc-prod;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework;TrustServerCertificate=True" -ExludeTableNames "Log4net,LogEvent,__MigrationHistory" -DacpacOutputPath "C:\Users\joshh\AppData\Local\Temp"
# Target Database & Parameters
param (
[Parameter(Mandatory = $true)]
[string]$DatabaseName,
[Parameter(Mandatory = $true)]
@jhelmink
jhelmink / 1 - ExecuteUpdateScripts.ps1
Last active April 3, 2024 00:52
Using Powershell script in Github Actions to execute T-SQL script files against a database
# Description: This script will execute all SQL files in the current directory against a specified SQL Server.
# git mv to ./Archive scripts once they've successfully executed through the environment pipeline.
param (
[Parameter(Mandatory = $true)]
[string]$ConnectionString,
[Parameter(Mandatory = $false)]
[bool]$VerboseOutput = $false
)
@jhelmink
jhelmink / gist:f8fe558a9f463a6a03de6e6091bdc174
Created March 8, 2024 05:30
Dockerfile for dotnet 8 azure function docker container with project dependencies and playwright
# How to build from base project folder - to include local dependencies
# sudo docker build -f ServiceFunctions/SpecificFunction/Dockerfile --tag specificfunction:v1.0.0 .
# How to run from base folder (-d dettached mode, -p port mapping outside:inside)
# sudo docker run -d -p 7190:80 --name specificfunction specificfunction:v1.0.0
# Handy commands when debugging
# sudo docker build --no-cache --progress=plain -f ServiceFunctions/SpecificFunction/Dockerfile --tag specificfunction-debug:v1.0.0 .
# sudo docker run -p 7190:80 --name specificfunction-debug specificfunction-debug:v1.0.0
# http://localhost:7190/api/DoTheThing?code=localDebugging
# sudo docker ps -a
@jhelmink
jhelmink / takeout-merge.sh
Created February 4, 2024 00:34
WSL Script to Merge Google Takeout Photos from multiple zips. Excludes the .json files.
# Run in the folder with all your extracted zips
# IMPORTANT: Edit this using LF end of line sequence in Visual Studio Code
# To make it executable; chmod +x takeout-merge.sh
# To run; ./takeout-merge.sh
# Set destination folder
destDir="./takeout-merge"
mkdir $destDir
# Merge all folders

Configuring Proxmox VE node as client for remote NUT server running on Synology NAS


  • Use Shell on Proxmox Node to install NUT
apt-get install nut