Skip to content

Instantly share code, notes, and snippets.

View TheBestTvarynka's full-sized avatar
🦀
I'm currently rewriting all in Rust

Pavlo Myroniuk TheBestTvarynka

🦀
I'm currently rewriting all in Rust
View GitHub Profile
@awakecoding
awakecoding / CertCredentialMarshaledString.ps1
Last active January 19, 2024 16:03
Handle RDP smartcard automatic selection through special '@@'-prefixed usernames containing SHA1 certificate hash
Add-Type -TypeDefinition @"
using System;
using System.Runtime.InteropServices;
namespace WinCred
{
public enum CRED_MARSHAL_TYPE
{
CertCredential = 1,
UsernameTargetCredential,
@odzhan
odzhan / tlsclient.cpp
Created June 7, 2022 00:06
C++ SSPI Schannel TLS example
// Compiles with Visual Studio 2008 for Windows
// This C example is designed as more of a guide than a library to be plugged into an application
// That module required a couple of major re-writes and is available upon request
// The Basic example has tips to the direction you should take
// This will work with connections on port 587 that upgrade a plain text session to an encrypted session with STARTTLS as covered here.
// TLSclient.c - SSPI Schannel gmail TLS connection example
#define SECURITY_WIN32
@awakecoding
awakecoding / RdpProps.txt
Last active July 8, 2025 18:12
RDP Property Sets
CoreProperties(324):
ServerName (String)
ServerNetBiosName (String)
ServerFqdn (String)
ServerAddressesToConnect (none)
UserSpecifiedServerName (String)
UserName (String)
Domain (String)
Password (SecureString)
AlternateShell (String)
@motorailgun
motorailgun / idea.md
Last active July 22, 2025 15:29
Installing Windows and Linux into the same partition

Installing Windows and Linux into the same partition

But WHY?

There was a reddit post about installing Arch on NTFS3 partition. Since Windows and Linux doesn't have directories with same names under the /(C:\), I thought it's possible, and turned out it was actually possible.
If you are not familiar to Linux, for example you've searched on Google "how to dualboot Linux and Windos" or brbrbr... you mustn't try this. This is not practical.

Pre-requirements

  • UEFI system
  • Any Linux live-boot CD/DVD/USB... with Linux kernel newer than 5.15
  • Windows installer USB
@Kestrer
Kestrer / how-to-write-hygienic-macros.md
Created October 17, 2020 05:35
A guide on how to write hygienic Rust macros

How to Write Hygienic Rust Macros

Macro hygiene is the concept of macros that work in all contexts; they don't affect and aren't affected by anything around them. Ideally all macros would be fully hygienic, but there are lots of pitfalls and traps that make it all too easy to accidentally write unhygienic macros. This guide attempts to provide a comprehensive resource for writing the most hygienic macros.

Understanding the Module System

First, a little aside on the details of Rust's module system, and specifically paths; it is

@mtolk
mtolk / mermaid.html
Created September 16, 2020 12:59
This gist was created to anwser a question about using mermaidjs in the zola static site generator: https://zola.discourse.group/t/mermaid-integration/573?u=marco
<!-- should be in templates/ -->
<html>
<head>
<style>
div.mermaid {
width:25%;
}
</style>
</head>
<body>
@luodaoyi
luodaoyi / hook.cpp
Created March 27, 2019 17:21
LoadLibrary Hook
MinHook addr:
https://github.com/TsudaKageyu/minhook
```c
#include "MinHook.h"
typedef HMODULE (WINAPI *TYPE_LoadLibraryA)(LPCSTR);
TYPE_LoadLibraryA g_loadLibraryA_original = NULL;
HMODULE WINAPI LoadLibraryA_replacement(_In_ LPCTSTR lpFileName)
@troyharvey
troyharvey / .gitlab-ci.yml
Last active March 20, 2025 12:36
Deploy Google Cloud Functions: GitLab CI/CD Pipeline Config File
# Update Jan 2024
# Deploying Cloud Functions is much simpler than it was 6 years ago.
# I'm leaving the gist in it's original 2018 state for now,
# but skip the the recent comments below for a simpler solution.
variables:
GCP_ZONE: us-central1-a
stages:
- npm-install
@demidovakatya
demidovakatya / anime.md
Last active August 23, 2024 22:16
telegram stickers // anime
@timvisee
timvisee / falsehoods-programming-time-list.md
Last active October 31, 2025 18:31
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).