Skip to content

Instantly share code, notes, and snippets.

@mmozeiko
mmozeiko / callstack_dump.c
Last active April 28, 2025 22:04
dumps callstack of all threads in a single process
#include <windows.h>
#include <dbghelp.h>
#include <tlhelp32.h>
#include <stdlib.h>
#include <stdio.h>
#pragma comment (lib, "dbghelp")
#pragma comment (lib, "advapi32")
int main(int argc, char* argv[])
@iamwildtuna
iamwildtuna / gist:7772b7c84a11bf6e1385f23096a73a15
Last active April 28, 2025 22:02
VPN IP Addresses (IP адреса ChatGPT, Copilot, Meta, Facebook, Instagram, YouTube, Medium, X ex. Twitter, Discord)
Meta (Instagram, Facebook)
// Узлы
157.240.253.174, 157.240.253.172, 157.240.253.167, 157.240.253.63, 157.240.253.32
157.240.252.174, 157.240.252.172, 157.240.252.167, 157.240.252.63, 157.240.252.38
57.144.112.34, 57.144.110.1, 157.240.205.174
// Подсети
213.102.128.0/24
204.15.20.0/22
199.201.0.0/16
@letientai299
letientai299 / mermaid-pandoc-guide.md
Last active April 28, 2025 22:01
Render PDF from markdown that using mermaid

Render PDF from Markdown that using mermaid

You will need:

This guide is based on Ubuntu, for other OS, use their package manager instead.

@ktzar
ktzar / index.md
Created May 30, 2016 20:18
Why Most Unit Testing is Waste

Why Most Unit Testing is Waste

By James O Coplien from http://rbcs-us.com/documents/Why-Most-Unit-Testing-is-Waste.pdf

1.1 Into Modern Times

Unit testing was a staple of the FORTRAN days, when a function was a function and was sometimes worthy of functional testing. Computers computed, and functions and procedures represented units of computation. In those days the dominant design process composed complex external functionality from smaller chunks, which in turn orchestrated yet smaller chunks, and so on down to the level of well-understood primitives. Each layer supported the layers above it. You actually stood a good chance that you could trace the functionality of the things at the bottom, called functions and procedures, to the requirements that gave rise to them out at the human interface. There was hope that a good designer could understand a given function’s business purpose. And it was possible, at least in well-structured code, to reason about the calling tree. You could mentally simulate

@eylenburg
eylenburg / msoffice_in_linux.md
Last active April 28, 2025 21:57
Installing Microsoft Office in Linux

Step by step guide: How to install Microsoft Office in any Linux distribution

There are multiple options how to install MS Office on Linux.

VM-based - Integrate Windows apps running in a Windows virtual machine as native-looking in Linux

  1. Winapps, based on KVM, QEMU, Docker/Podman and FreeRDP. Still actively maintained (getting Github commits). Decribed below
  2. Cassowary, based on KVM, QEMU, libvirt/virt-manager, and FreeRDP. Has a helpful GUI and apparently can auto-suspend the VM when no Windows app is in use. Last release in Feb 2022 and seems to be abandoned.

The VM-based options means can run Office 2021 or Office 365 including all apps, but while the Windows apps themselves run flawlessly (as they're running on real Windows) there's various freerdp-related bugs you may encounter.

@KuRRe8
KuRRe8 / GIST.MD
Created April 28, 2025 21:55
I love GitHub Gist

⚡ I LOVE GIST ⚡

🎯 One file. One idea. One universe.

🚀 Why Gist is the Best Thing Ever

  • Zero setup, zero commitment.
    ✅ Code now, organize... maybe never.

  • Public? Private?

@sroebert
sroebert / renderServerComponent.ts
Last active April 28, 2025 21:54
A (hacky) way to render server components for React testing library.
import type { PropsWithChildren, ReactElement, ReactNode } from 'react';
import React, { Children, cloneElement, isValidElement } from 'react';
import { render } from '@testing-library/react';
function setFakeReactDispatcher<T>(action: () => T): T {
/**
* We use some internals from React to avoid a lot of warnings in our tests when faking
* to render server components. If the structure of React changes, this function should still work,
* but the tests will again print warnings.
@aldelaro5
aldelaro5 / ghidra_mgba_gdb.md
Last active April 28, 2025 21:48
Debugging with ghidra + mgba's GDB server

CURRENTLY WORKS MOSTLY FOR LINUX, WINDOWS INSTRUCTIONS WILL BE WRITTEN EVENTUALLY

Requirements

  • mgba BUILT FROM SOURCE, this is because you need some changes that as of this writting, aren't present in the lattest version (0.9.3). They will only be present in a release in 0.10.0+
  • Ghidra 10.0.3+ (you NEED 10.0.3+ due to fixes being applied that specifically impacts this process as well as a feature that allows to sync the static listing with the dynamic listing). I recommend however to install the lattest version at the time you are setting this up and upgrade as you feel like it (projects are usually upwards compatible, but the opposite isn't true).
  • gdb-multiarch. You need the multiarch version because it has every targets enabled includring armv4t which is the one we care about here.
  • GhidraGBA extension (you need to modify extension.properties in the zip to have the version say your ghidra's version (like "10.0.3" or "10.1") so it can be installed).
  • If you want better step over experi
@mrlesmithjr
mrlesmithjr / duplicati_excludes.txt
Last active April 28, 2025 21:40
Duplicati backup exclude list for Linux, macOS, and Windows
-[.*/.*/?packer_cache/]
-[.*\.DS_Store]
-[.*\.tmp]
-[/home/.*/.ansible_async/]
-[/home/.*/.ansible/]
-[/home/.*/.atom/]
-[/home/.*/.cache/]
-[/home/.*/.config/Duplicati/]
-[/home/.*/.cups/]
-[/home/.*/.docker/]
//
// ContentView.swift
// AppleMusicLyricsPlayer
//
// Created by Magesh Sridhar on 2/5/23.
//
import SwiftUI
import AVKit