Skip to content

Instantly share code, notes, and snippets.

{
"Key Mappings": {
"0xf702-0x320000": {
"Text": "",
"Action": 33
},
"0xf702-0x300000": {
"Text": "0x01",
"Action": 11
},
@danylokos
danylokos / demo.swift
Created December 24, 2020 15:19
swift multi protocol error
/*
compilation error:
Type 'StructC' does not conform to protocol 'ProtoA'
Type 'StructC' does not conform to protocol 'ProtoB'
*/
protocol ProtoAInput {
@danylokos
danylokos / tips.md
Last active February 6, 2024 09:12
Debugging 3rd party apps on iOS and Android

Debugging 3rd party apps on iOS and Android

Part I: iOS

Prerequisites

  • checkra1n
    • A7 - A10 devices (iPhone 5s - iPhone X), iOS 12.0+
    • Dropbear SSH, port 44, root:alpine
  • USB multiplexing daemon usbmuxd (available via brew)
  • Use scp to copy file to/from device

Forward remote (iDevice) port 44 (Dropbear SSH) to local (Mac) 2222

@danylokos
danylokos / ent.xml
Created November 13, 2020 16:51
debug server entitlements
<?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>com.apple.backboardd.debugapplications</key>
<true/>
<key>com.apple.backboardd.launchapplications</key>
<true/>
<key>com.apple.diagnosticd.diagnostic</key>
<true/>
@danylokos
danylokos / converter.py
Created December 5, 2019 20:56
Converts Keras .h5 model to CoreML .mlmodel'
#!/usr/bin/env python
'''
./converter.py \
--model model.h5 \
--desc "Predicts either a phone is in the hands or in a pocket" \
--input_desc "Sensor samples (acc, gyro, mag, 50Hz)" \
--output_desc "1 - phone in the hands, 0 - phone in a pocket" \
--author "Danylo Kostyshyn" \
--license="MIT"
diff:
/usr/local/bin/code -d -n -w $LOCAL $REMOTE
merge:
/usr/local/bin/code -n -w $MERGED
@danylokos
danylokos / aria2c.md
Created October 29, 2019 08:57
aria2c multithread download
aria2c \
-x 16 \
-s 16 \
--load-cookies=cookies.txt \
https://download.developer.apple.com/Developer_Tools/Xcode_10.3/Xcode_10.3.xip
@danylokos
danylokos / launchpad.md
Last active November 21, 2019 12:52
Change macOS Launchpad grid size
  1. set number of columns
defaults write com.apple.dock springboard-columns -int 10
  1. set number of rows
defaults write com.apple.dock springboard-rows -int 6
@danylokos
danylokos / macos-bootable-usb.md
Last active August 11, 2020 09:30
macOS Catalina bootable USB
  1. Download installer
softwareupdate --fetch-full-installer

or specific version

softwareupdate --fetch-full-installer --full-installer-version 10.15.5
@danylokos
danylokos / iterm2_key_bindings.md
Last active October 9, 2023 10:27
iTerm2 key bindings

iTerm2 Key Bindings

Keys Config Desc
Del send hex 0x15 delete line
Del send hex 0x1B 0x08 delete word
send hex 0x01 move cursor to the beginning of a line
send hex 0x05 move cursor to the end of a line
send esc seq Esc+b move cursor to the left by word
⌥ → send esc seq Esc+f move cursor to the right by word