Skip to content

Instantly share code, notes, and snippets.

View 0bmxa's full-sized avatar

Max 0bmxa

  • Berlin
View GitHub Profile
@masklinn
masklinn / cheatsheet.md
Last active June 18, 2024 17:54
launchctl/launchd cheat sheet

I've never had great understanding of launchctl but the deprecation of the old commands with launchctl 2 (10.10) has been terrible as all resources only cover the old commands, and documentation for Apple utilities is generally disgracefully bad, with launchctl not dissembling.

Mad props to https://babodee.wordpress.com/2016/04/09/launchctl-2-0-syntax/ which contains most details

domains

Internally, launchd has several domains, but launchctl 1 would only ask for service names,

@lemonkey
lemonkey / gist:637e855e0ba118a50218
Last active June 9, 2017 18:39
Swift 2 and Objective-C Interoperability Review

Using Swift 2 and Objective-C classes within frameworks, apps and unit tests

Normal Usage:

  • Swift into Obj-C:
    • Within framework or app:
      • Because the auto generated Swift interface header "Objective-C Generated Interface Header" SWIFT_OBJC_INTERFACE_HEADER_NAME for a framework target is part of the framework’s public interface, only Swift declarations marked with the public modifier for classes or structs marked with @objc appear in this header for a framework target.
        • Framework:
          • #import <ProductName/ProductModuleName-Swift.h>
          • This could go in the Framework’s prefix PCH file if used as a local dev pod, otherwise not recommended (reserve PCH for things that don’t change often like UIKit, etc.)
  • Note: You can still use Swift methods and properties that are marked with the internal modifier from within the ObjC part of your framework, as long they are declared within a Swift class that inherits from an ObjC class.
@derhuerst
derhuerst / _.md
Last active June 9, 2024 10:05
List of HAFAS API Endpoints
@kirsteins
kirsteins / Array -> UnsafeMutablePointer -> Array
Last active June 16, 2024 09:42
Array -> UnsafeMutablePointer -> Array
var initalArray = [1, 2, 3]
let pointer: UnsafeMutablePointer<Int> = UnsafeMutablePointer(initalArray)
let arrary = Array(UnsafeBufferPointer(start: pointer, count: initalArray.count))
@ddz
ddz / ios_lockdown_diag_services.md
Last active May 12, 2023 15:14
iOS Lockdown Diagnostic Services

TL;DR

  • Pairing an iOS device to a host (computer running iTunes) gives that host significant access to data on the iOS device and requires connecting the unlocked iOS device to a host over USB
  • Once paired, that host (or another host that has stolen its pairing record) can access significant amounts of user personal data from the iOS device over USB and Wi-Fi through the com.apple.mobile.file_relay and com.apple.mobile.house_arrest lockdown services
  • These services will not return user data files that are encrypted and locked by iOS Data Protection but the files returned by file_relay are not protected by iOS Data Protection and do include significant amounts of personal user data that would otherwise be encrypted in iTunes encrypted backups ("Encrypt Backup" is enabled)
  • The com.apple.mobile.file_relay service is not used or referenced by any public Apple software so its intended client software is unknown outside of Apple
  • Apple released a [Knowledge Base article](https://support.apple.co
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active June 29, 2024 08:12
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname