Skip to content

Instantly share code, notes, and snippets.

View DexterPOSH's full-sized avatar
🌱
Learning && Growing

Deepak Singh Dhami DexterPOSH

🌱
Learning && Growing
View GitHub Profile
#requires -version 7.2
using namespace system.collections.generic
using namespace system.reflection
function record {
param (
[Parameter(Mandatory)][String]$Name,
[Parameter(Mandatory)][hashtable]$Properties,
[switch]$ReadOnly
)
@JaimeStill
JaimeStill / README.md
Last active April 12, 2024 06:47
ASP.NET Core Active Directory Integration

Active Directory Authentication

This will provide an example of integrating Active Directory authentication in an ASP.NET Core app.

Note, you'll need to be running on a Windows domain with Visual Studio debugging in IIS Express for this to work.

Setup

In launchSettings.json, you'll want to modify iisSettings by turning on windowsAuthentication:

@SteveL-MSFT
SteveL-MSFT / profile.ps1
Last active March 11, 2024 01:21
PowerShell Prompt
#Requires -Version 7
# Version 1.2.13
# check if newer version
$gistUrl = "https://api.github.com/gists/a208d2bd924691bae7ec7904cab0bd8e"
$latestVersionFile = [System.IO.Path]::Combine("$HOME",'.latest_profile_version')
$versionRegEx = "# Version (?<version>\d+\.\d+\.\d+)"
if ([System.IO.File]::Exists($latestVersionFile)) {
@ameenkhan07
ameenkhan07 / FB-PE-InterviewTips.md
Last active April 11, 2024 17:02
Facebook Production Engineering Interview

What to Expect and Tips

• 45-minute systems interview, focus on responding to real world problems with an unhealthy service, such as a web server or database. The interview will start off at a high level troubleshooting a likely scenario, dig deeper to find the cause and some possible solutions for it. The goal is to probe your knowledge of systems at scale and under load, so keep in mind the challenges of the Facebook environment.
• Focus on things such as tooling, memory management and unix process lifecycle.

Systems

More specifically, linux troubleshooting and debugging. Understanding things like memory, io, cpu, shell, memory etc. would be pretty helpful. Knowing how to actually write a unix shell would also be a good idea. What tools might you use to debug something? On another note, this interview will likely push your boundaries of what you know (and how to implement it).

Design/Architecture 

Interview is all about taking an ambiguous question of how you might build a system and letting

@JamesNK
JamesNK / validate-schema.ps1
Last active July 1, 2021 15:38
Validate Schema from PowerShell
$ErrorActionPreference = "Stop"
$NewtonsoftJsonPath = Resolve-Path -Path "bin\Newtonsoft.Json.dll"
$NewtonsoftJsonSchemaPath = Resolve-Path -Path "bin\Newtonsoft.Json.Schema.dll"
Add-Type -Path $NewtonsoftJsonPath
Add-Type -Path $NewtonsoftJsonSchemaPath
$source = @'
public class Validator
@JamesRandall
JamesRandall / RedirectNewtonsoftJson.ps1
Last active May 2, 2023 13:39
Powershell binding redirection
# Load your target version of the assembly
$newtonsoft = [System.Reflection.Assembly]::LoadFrom("$PSScriptRoot\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll")
$onAssemblyResolveEventHandler = [System.ResolveEventHandler] {
param($sender, $e)
# You can make this condition more or less version specific as suits your requirements
if ($e.Name.StartsWith("Newtonsoft.Json")) {
return $newtonsoft
}
foreach($assembly in [System.AppDomain]::CurrentDomain.GetAssemblies()) {
if ($assembly.FullName -eq $e.Name) {
@olih
olih / jq-cheetsheet.md
Last active April 19, 2024 07:45
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

@trinitronx
trinitronx / README.md
Last active March 3, 2022 07:29
A shell script to install latest Ansible via pip + dependencies

omnibus-ansible

This script has moved to: neillturner/omnibus-ansible

This is the original version of the Ansible install script. If you want the latest, please see the above link!

Install latest Ansible via pip + dependencies via a shell script

This file is used to install ansible in test kitchen when you set in the kitchen.yaml file

@devlead
devlead / ConsoleBufferToHtml.ps1
Last active January 30, 2024 22:24
ConsoleBufferToHtml.ps1 - Powershell script to dump console buffer as html to file.
<#
.SYNOPSIS
This is a Powershell script to dump console buffer as html to file.
.DESCRIPTION
This Powershell script will iterate over the current console buffer and
output it as html preserving colors.
.PARAMETER FilePath
@dfinke
dfinke / PSSummit.ps1
Last active April 8, 2023 06:44
PowerShell GUI for viewing YouTube Videos of the PowerShell NA Summit 2015
Add-Type -AssemblyName PresentationFrameWork
$MainWindow=@'
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Topmost="True"
WindowStartupLocation="CenterScreen"
Title="PowerSHell Summit Videos" Height="850" Width="1200">
<Grid>
<Grid.RowDefinitions>