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/env python3 | |
# Taken from https://blog.crunchydata.com/blog/how-to-upgrade-postgresql-passwords-to-scram | |
help= \ | |
""" | |
Generate scram-sha-256 password hashes / verifiers for PostgreSQL 10+ | |
Usage: | |
scram_postgres_password Username1 Password1 [, ... UsernameN PasswordN ] |
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/env pwsh | |
<# | |
.SYNOPSIS | |
Create a Postgres application database and roles for owner, application, and application_readonly | |
.DESCRIPTION | |
Create a Postgres application database and create roles for owner, application, and application_readonly. | |
- the owner role has no login. the user that runs this script will be assigned to that role |
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/env pwsh | |
Param( | |
[string]$installerName="Installer", | |
[Parameter(Mandatory=$true)][string]$installerPassword, | |
[Parameter(Mandatory=$true)][ValidateScript( | |
{try{[System.Net.Mail.MailAddress]$_;return $true;}catch{return $false}})] | |
[string]$installerEmail, | |
[string]$dbServer=$env:SQLCMDSERVER, | |
[string]$dbDatabaseName="Umbraco", |
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
/// <summary>Extended alternatives for <c>string.</c> methods</summary> | |
// ReSharper disable once InconsistentNaming | |
public static class strings | |
{ | |
/// <summary>Joins the non-null items of <paramref name="values"/>, putting <paramref name="separator"/> | |
/// between each item.</summary> | |
/// <param name="separator">Separator is only used if <paramref name="values"/> has at least | |
/// 2 non-null elements.</param> | |
/// <param name="values">The values to join.</param> | |
/// <typeparam name="T"></typeparam> |
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
#! /bin/zsh | |
# | |
# Manual Install packages | |
open https://www.sublimetext.com | |
open https://www.perforce.com/downloads/visual-merge-tool | |
open https://dotnet.microsoft.com | |
open https://code.visualstudio.com | |
open https://my.parallels.com | |
open https://brew.sh | |
open https://www.wolfram.com/mathematica/ |
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
public class AppDbOnPostgres : DbContext | |
{ | |
public AppDbOnPostgres(NpgsqlConnection dbConnection):base(dbConnection){} | |
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) | |
=> optionsBuilder | |
.UseNpgsql(dbConnection) | |
.ReplaceService<ISqlGenerationHelper,NpgsqlSqlGenerationLowercasingHelper>(); | |
} |
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
#nullable enable | |
using Microsoft.Extensions.Logging; | |
using Microsoft.VisualBasic; | |
using System; | |
using System.Diagnostics; | |
using System.Diagnostics.CodeAnalysis; | |
using System.Linq; | |
namespace LogAssert | |
{ |
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
<# | |
.SYNOPSIS | |
Uninstall one or more Windows Program or Feature, by name or regular expression. | |
.DESCRIPTION | |
Lists Programs And Features installed on the current machine which match | |
the -matchingName parameter and then, after force or confirmation, uninstalls them. | |
Examples |
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
// ==UserScript== | |
// @name Trello Wrap-n-Stack-To-Fit | |
// @namespace http://tampermonkey.net/ | |
// @version 0.73 | |
// @description Trello: Auto-wrap, stack and resize your Trello lists so they don't go offscreen. And kill that horizontal scroll-bar. | |
// @author chrisfcarroll | |
// @match https://trello.com/* | |
// @grant none | |
// ==/UserScript== | |
// jshint -W097 |
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/env sh | |
cat << 'EOF' | |
Get pricing: | |
location.href="https://prices.azure.com/api/retail/prices?$skip=0¤cyCode='GBP'&$filter=location eq 'UK South' and serviceName eq 'Virtual Machines' and priceType eq 'Consumption'" | |
Create Spot VM | |
az vm create -g VM --name VM --admin-username azureuser --image CentOS --generate-ssh-keys --public-ip-sku Standard --priority Spot --eviction-policy Delete | |
Destroy VM |