Skip to content

Instantly share code, notes, and snippets.

View john-peterson's full-sized avatar

John Sebastian Peterson john-peterson

View GitHub Profile
@likamrat
likamrat / WinGet_WinSrv.ps1
Created February 13, 2023 00:41
Installing Winget om Windows Server 2019/2022
Write-Information "This script needs be run on Windows Server 2019 or 2022"
If ($PSVersionTable.PSVersion.Major -ge 7){ Write-Error "This script needs be run by version of PowerShell prior to 7.0" }
# Define environment variables
$downloadDir = "C:\WinGet"
$gitRepo = "microsoft/winget-cli"
$msiFilenamePattern = "*.msixbundle"
$licenseFilenamePattern = "*.xml"
$releasesUri = "https://api.github.com/repos/$gitRepo/releases/latest"

NSP Update Patcher

Instructions:

  1. Place your base NSP, update NSP, and prod.keys into a new folder
  2. Open a terminal and cd into this folder
  3. Download and run script:
curl -o nsp_update_patcher.sh https://gist.githubusercontent.com/willfaust/fb90dec409b8918290012031f09a78ef/raw/9abf2e1b020203aec0051fad99524f8269cb1edd/nsp_update_patcher.sh && chmod +x nsp_update_patcher.sh && ./nsp_update_patcher.sh
@PatrickLang
PatrickLang / WindowsInsiderOnAzure.md
Last active April 21, 2023 18:02
Building a Windows Insider VM and running in Azure

Here's example steps for uploading a Windows VHD to Azure. I initially built mine using this Packer script, then used PowerShell to convert it - Convert-VHD -VHDType Fixed -Path <source.vhdx> -DestinationPath WindowsServer2016Insider.vhd, and last the Azure CLI 2.0 to upload it.

az login

# If you need to use a specific subscription, then 
# az account set --subscription <subscription name>

# Resource group to contain all resources
@peterspackman
peterspackman / mingw-w64-x86_64.cmake
Last active July 3, 2024 03:20
cmake toolchain file for mingw-w64 x86_64 builds on Ubuntu
# Sample toolchain file for building for Windows from an Ubuntu Linux system.
#
# Typical usage:
# *) install cross compiler: `sudo apt-get install mingw-w64`
# *) cd build
# *) cmake -DCMAKE_TOOLCHAIN_FILE=~/mingw-w64-x86_64.cmake ..
# This is free and unencumbered software released into the public domain.
set(CMAKE_SYSTEM_NAME Windows)
set(TOOLCHAIN_PREFIX x86_64-w64-mingw32)

radare2

load without any analysis (file header at offset 0x0): r2 -n /path/to/file

  • analyze all: aa
  • show sections: iS
  • list functions: afl
  • list imports: ii
  • list entrypoints: ie
  • seek to function: s sym.main
@felipec
felipec / git-marks-check
Last active September 8, 2016 02:32
Tool to check and fix git-remote-hg marks
#!/usr/bin/env ruby
require 'json'
$fix = false
$verbose = false
$git_marks = {}
$r_marks = {}
$note_marks = {}
$mode = 'hg'