This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env zsh | |
| # | |
| # sigpatch.zsh — Fix macOS SIP errors by ad-hoc signing unsigned Python native libraries | |
| # | |
| # Scans the active Conda environment for unsigned native libraries (.so/.dylib) | |
| # and optionally ad-hoc signs them for compatibility with macOS SIP (e.g., Sequoia). | |
| # | |
| # Usage: | |
| # ./sigpatch.zsh --audit # Scan and list unsigned libraries |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ============================================================================= | |
| // XNU kperf/kpc demo | |
| // Available for 64-bit Intel/Apple Silicon, macOS/iOS, with root privileges | |
| // | |
| // | |
| // Demo 1 (profile a function in current thread): | |
| // 1. Open directory '/usr/share/kpep/', find your CPU PMC database. | |
| // M1 (Pro/Max/Ultra): /usr/share/kpep/a14.plist | |
| // M2 (Pro/Max): /usr/share/kpep/a15.plist | |
| // M3: /usr/share/kpep/as1.plist |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // gcc -o try-catch-ex try-catch.c try-catch-ex.c | |
| #include <stdio.h> | |
| #include "try-catch.h" | |
| // Example of use for try-catch.h | |
| int main(int argc, char *argv[]) | |
| { | |
| int i = 101; | |
| printf("before try block...\n"); |