Skip to content

Instantly share code, notes, and snippets.

View mamift's full-sized avatar

Muhammad Miftah mamift

View GitHub Profile
@guwidoe
guwidoe / GetLocalOneDrivePath.bas.vb
Last active July 7, 2025 15:34
VBA Function to get the local path of a OneDrive/SharePoint synchronized Microsoft Office file
'Attribute VB_Name = "OneDrivePathConversion"
'
' Cross-platform VBA Function to get the local path of OneDrive/SharePoint
' synchronized Microsoft Office files (Works on Windows and on macOS) and
' Cross-platform VBA Function to get the OneDrive/SharePoint Url path (link)
' from a local path of a locally synced folder (Works on Windows and on macOS)
'
' Author: Guido Witt-Dörring
' Created: 2022/07/01
' Updated: 2025/06/02
@SwitHak
SwitHak / 20211210-TLP-WHITE_LOG4J.md
Last active July 2, 2025 20:42
BlueTeam CheatSheet * Log4Shell* | Last updated: 2021-12-20 2238 UTC

Security Advisories / Bulletins / vendors Responses linked to Log4Shell (CVE-2021-44228)

Errors, typos, something to say ?

  • If you want to add a link, comment or send it to me
  • Feel free to report any mistake directly below in the comment or in DM on Twitter @SwitHak

Other great resources

  • Royce Williams list sorted by vendors responses Royce List
  • Very detailed list NCSC-NL
  • The list maintained by U.S. Cybersecurity and Infrastructure Security Agency: CISA List
@manualbashing
manualbashing / blog.md
Last active July 2, 2025 06:16 — forked from joncloud/pr.md
Checkout Azure DevOps Pull Requests locally

Forked from piscisaureus

Fetch and checkout one specific pull request

To identify one particular pull request, find the pull request number on the Azure DevOps site:

image

Then fetch and checkout the pull request in a local branch named pull/137

@lellis1936
lellis1936 / AESGCM.cs
Created November 2, 2019 15:56
GCM Encryption / Decryption on Windows .Net Full Framework
//Requires PInvoke.BCrypt
//Note that AES GCM encryption is included on .Net Core 3.0, but not in the full .Net framework.
//This implementation requires PInvoke.BCrypt, and reulies on the Windows CNG Bcrypt library which
//is available on Windows Vista or later. Note also the requirement for unsafe code.
//As coded requires VS 2015 / C#6 or above.
using System;
using PInvoke;
using static PInvoke.BCrypt;
using System.Security.Cryptography;
@potatoqualitee
potatoqualitee / Save-KBFile.ps1
Last active July 5, 2024 11:31
Download Windows patch files / KB (patchid like KBxxxxx) and save them to disk using PowerShell
function Save-KBFile {
<#
.SYNOPSIS
Downloads patches from Microsoft
.DESCRIPTION
Downloads patches from Microsoft
.PARAMETER Name
The KB name or number. For example, KB4057119 or 4057119.
@kpko
kpko / SynchronousExecutionUtility.cs
Created December 31, 2018 16:08
Utility class to execute a workflow synchronously via WorkflowCore
public class SynchronousWorkflowExecutionResult
{
public string WorkflowId { get; set; }
public string WorkflowInstanceId { get; set; }
public string Reference { get; set; }
public LifeCycleEvent LastLifeCycleEvent { get; set; }
}
public class SynchronousWorkflowExecutionUtility
{
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
Right-click on the right side, and add a new DWORD (32-bit) Value
Set the value name to DisableTaskOffload and the value data to 1
Open Network Connections.
Right-click the icon of the Network card and select Properties.
In Networking tab, click Configure… button.
In the next window, switch to Advanced tab.
Click the Large Send Offload Version 2 (IPv4) and change the value to Disabled.
@heiny
heiny / EncryptDecryptRDCMan.ps1
Last active February 18, 2025 06:52
Powershell: Encrypt/Decrypt Remote Desktop Connection Manager Credentials
# There is no facility to replace passwords in RDCMan once they are stored. The only way is to create a new custom credential.
# If you open your *.rdg file in a text editor, locate the stored <password>, you can then decrypt it using this script.
# This script can also encrypt a plain text password in rdg format which can be used to overwrite an existing one in the xml.
Add-Type -AssemblyName System.Security;
Function EncryptPassword {
[CmdletBinding()]
param([String]$PlainText = $null)
# convert to RDCMan format: (null terminated chars)
@DustinCampbell
DustinCampbell / using-msbuildworkspace.md
Created April 10, 2018 21:36
Using MSBuildWorkspace

Introduction

Roslyn provides a rich set of APIs for analyzing C# and Visual Basic source code, but constructing a context in which to perform analysis can be challenging. For simple tasks, creating a Compilation populated with SyntaxTrees, MetadataReferences and a handful of options may suffice. However, if there are multiple projects involved in the analysis, it is more complicated because multiple Compilations need to be created with references between them.

To simplify the construction process. Roslyn provides the Workspace API, which can be used to model solutions, projects and documents. The Workspace API performs all of the heavy lifting needed to parse SyntaxTrees from source code, load MetadataReferences, and construct Compilations and add references between them.

@markwaterman
markwaterman / SqlDependency.cs
Last active June 4, 2023 22:34
ScaleOut SqlDependency Sample
/*
* © Copyright 2003-2017 by ScaleOut Software, Inc.
*
* LICENSE AND DISCLAIMER
* ----------------------
* This material contains sample programming source code ("Sample Code").
* ScaleOut Software, Inc. (SSI) grants you a nonexclusive license to compile,
* link, run, display, reproduce, and prepare derivative works of
* this Sample Code. The Sample Code has not been thoroughly
* tested under all conditions. SSI, therefore, does not guarantee