Skip to content

Instantly share code, notes, and snippets.

View cmsj's full-sized avatar
🏠
Working from home

Chris Jones cmsj

🏠
Working from home
View GitHub Profile
{
"global": {
"check_for_updates_on_startup": true,
"show_in_menu_bar": false,
"show_profile_name_in_menu_bar": false
},
"profiles": [
{
"complex_modifications": {
"rules": [
@cmsj
cmsj / iOS-File-System-Extraction.md
Created July 31, 2017 12:04
Guide to extract the root file system and decompress the kernel cache for iOS.

iOS File System Extraction

For iOS 10 and Up

Starting with iOS 10.0 Apple decrypted the file system and kernel cache. All you have to do is download an IPSW, change the extension to .zip, and unarchive it. The largest size disk image inside the unarchived zip will be the root file system. Simply mount it to see its contents.

Links to download all iOS IPSWs.

For iOS 9 and Below

Originally from /u/RowRocka on Reddit. Gently edited for clarity.

Links to download all iOS OTA ZIPs.

- (void)fill:(int)button withColor:(NSColor*)fillColor {
int imageSideLength = 72;
NSImage *image = [[NSImage alloc] initWithSize:NSMakeSize(imageSideLength, imageSideLength)];
[image lockFocus];
[fillColor drawSwatchInRect:NSMakeRect(0, 0, imageSideLength, imageSideLength)];
[image unlockFocus];
//NSData *imageTiff = image.TIFFRepresentation;
//NSBitmapImageRep *imageRep = [NSBitmapImageRep imageRepWithData:imageTiff];
//NSData *data = [imageRep representationUsingType:NSBitmapImageFileTypeBMP properties:@{}];
script = [[
tell application "Google Chrome"
set currentURL to URL of active tab of first window
end tell
return currentURL
]]
hs.applescript(script)
@cmsj
cmsj / tangent.lua
Last active December 23, 2017 23:06
hs.console.clearConsole()
local hubMessage = {
["INITIATE_COMMS"] = 0x01,
["PARAMETER_CHANGE"] = 0x02,
["PARAMETER_RESET"] = 0x03,
["PARAMETER_VALUE_REQUEST"] = 0x04,
["MENU_CHANGE"] = 0x05,
["MENU_RESET"] = 0x06,
["MENU_STRING_REQUEST"] = 0x07,
@cmsj
cmsj / homegnu.sh
Last active April 28, 2019 13:38
#!/bin/echo Don't execute this script directly, source it into your shell.
# This script will attempt to make your macOS system behave more like GNU for shell scripts
# by diverting as many commands as possible, to the GNU versions, provided by Homebrew
#
# For most Homebrew tools, their presence in /usr/local/bin and that being in your $PATH
# means you can use them as-is, but some tools appear with different names because macOS
# already has such a tool (e.g. find(1)). These tools generally also have a `gnubin` path
# which we can use to make them higher priority than the macOS equivalents.
#
# To use this:
@cmsj
cmsj / lol.py
Last active April 14, 2018 08:20
#!/usr/bin/env python
"""
Enforce the usage of Hammerspoon's Lua stack guarding macros
"""
from __future__ import print_function
import sys
from clang.cindex import Config
from clang.cindex import Index
diff --git a/usb_loader/switch.conf b/usb_loader/switch.conf
index f4555c3..39e1474 100644
--- a/usb_loader/switch.conf
+++ b/usb_loader/switch.conf
@@ -1,5 +1,3 @@
switch
hid,1024,0x80000000,0x80000000,2G
-../../linux/arch/arm64/boot/Image.gz:load 0x83000000
-../../linux/arch/arm64/boot/dts/nvidia/tegra210-nintendo-switch.dtb:load 0x8d000000
switch.scr.img:load 0x8e000000,jump_direct 0x8e000000
diff --git a/arch/arm64/boot/dts/nvidia/tegra210-nintendo-switch.dts b/arch/arm64/boot/dts/nvidia/tegra210-nintendo-switch.dts
index 814f414..e9c0a5f 100644
--- a/arch/arm64/boot/dts/nvidia/tegra210-nintendo-switch.dts
+++ b/arch/arm64/boot/dts/nvidia/tegra210-nintendo-switch.dts
@@ -983,6 +983,14 @@
compatible = "gpio-keys";
label = "gpio-keys";
+ power {
+ label = "Power";
#!/usr/bin/env python3
"""syslogreceiver.py - receive remote syslog events and pass them into
systemd's journal"""
import re
import socketserver
from systemd import journal
HOST, PORT = "0.0.0.0", 514