Some notes, tools, and techniques for reverse engineering macOS binaries.
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
| # Author: Shubhang, 2023 | |
| # Description: This Python script demonstrates how to visualize audio using NumPy, Matplotlib, and MoviePy. | |
| # It reads an audio file in WAV format, converts the audio samples to a NumPy array, | |
| # and creates a video animation from a plot of the audio samples. | |
| # The resulting video file shows the amplitude of the audio samples over time. | |
| import numpy as np | |
| import matplotlib.pyplot as plt |
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
| from io import StringIO | |
| import sys | |
| from typing import Dict, Optional | |
| from langchain.agents import load_tools | |
| from langchain.agents import initialize_agent | |
| from langchain.agents.tools import Tool | |
| from langchain.llms import OpenAI |
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
| """ | |
| Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy) | |
| BSD License | |
| """ | |
| import numpy as np | |
| # data I/O | |
| data = open('input.txt', 'r').read() # should be simple plain text file | |
| chars = list(set(data)) | |
| data_size, vocab_size = len(data), len(chars) |
This isn't a guide about locking down homebrew so that it can't touch the rest of your system security-wise.
This guide doesn't fix the inherent security issues of a package management system that will literally yell at you if you try to do something about "huh, maybe it's not great my executables are writeable by my account without requiring authorization first".
But it absolutely is a guide about shoving it into its own little corner so that you can take it or leave it as you see fit, instead of just letting the project do what it likes like completely taking over permissions and ownership of a directory that might be in use by other software on your Mac and stomping all over their contents.
By following this guide you will:
- Never have to run
sudoto forcefully change permissions of some directory to be owned by your account
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
| input=(73 foobar) | |
| rg="^[+\-]{0,1}[0-9]+$" | |
| for num in "${input[@]}"; do | |
| (echo "${num//[^\-+0-9]/}" | grep -Eq $rg) \ | |
| && echo "$num is a number" \ | |
| || echo "$num is not a number"; | |
| nnum="-"$num | |
| (echo "${nnum//[^\-+0-9]/}" | grep -Eq $rg) \ |
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/osascript | |
| tell application "iTerm2" | |
| # Open window in full screen | |
| tell application "System Events" | |
| keystroke "f" using {control down, command down} | |
| end tell | |
| set serverSession to current session of current window | |
| tell serverSession |
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
| // Traverse a dom element | |
| const stores = new Set(); | |
| const traverse = (element) => { | |
| let store = | |
| element?.memoizedState?.element?.props?.store | |
| || element?.pendingProps?.store | |
| || element?.stateNode?.store; | |
| if (store) { | |
| stores.add(store); |
