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
// | |
// Copyright (c) 2016, 2018 Nikolai Ruhe. All rights reserved. | |
// | |
import Foundation | |
public extension FileManager { | |
/// Calculate the allocated size of a directory and all its contents on the volume. |
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
# Hat tip to https://github.com/anders/pwgen for various initial documentation | |
# For an alternative method, check out: | |
# https://gist.github.com/pudquick/8d3dedc337161b187a8a1c9564c83463 | |
import objc | |
from Foundation import NSBundle, NSMutableArray, NSString | |
SecurityFoundation = NSBundle.bundleWithPath_('/System/Library/Frameworks/SecurityFoundation.framework') | |
success = SecurityFoundation.load() |
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 objc | |
from Foundation import NSBundle | |
IOKit_bundle = NSBundle.bundleWithIdentifier_('com.apple.framework.IOKit') | |
functions = [ | |
("IORegistryEntryFromPath", b"II*"), | |
("IORegistryEntryCreateCFProperty", b"@I@@I"), | |
] |
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
// | |
// NVRAMManager.swift | |
// | |
// Created by Matt Hansen on 1/30/16. | |
// The Pennsylvania State University. | |
// | |
// http://www.opensource.apple.com/source/system_cmds/system_cmds-643.30.1/nvram.tproj/nvram.c | |
import IOKit | |
import Foundation |
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
library(RCurl) | |
library(gtools) | |
parseldap<-function(url, userpwd=NULL) | |
{ | |
ldapraw<-getURL(url, userpwd=userpwd) | |
# seperate by two new lines | |
ldapraw<-gsub("(DN: .*?)\n", "\\1\n\n", ldapraw) | |
ldapsplit<-strsplit(ldapraw, "\n\n") | |
ldapsplit<-unlist(ldapsplit) |
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 python | |
''' | |
Playing around with CoreWLAN to return information about the wi-fi connection | |
Documentation: | |
https://developer.apple.com/library/mac/documentation/CoreWLAN/Reference/CWInterface_reference/translated_content/CWInterface.html | |
''' | |
import objc |
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
<?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> | |
<key>Disabled</key> | |
<false/> | |
<key>Label</key> | |
<string>com.foo.displaymirroring</string> | |
<key>LimitLoadToSessionType</key> | |
<array> |