import Foundation | |
import RxSwift | |
import RxRelay | |
import Apollo | |
// MARK: - Apollo Support | |
enum ApolloError: Error { | |
case genericError(String) | |
case graphqlErrors([GraphQLError]) |
func addMeasurement(id: String, measurement: ClientMeasurementRequest) -> Future<GraphQLResult<AddMeasurementMutation.Data>, Error> { | |
let promise = Promise<GraphQLResult<AddMeasurementMutation.Data>, Error>() | |
Network.shared.apollo.perform(mutation: AddMeasurementMutation(client_id: id, measurementsRequest: measurement)) { response in | |
switch response.result { | |
case .success(let graphqlResult): | |
promise.success(graphqlResult) | |
case .failure(let error): | |
promise.failure(error) | |
} | |
} |
import Foundation | |
struct Post: Decodable { | |
let id: String | |
let title: String | |
let body: String | |
} | |
struct GraphQLResult<T: Decodable>: Decodable { | |
let object: T? |
Apple removed TNT’s certificate, so the app will crash after July 12th. The current solution is to sign it yourself.
Run in Terminal
codesign --force --deep --sign - /Applications/name.app
if Permission denied don't forget to add sudo
example:
XCTest is the default test harness on iOS an Apple’s other platforms. It provides support for organizing test cases and asserting expectations in your application code, and reporting the status of those expectations. It's not as fancy as some of the BDD frameworks like Quick and Cedar, but it has gotten much better than it used to be, and is my preferred test framework these days.
One place where the XCTest assertion utilities fall a bit short has been with managing Optional variables in swift. The default use of XCTAssertNotNil
don't provide any mechanism for unwrapping, easily leading to assertion checks like this:
class TestCaseDefault: XCTestCase {
Empire and Metasploit 101 | |
Goal: Use Empire and metasploit in example situation of network exploitation and post-exploitation host enumeration. We will exploit a network service on a Windows 7 VM, and then use our low-privilege shell to then execute an empire powershell stager, which will create an Empire agent on the local Windows 7 VM. After this, we will look through the various options available as an Empire agent. | |
Following this, we will generate a DLL stager within Empire, and then use our existing meterpreter session on the Windows 7 VM to perform a DLL injection attack, to inject another Empire agent, directly into memory. | |
Pre-Stuff: Empire is not just for windows. It has python based agents that can run on OS X and Linux. It's communication profile between agents and listeners is configurable, similar to CobaltStrikes. You can use pre-built or custom-made ones to employ such functionality. Empire is designed to stay off disk and in memory as much as possible. Empire does contain modules that will |
Setup for
First, install all three tools above. (Or just iTerm2 if you don't care about keyboard speedups; or just Karabiner Elements & Hammerspoon if you don't care about iTerm2).
Then clone this repository to your local computer: run this in Terminal:
http://stackoverflow.com/questions/24380159/corebluetooth-and-wifi-interference
http://lists.apple.com/archives/bluetooth-dev/2013/Aug/msg00023.html
This is a well known issue, and it has a solution that is confirmed to work for the Mac side.
sudo defaults write /Library/Preferences/com.apple.airport.bt.plist bluetoothCoexMgmt Hybrid
After you run this script, the issue will go away and BT connections will remain stable.
The initial source comes from sdcuike/issueBlog#4
https://github.com/PacktPublishing free to download books code by Packet
https://github.com/EbookFoundation/free-programming-books Very immense