Skip to content

Instantly share code, notes, and snippets.

@cohero
cohero / Remove_VMwareTools.ps1
Created May 21, 2024 05:19 — forked from broestls/Remove_VMwareTools.ps1
Force removal of VMware Tools, Program Files, and Windows Services
# This script will manually rip out all VMware Tools registry entries and files for Windows 2008-2019
# Tested for 2019, 2016, and probably works on 2012 R2 after the 2016 fixes.
# This function pulls out the common ID used for most of the VMware registry entries along with the ID
# associated with the MSI for VMware Tools.
function Get-VMwareToolsInstallerID {
foreach ($item in $(Get-ChildItem Registry::HKEY_CLASSES_ROOT\Installer\Products)) {
If ($item.GetValue('ProductName') -eq 'VMware Tools') {
return @{
reg_id = $item.PSChildName;
@cohero
cohero / ForbiddenTypeAnalyzer.cs
Created May 14, 2023 18:38 — forked from haacked/ForbiddenTypeAnalyzer.cs
Misc - Roslyn Analyzer to warn about access to forbidden types
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Linq;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Diagnostics;
using Microsoft.CodeAnalysis.Operations;
// CREDIT: https://github.com/dotnet/roslyn-analyzers/blob/master/src/Microsoft.CodeAnalysis.BannedApiAnalyzers/Core/SymbolIsBannedAnalyzer.cs
[DiagnosticAnalyzer(LanguageNames.CSharp)]
@cohero
cohero / photonos-prep.md
Created October 18, 2022 01:02 — forked from nvpnathan/photonos-prep.md
Misc - Photon OS prep intructions

Image for Prep Photon OS for Photon Platform

Change password to never expire

chage –I -1 –m 0 –M 99999 –E -1 root

Update repository sources

tdnf update

@cohero
cohero / Windows Defender Exclusions VS 2022.ps1
Created August 3, 2022 04:44 — forked from Braytiner/Windows Defender Exclusions VS 2022.ps1
Misc - Adds Windows Defender exclusions for Visual Studio 2022
$userPath = $env:USERPROFILE
$pathExclusions = New-Object System.Collections.ArrayList
$processExclusions = New-Object System.Collections.ArrayList
$pathExclusions.Add('C:\Windows\Microsoft.NET') > $null
$pathExclusions.Add('C:\Windows\assembly') > $null
$pathExclusions.Add($userPath + '\Downloads\HeidiSQL_11.3_64_Portable') > $null
$pathExclusions.Add($userPath + '\.dotnet') > $null
@cohero
cohero / FindFIPSComplianAlgorithms-Program.cs
Last active June 29, 2023 00:39 — forked from NeQuissimus/Program.cs
Misc - C# - Find FIPS-compliant algorithms
/**
* Code largely taken from http://blogs.msdn.com/b/icumove/archive/2009/01/31/working-with-fips-in-net-c.aspx?Redirected=true
*/
using System;
using System.Security.Cryptography;
using System.Reflection;
namespace FipsTest {
class Program {
@cohero
cohero / CleanUpTemporaryASPNETFiles.ps1
Created April 7, 2021 22:44 — forked from craigtp/CleanUpTemporaryASPNETFiles.ps1
Misc - Clean Up Temporary ASP.NET Files with Powershell
# Run this as Administrator
net stop w3svc
Get-ChildItem "C:\Windows\Microsoft.NET\Framework*\v*\Temporary ASP.NET Files" -Recurse | Remove-Item -Recurse -Force
net start w3svc
@cohero
cohero / internalize.js
Created February 15, 2021 18:08 — forked from kenchangh/internalize.js
Misc - internalize.js
// Implementation
function internalizeTextFiles(type, html, callback) {
var tagNames = {
js: 'script',
css: 'style'
}
var tagName = tagNames[type];
var $html = $(html);
var $assets = $html.filter(tagName);
var fetchedCounter = 0;
@cohero
cohero / PuppeteerSharpExamples.cs
Last active June 29, 2023 00:41 — forked from hlaueriksson/Examples.cs
Misc - PuppeteerSharp Documentation
using System;
using System.Threading.Tasks;
using PuppeteerSharp;
using Xunit;
namespace PuppeteerSharp.Documentation
{
public class Examples
{
[Fact]
@cohero
cohero / README.md
Created June 16, 2020 23:53 — forked from qti3e/README.md
List of file signatures and mime types based on file extensions
@cohero
cohero / IRequiresRequestStream_Service.cs
Created February 13, 2019 17:05 — forked from jlyonsmith/IRequiresRequestStream_Service.cs
Using IRequiresRequestStream with ServiceStack
using System;
using Mono.Unix;
using Mono.Unix.Native;
using System.Configuration;
using ServiceStack;
using ServiceStack.Web;
using System.IO;
using ServiceStack.Host.HttpListener;
using System.Net;