Skip to content

Instantly share code, notes, and snippets.

@The-Running-Dev
The-Running-Dev / HookFx.cs
Created November 17, 2023 00:10 — forked from NaxAlpha/HookFx.cs
Windows API Hook with C#
using System;
using System.Runtime.InteropServices;
public class FxHook:IDisposable {
const int nBytes = 5;
IntPtr addr;
Protection old;
byte[] src = new byte[5];
@The-Running-Dev
The-Running-Dev / usersecrets.ps1
Created December 27, 2020 15:10 — forked from Zonciu/usersecrets.ps1
Manage User Secrets for .NET Core console application
<#
.NOTES
How to use: Open Visual Studio, go to Tools – External Tools to bring up the External Tools dialog, add a new tools menu with the following configuration:
Title: Manage User Secrets (Or whatever you want)
Command: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe (Path to powershell.exe)
Arguments: Path-to-this-script(e.g. D:\VisualStudioTools\usersecrets.ps1)
Initial Directory: $(ProjectDir)
.PARAMETER ProjectFilePath
The csproj file's path, or keep it empty to search *.csproj file in initial directory
@The-Running-Dev
The-Running-Dev / Install-VsixExtension.ps1
Created October 17, 2019 15:24 — forked from lennybacon/Install-VsixExtension.ps1
Unattended install of Wix Toolset Visual Studio 2017 Extension
$extensionDisplayName = "Wix Toolset Visual Studio 2017 Extension";
$extensionApiVersion = "api-version=3.2-preview.1"
$marketplaceQueryUrl = "https://marketplace.visualstudio.com/_apis/public/gallery/extensionquery";
$extensionQuery = "{`"flags`":`"262`"," +
"`"filters`":[" +
"{" +
"`"criteria`":" +
"[" +
"{`"filterType`":`"14`",`"value`":`"1033`"}," +
@The-Running-Dev
The-Running-Dev / Set-LnkToRunAsAdmin.ps1
Created October 17, 2019 15:22 — forked from lennybacon/Set-LnkToRunAsAdmin.ps1
Modify Link to run as admin
$linkFilePath = "C:\Users\$([Environment]::UserName)\Desktop\WindowsTerminal.lnk"
$bytes = [System.IO.File]::ReadAllBytes($linkFilePath)
$bytes[0x15] = $bytes[0x15] -bor 0x20 #set byte 21 (0x15) bit 6 (0x20) ON
[System.IO.File]::WriteAllBytes($linkFilePath, $bytes)
@The-Running-Dev
The-Running-Dev / update-visualstudio.ps1
Created October 17, 2019 15:21 — forked from lennybacon/update-visualstudio.ps1
Update all visual studio editions and instances equal or above 2017
$EventLogSourceName = "Visual Studio Updater"
if([System.Diagnostics.EventLog]::SourceExists($EventLogSourceName) -eq $false){
New-EventLog –LogName Application –Source $EventLogSourceName
}
$cacheDirs = @(
"C:\Program Files (x86)\Microsoft Visual Studio\Installer"
);
foreach($cacheDir in $cacheDirs){

This guide was created using Microsoft Windows 10 Pro

Version 10.0.17134 Build 17134

Installation

System Updates:

  • Settings -> Update & Security
  • Install all updates

Powershell Execution Policy:

  • launch Windows Powershell as administrator and execute:
@The-Running-Dev
The-Running-Dev / brew-update-notifier.sh
Created July 2, 2019 13:19 — forked from streeter/brew-update-notifier.sh
Homebrew Package Update Notifications on Mountain Lion
#!/bin/bash
#
# Notify of Homebrew updates via Notification Center on Mac OS X
#
# Author: Chris Streeter http://www.chrisstreeter.com
# Requires: terminal-notifier. Install with:
# gem install terminal-notifier
TERM_APP='/Applications/Terminal.app'
BREW_EXEC='/usr/local/bin/brew'
@The-Running-Dev
The-Running-Dev / brew-update-notifier.sh
Created June 14, 2019 12:46 — forked from SimonSimCity/brew-update-notifier.sh
Extended the script, written by @streeter to exclude the pinned formulae in the list of formulas to update.
#!/bin/bash
#
# Notify of Homebrew updates via Notification Center on Mac OS X
#
# Author: Chris Streeter http://www.chrisstreeter.com
# Requires: terminal-notifier. Install with:
# brew install terminal-notifier
TERM_APP='/Applications/Terminal.app'
BREW_EXEC='/usr/local/bin/brew'
@The-Running-Dev
The-Running-Dev / encode.sh
Created April 1, 2019 15:18 — forked from lisamelton/encode.sh
This is the shell script I use to drive HandBrakeCLI to re-encode video files in a format suitable for playback on Apple TV, Roku 3, iOS, OS X, etc.
#!/bin/bash
# encode.sh
#
# Copyright (c) 2013 Don Melton
#
# This version published on June 7, 2013.
#
# Re-encode video files in a format suitable for playback on Apple TV, Roku 3,
# iOS, OS X, etc.
#requires -version 3
[CmdletBinding()]
param (
[string]
$Path
)
function Get-MD5 {
param (
[Parameter(Mandatory)]