Skip to content

Instantly share code, notes, and snippets.

View fabiocannas's full-sized avatar
🏠
Working from home

Fabio Cannas fabiocannas

🏠
Working from home
View GitHub Profile
@paschott
paschott / AzureSQLPermissions.sql
Last active July 17, 2024 16:01
Get Azure SQL Database Permissions
/* Get all db principals and their roles for Azure SQL */
SELECT
@@ServerName as ServerName,
DB_NAME() as DatabaseName,
pr.name AS PrincipalName,
pr.type_desc AS PrincipalType,
r.name AS RoleName,
dp.state_desc AS RoleState,
NULL as PermissionName,
NULL as PermissionState,
@DaveRuijter
DaveRuijter / backup-dls.ps1
Created October 21, 2021 20:16
This PowerShell script performs a copy between two storage accounts using AzCopy.
param(
[String]$sourceStorageAccount,
[String]$targetStorageAccount,
[String]$sourceFolder,
[String]$targetFolder,
[String]$sourceSasToken,
[String]$targetSasToken,
[String]$triggerPeriod,
[Int32]$azCopyConcurrency
)
@engineering87
engineering87 / TSQL-to-POCO.sql
Last active July 24, 2024 10:43 — forked from joey-qc/TSQL-to-POCO
A simple TSQL script to quickly generate c# POCO classes from SQL Server tables and views. You may tweak the output as needed. Not all datatypes are represented but this should save a bunch of boilerplate coding. USAGE: Run this query against the database of your choice. The script will loop through tables, views and their respective columns. Re…
declare @tableName varchar(200)
declare @columnName varchar(200)
declare @nullable varchar(50)
declare @datatype varchar(50)
declare @maxlen int
declare @pos int
declare @Stype varchar(50)
declare @isnullable varchar(1)
declare @Sproperty varchar(200)
@mmckechney
mmckechney / Manage-App-Service-Plan.md
Last active October 17, 2023 23:16
PowerShell and CLI to manage App Service Plan sizing

Manage App Service Plan count and SKU

Get the number of worker nodes serving the app service plan

(Get-AzAppServicePlan -ResourceGroupName "<resource group name>" -Name "<app service plan name>").Sku.Capacity
@erineccleston
erineccleston / ConsoleTetris.cs
Created May 12, 2018 08:40
Tetris (with theme song) in the C# console.
// Erin Eccleston 2018
// Still buggy, btw...
using System;
using System.Timers;
using static System.Console;
using System.Collections.Generic;
static class Tetris
{