Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
dry=0
if [[ $# -gt 0 && $1 == "-n" ]]; then
dry=1
shift
fi
prefix="v"
if [[ $# -gt 0 ]]; then
if [[ $1 = -* || $# -gt 1 ]]; then
@jborean93
jborean93 / Runas.ps1
Created June 2, 2021 20:27
Creates a process running as SYSTEM
. $PSScriptRoot\Start-ProcessEx.ps1
Add-Type -Namespace Runas -Name NativeMethods -UsingNamespace @(
'Microsoft.Win32.SafeHandles',
'System.ComponentModel',
'System.Security.Principal'
) -MemberDefinition @'
[DllImport("Advapi32.dll", EntryPoint = "DuplicateTokenEx", SetLastError = true)]
private static extern bool NativeDuplicateTokenEx(
SafeHandle hExistingToken,
@dpryden
dpryden / ClassLoaderLeakExample.java
Created October 20, 2014 00:01
Example of a ClassLoader leak in Java
import java.io.IOException;
import java.net.URLClassLoader;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.Path;
/**
* Example demonstrating a ClassLoader leak.
*
* <p>To see it in action, copy this file to a temp directory somewhere,