Skip to content

Instantly share code, notes, and snippets.

View ysc3839's full-sized avatar

Richard Yu ysc3839

View GitHub Profile
@Dovias
Dovias / terminal-default-application-admin.md
Last active July 3, 2025 17:44
Set Windows 10/11 default terminal for admin privileges

Set Windows 10/11 default terminal for admin and user-level privileges

This tutorial allows you to manually set version of microsoft/terminal to be used as default terminal with and without administrative privileges on Microsoft Windows 10 or 11.

Note

This tutorial is for educational purposes only. I am not responsible for any damages that may have caused this. By attempting to follow this guide, you are on your own risk.

Instructions.

  1. Download unpackaged version of Microsoft Terminal from GitHub. You can find latest working version for this guide here..

[!NOTE]

@cuihaoleo
cuihaoleo / cdm-fio.py
Created June 8, 2020 19:36
Something like CrystalDiskMark
#!/usr/bin/env python3
import json
import subprocess
import tempfile
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("-n", "--loops", type=int, default=5,
help="Number of runs for each test.")
@namidairo
namidairo / pppd-cve.py
Last active January 25, 2022 08:05
Xiaomi RM2100 1.0.14 vs. CVE-2020-8597
from scapy.all import *
from socket import *
interface = "enp0s31f6"
def mysend(pay,interface = interface):
sendp(pay, iface = interface)
def packet_callback(packet):
@Treeki
Treeki / TurnipPrices.cpp
Last active June 10, 2025 03:05
AC:NH turnip price calculator
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
// munged from https://github.com/simontime/Resead
namespace sead
{
class Random
{
@ADeltaX
ADeltaX / main.cpp
Last active June 29, 2025 14:48
Example of creating a window using a private api on a dll-injected immersive process
#include "pch.h"
#pragma comment(lib, "gdi32.lib")
enum ZBID
{
ZBID_DEFAULT = 0,
ZBID_DESKTOP = 1,
ZBID_UIACCESS = 2,
ZBID_IMMERSIVE_IHM = 3,
ZBID_IMMERSIVE_NOTIFICATION = 4,
#include <string_view>
#include <exception>
#include <assert.h>
using namespace std::literals;
struct guid
{
uint32_t Data1;
uint16_t Data2;
@qis
qis / parse_date.h
Last active April 5, 2022 05:50
Parse ISO 8601 date time strings in C++ and AVX2.
// if(MSVC)
// set(AVX2_FLAGS "/arch:AVX2")
// else()
// set(AVX2_FLAGS "-march=native -mavx2")
// endif()
//
// option(ENABLE_AVX2 "Enable AVX2 support" OFF)
// if(ENABLE_AVX2)
// if(CMAKE_CROSSCOMPILING)
// set(AVX2 TRUE)
@AlexBAV
AlexBAV / guid.h
Last active August 10, 2024 06:24
Constexpr GUID parsing (parsing string GUIDs at compile-time)
//-------------------------------------------------------------------------------------------------------
// constexpr GUID parsing
// Written by Alexander Bessonov
//
// Licensed under the MIT license.
//-------------------------------------------------------------------------------------------------------
#pragma once
#include <stdexcept>
#include <string>
@dcode
dcode / 75-dual-home-routing.sh
Last active May 11, 2023 03:11
NetworkManager hook to update the routing tables for dual-homed systems, allowing traffic past the gateway on either interface.
#!/bin/bash
# 75-dual-home-routing
# Description: Updates routing tables to allow traffic on dual-homed boxes
# according to the interface it came in on
# Place in /etc/NetworkManager/dispatcher.d/ and update interface name below
IF=$1
STATUS=$2
function update_routing_table() {