This file contains hidden or 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/sh | |
| # Usage: create_fork_bomb <function_name> <number_of_forks> <execute> | |
| # The <execute> argument is option and will print out the fork bomb string instead of evaluating it. | |
| create_fork_bomb() { | |
| fn_name=$1 | |
| n=$2 | |
| run=$3 | |
| if (($n < 2)); then n=2; fi | |
| for (( i=0; i<=$n; i++ )); do str="${str}|x"; done |
This file contains hidden or 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
| function GetApiKey() | |
| { | |
| Param( | |
| [Parameter(Mandatory=$false, Position=0, ValueFromPipeline=$false)] | |
| [ValidateNotNullOrEmpty()] | |
| [string] $userName, | |
| [Parameter(Mandatory=$false, Position=1, ValueFromPipeline=$false)] | |
| [SecureString] $useStaging |
This file contains hidden or 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
| # Script used to copy files from specified FTP server. | |
| # Requires the WinSCP .NET Assembly and WinSCP.exe: https://winscp.net/download | |
| # Requires Azure CLI: https://learn.microsoft.com/en-us/cli/azure/install-azure-cli-windows?tabs=azure-cli | |
| # Usage: | |
| # CopyFromFtpToBlob.ps1 <ftp_hostname> <ftp_username> <ftp_password> <ftp_directory_path> <source_file_names> <storage_account_connection_string> <container> <destination_path_under container> | |
| # The <ftp_password> is expected to bee a secure string: | |
| # https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.security/convertto-securestring?view=powershell-7.3 | |
| # The <source_file_names> is an array of filenames. If empty, all files in <ftp_directory_path> will be used. | |
| # Additional | |
| # Read from file into array: |
This file contains hidden or 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
| function Get-SASToken | |
| { | |
| <# | |
| .DESCRIPTION | |
| Compute a valid SAS-token for accessing an Azure Event Hub / Service Bus | |
| .PARAMETER EventHubNamespace | |
| The Azure Event Hub Namespace | |
| .PARAMETER EventHubName |
This file contains hidden or 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
| # Databricks notebook source | |
| from pyspark.sql import SparkSession, DataFrame, DataFrameWriter | |
| from pyspark.sql.functions import udf, to_timestamp | |
| import pyspark.sql.functions as f | |
| from pyspark.sql.types import StructType, StructField, StringType, IntegerType, BooleanType, TimestampType | |
| from typing import List, Set, Tuple, Dict | |
| from datetime import datetime | |
| from delta.tables import * | |
| from pyspark.sql import Row |
This file contains hidden or 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
| def solution(encoding, message): | |
| class BaseEncoder(): | |
| BASE64_CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' | |
| UTF_8_BYTE_SIZE, B64_BYTE_SIZE, BINARY_BASE = 8, 6, 2 | |
| @staticmethod | |
| def encode(message, in_byte_size, out_byte_size, char_set): | |
| enc_msg, padding = '', '' | |
| # Get the ascii code and convert that to binary. ord('A') = 65; bin(65) = 0b1000001 |
This file contains hidden or 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
| ### | |
| # Usage: | |
| # Test/DryRun and just report what would have changed. | |
| # UpdateTargetFrameworks.ps1 -TargetFrameworks @('net6.0') -UpdateWithXmlDoc $true -Path "SomePath" -DryRun $true | |
| # Do the update with XPATH via XmlDocument: | |
| # UpdateTargetFrameworks.ps1 @('net6.0') $true | |
| # Do the update with replace: | |
| # UpdateTargetFrameworks.ps1 @('net6.0') $false | |
| ### | |
| param( |
This file contains hidden or 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
| using Microsoft.VisualStudio.TestTools.UnitTesting; | |
| using System; | |
| namespace CommonTests.Attributes | |
| { | |
| /// <summary> | |
| /// Abstract base class for use with TestMethodWithIgnoreIfSupportAttribute.cs. | |
| /// Interfaces don't | |
| /// </summary> |
This file contains hidden or 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/bash | |
| # Usage | |
| # ./create_azure_devops_release_definition.sh "YOUR_ORG" "YOUR_PROJECT" | |
| Organization=$1 | |
| Project=$2 | |
| azureDevOpsTokenUri="https://vssps.dev.azure.com/$Organization" | |
| azureDevOpsReleaseUri="https://vsrm.dev.azure.com/$Organization" |
This file contains hidden or 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
| { | |
| "cSpell.ignoreWords": [ | |
| "assertpy", | |
| "backfilling", | |
| "checkpointed", | |
| "checkpointing", | |
| "dagrr", | |
| "databricks", | |
| "dataframe", | |
| "dataframes", |