Skip to content

Instantly share code, notes, and snippets.

View T1T4N's full-sized avatar
👽

Robert Armenski T1T4N

👽
View GitHub Profile
@T1T4N
T1T4N / workaround.md
Created March 24, 2022 13:46
coc.nvim python linter fix for macOS 12.3
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister /Library/QuickLook/QuickNFO.qlgenerator
1. If that doesn't work, create a dummy script application using Script Editor and copy `UTExportedTypeDeclarations` from QuickNFO.qlgenerator/Contents/Info.plist to this dummy app's Info.plist
2. lsregister RegisterUTI-NFO.app
// ==UserScript==
// @name Redirect to teddit
// @description Automatically redirect from Reddit to Teddit
// @match https://old.reddit.com/*
// @match https://www.reddit.com/*
// @match https://reddit.com/*
// @grant none
// @run-at document-start
// ==/UserScript==
// ==UserScript==
// @name Redirect to nitter
// @description Automatically redirect from twitter to nitter
// @match https://mobile.twitter.com/*
// @match https://twitter.com/*
// @grant none
// @inject-into content
// @run-at document-start
// ==/UserScript==
@T1T4N
T1T4N / swiftpm-strip.txt
Created February 4, 2022 09:30
SwiftPM Release Builds
SwiftPM builds don't pass -dead_strip to the linker by default,
you might want to pass -Xlinker -dead_strip for release builds
if you care about binary size
Preview on macOS 10.14.6 Mojave can remove PDF owner password
@T1T4N
T1T4N / safari_inject.m
Created January 28, 2022 20:49
Restore old tab bar in Safari 15.0 (16612.1.29.41.4, 16612)
// Restores old tab bar in Safari 15.0 (16612.1.29.41.4, 16612)
// clang -fmodules -shared -Wall -Os -o libsafariinject.dylib safariinject.m
//
// If SIP off:
// DYLD_INSERT_LIBRARIES=$PWD/libsafariinject.dylib /Applications/Safari.app/Contents/MacOS/Safari
//
// If SIP on, you can demo this by manually removing Safari's code signing signature, but many
// features (eg saved logins) won't be readable by the resigned app:
// cp -a /Applications/Safari.app ./
// codesign --remove Safari.app/Contents/MacOS/Safari
@T1T4N
T1T4N / poc-jailbreak.c
Created January 28, 2022 20:20
macOS 11.5.2-iOS 14.7.1 Kernel Race Condition POC Jailbreak
/*
Written By Pan ZhenPeng(@peterpan980927) of Alibaba Security Pandora Lab
use it on macOS: cc poc.c -o poc while True; do ./poc ; done
*/
#include <errno.h>
#include <signal.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
@T1T4N
T1T4N / sandbox_exec.sh
Created January 27, 2022 09:02
sandbox-exec usage example
/usr/bin/sandbox-exec
-p
'(version 1) (allow default) (deny network-outbound (remote ip)) (allow network-outbound (remote ip "localhost:*"))'
/Library/Developer/XcodeServer/CurrentXcodeSymlink/Contents/Developer/usr/share/xcs/Node/bin/node
/Library/Developer/XcodeServer/CurrentXcodeSymlink/Contents/Developer/usr/share/xcs/xcsd/worker.js
@T1T4N
T1T4N / swift-build-disable-sandbox.sh
Created January 26, 2022 15:19
Build a Swift binary without sandbox
swift build --configuration release --disable-sandbox