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
| import "hash" | |
| private rule Macho | |
| { | |
| meta: | |
| description = "private rule to match Mach-O binaries" | |
| condition: | |
| uint32(0) == 0xfeedface or uint32(0) == 0xcefaedfe or uint32(0) == 0xfeedfacf or uint32(0) == 0xcffaedfe or uint32(0) == 0xcafebabe or uint32(0) == 0xbebafeca | |
| } |
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
| As of iOS 11/macOS High Sierra, and only including ones in Foundation and CoreFoundation | |
| Strings: | |
| _NSCFString - a CFStringRef or CFMutableStringRef. This is the most common type of string object currently. | |
| - May have 8 bit (ASCII) or 16 bit (UTF-16) backing store | |
| _NSCFConstantString - a compile time constant CFStringRef, like you'd get with @"foo" | |
| - May also be generated by dynamic string creation if matches a string in a pre-baked table of common strings called the StringROM | |
| NSBigMutableString - an NSString backed by a CFStorage (https://github.com/opensource-apple/CF/blob/master/CFStorage.h) for faster handling of very large strings | |
| NSCheapMutableString - a very limited NSMutableString that allows for zero-copy initialization. Used in NSFileManager for temporarily wrapping stack buffers. |
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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <!-- Launch Daemon do not always have access to all the path variables | |
| As a results, scripts will sometimes fail if the you are using path variables inside them | |
| To enable the script to have access to all path variables, open up a terminal and type in --> | |
| <!-- echo $PATH --> | |
| <!-- You can opt to filter out some of the path variables which are not required by script--> | |
| <key>EnvironmentVariables</key> |
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
| class RSVerticallyCenteredTextFieldCell: NSTextFieldCell { | |
| var mIsEditingOrSelecting:Bool = false | |
| override func drawingRect(forBounds theRect: NSRect) -> NSRect { | |
| //Get the parent's idea of where we should draw | |
| var newRect:NSRect = super.drawingRect(forBounds: theRect) | |
| // When the text field is being edited or selected, we have to turn off the magic because it screws up | |
| // the configuration of the field editor. We sneak around this by intercepting selectWithFrame and editWithFrame and sneaking a | |
| // reduced, centered rect in at the last minute. |
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
| class Tuple(tuple): | |
| def __getattr__(self, name): | |
| def _int(val): | |
| try: | |
| return int(val) | |
| except ValueError: | |
| return False | |
| if not name.startswith('_') or not _int(name[1:]): | |
| raise AttributeError("'tuple' object has no attribute '%s'" % name) |
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
| # first install pygmentize to the mac OS X or macOS system with the built-in python | |
| sudo easy_install Pygments | |
| # then add alias to your ~/.bash_profile or ~/.bashrc or ~/.zshrc etc. | |
| alias pcat='pygmentize -f terminal256 -O style=native -g' |
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
| # 1. Put this file to /etc/pf.conf | |
| # 2. Install init boot scripts using IceFloor then - http://www.hanynet.com/icefloor/ | |
| # I tried to use IceFloor to configure everything but it didn't work very well. | |
| # 3. Once done, you can confirm the rules were loaded with 'sudo pfctl -sr' | |
| # 4. At System Preferences -> Security -> Firewall -> Firewall Options, | |
| # check 'Block all incoming connections' to prevent annoying per-app dialogs. | |
| set skip on lo0 | |
| set block-policy drop |
[ Update 2025-03-24: Commenting is disabled permanently. Previous comments are archived at web.archive.org. ]
Most of the terminal emulators auto-detect when a URL appears onscreen and allow to conveniently open them (e.g. via Ctrl+click or Cmd+click, or the right click menu).
It was, however, not possible until now for arbitrary text to point to URLs, just as on webpages.
- Install XQuartz: https://www.xquartz.org/
- Launch XQuartz. Under the XQuartz menu, select Preferences
- Go to the security tab and ensure "Allow connections from network clients" is checked.
- Run
xhost + ${hostname}to allow connections to the macOS host * - Setup a HOSTNAME env var
export HOSTNAME=`hostname`* - Add the following to your docker-compose:
environment: