Skip to content

Instantly share code, notes, and snippets.

@vocaeq
vocaeq / inject.c
Last active January 26, 2025 05:04 — forked from knightsc/inject.c
An example of how to inject code to call dlopen and load a dylib into a remote mach task. Tested on 12.5 M1 Pro.
#include <dlfcn.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <mach/mach.h>
#include <mach/error.h>
#include <errno.h>
#include <stdlib.h>
#include <sys/sysctl.h>
#include <sys/mman.h>
@HaraldKorneliussen
HaraldKorneliussen / bwts.py
Last active January 26, 2025 05:00
A naive python implementation of David A. Scott's bijective Burrows-Wheeler transform + inverse
#!/usr/bin/python
# Factor a string into nonincreasing Lyndon words,
# using Duval's algorithm
def lyndonFactor(s):
k = 0
ret = []
while k < len(s):
i = k
j = i + 1
@devomman
devomman / activate-office-windows-mac.md
Last active January 26, 2025 04:58
Microsoft Office Active or Windows Activation | Microsoft Office Activate for Mac - Free Guide

✅ Activate Microsoft Office or Windows

💠 Windows User:

  1. Download OS & Office Link: https://files.rg-adguard.net/version/5f2ad9c6-e111-76e8-06d1-56d44c136bae
  2. Open PowerShell (Not CMD). To do that, right-click on the Windows start menu and select PowerShell or Terminal.
  3. Copy and paste the code below and press enter
irm https://get.activated.win | iex
  1. You will see the activation options.
{
"version": "0.1.0",
"name": "pump",
"instructions": [
{
"name": "initialize",
"docs": [
"Creates the global state."
],
"accounts": [
@soarez
soarez / ca.md
Last active January 26, 2025 04:53
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

@shakna-israel
shakna-israel / LetsDestroyC.md
Created January 30, 2020 03:50
Let's Destroy C

Let's Destroy C

I have a pet project I work on, every now and then. CNoEvil.

The concept is simple enough.

What if, for a moment, we forgot all the rules we know. That we ignore every good idea, and accept all the terrible ones. That nothing is off limits. Can we turn C into a new language? Can we do what Lisp and Forth let the over-eager programmer do, but in C?


@wtbarnes
wtbarnes / push-to-someone-elses-pr.md
Created March 5, 2020 04:49
Brief instructions for how to modify and push to someone else's PR on github

How to Push to Someone Else's Pull Request

Let's say contributor has submitted a pull request to your (author) project (repo). They have made changes on their branch feature and have proposed to merge this into origin/master, where

origin -> https://github.com/author/repo.git

Now say you would like to make commits to their PR and push those changes. First, add their fork as a remote called

Interview Questions

Node.js

Q1: What do you mean by Asynchronous API? ☆☆

Answer: All APIs of Node.js library are aynchronous that is non-blocking. It essentially means a Node.js based server never waits for a API to return data. Server moves to next API after calling it and a notification mechanism of Events of Node.js helps server to get response from the previous API call.

Source: tutorialspoint.com

@jneuendorf-i4h
jneuendorf-i4h / download_vsix.py
Last active January 26, 2025 04:45
Download VSIX from VSCode Marketplace URL (e.g. for VSCodium if OpenVSX does not provide the extension)
"""Based on https://stackoverflow.com/a/38866913/23325241"""
import re
# Attempt to import requests and handle if it's missing
try:
import requests
requests_available = True
except ImportError:
requests_available = False
@powergun
powergun / calculate.py
Last active January 26, 2025 04:33
A python function to calculate LLM GPU requirement (approximation)
"""
See test() for a quick example.
For ollama users, use `ollama show <model>` to find the parameter and quantization details.
"""
import re
from typing import Optional, NamedTuple