Skip to content

Instantly share code, notes, and snippets.

View okitavera's full-sized avatar
🏖️
Hiatus (kind of)

Nanda Oktavera okitavera

🏖️
Hiatus (kind of)
View GitHub Profile
@fabiomaggio
fabiomaggio / git-filter-branch-move-files.md
Last active October 20, 2022 08:48
Use git filter-branch to move all projects files to a subdir and rewrite all commits
  1. Clone project

  2. Checkout all branches that contain the files that should be moved

  3. Delete the remote

  4. Run the filter-branch command:

    git filter-branch --tree-filter 'mkdir -p /path/to/tmp; mv * /path/to/tmp; mkdir subdir; mv /path/to/tmp/* subdir/' --tag-name-filter cat --prune-empty -- --all
    • All files are first copied to a temporary dir and move from there to the new destination
  • Existing tags are updated
@popsUlfr
popsUlfr / ntdll_override.c
Created October 31, 2018 17:24
Loads a custom ntdll.dll.so in wine for Bayonetta
/* gcc -m32 -O2 -Wall -shared -fPIC -ldl -o ntdll_override.so ntdll_override.c */
#define _GNU_SOURCE
#include <dlfcn.h>
#include <string.h>
#include <unistd.h>
#include <limits.h>
#include <stdlib.h>
typedef void* (*wine_dlopen_func_type)(const char *filename, int flag, char *error, size_t errorsize);