Skip to content

Instantly share code, notes, and snippets.

View stephancasas's full-sized avatar

Stephan Casas stephancasas

View GitHub Profile
@stephancasas
stephancasas / EquatableProcess.swift
Created March 2, 2024 19:39
A type which records both the process identifier and the time at which the represented instance was dispatched.
//
// EquatableProcess.swift
//
// Created by Stephan Casas on 3/2/24.
//
/// A value type which records both the process identifier and the time at which the
/// represented instance was dispatched — providing a unique identity for a single
/// application instance.
struct EquatableProcess: Identifiable, Hashable {
@zhuowei
zhuowei / reachable_services.txt
Created February 21, 2023 06:26
Reachable Mach services from the app sandbox on iOS 16.1
PurpleSystemAppPort
PurpleSystemEventPort
UIASTNotificationCenter
com.apple.ABDatabaseDoctor
com.apple.AppSSO.service-xpc
com.apple.AuthenticationServicesCore.AuthenticationServicesAgent
com.apple.CARenderServer
com.apple.ClipServices.clipserviced
com.apple.CoreAuthentication.daemon
com.apple.DeviceAccess.xpc
@plembo
plembo / upnper4dont.md
Last active July 11, 2025 13:52
UPnP with EdgeRouter: Don't do it! Ubiquiti. ER-4.

Want to configure UPnP on EdgeRouter-4?

Don't do it!

Introduction

As a former sysadmin that once helped ride herd over around 1,000 servers, of which around 10% were Internet-facing, I've never been a fan of autoconfiguation when it comes to punching holes through the firewall. I've seen the tripwire logs, and it's sobering.

The Problem

So enabling UPnP on my EdgeRouter-4 wasn't something I had on the roadmap, but when I ran into difficulty getting DLNA to work on the default VLAN, I thought it was worth looking into (never mind that, as I later learned, having UPnP turned on wasn't going make a bit of difference on my local network: another reason that mastering theory should always come before practice).

@pjobson
pjobson / apple_install_dates.md
Last active September 17, 2025 18:05
OSX Install Dates

Various Versions of macOS/OSX will fail on install for various reasons. You can fix them by disconnecting from your wifi or network or resetting your NVRAM. Booting from your USB stick, opening terminal and doing: date ########## where the # nubers are below. Format is: MMDDhhmmYY

10.16 - 0.5 Leopard   - date 0101010121 <- Currently not needed
10.15 - Catalina      - date 0101010120 <- Currently not needed
10.14 - Mojave        - date 0101010119 <- Currently not needed
10.13 - High Sierra   - date 0101010118

10.12 - Sierra - date 0101010117

@jaimeiniesta
jaimeiniesta / settings.jsonc
Created May 12, 2020 10:36 — forked from thbar/settings.jsonc
Current minimalistic VSCode setup (à la atom/textmate)
// My settings for VS Code - inspired by https://gist.github.com/thbar/cfeb158fb6fc52a0fed1df3c84048ffc
{
"window.zoomLevel": 2,
"editor.formatOnSave": true,
"editor.defaultFormatter": "JakeBecker.elixir-ls",
"terminal.integrated.shell.osx": "/bin/bash",
// path at top of editor is very noisy
"breadcrumbs.enabled": false,
@unnamedd
unnamedd / MacEditorTextView.swift
Last active October 10, 2025 02:42
[SwiftUI] MacEditorTextView - A simple and small NSTextView wrapped by SwiftUI.
/**
* MacEditorTextView
* Copyright (c) Thiago Holanda 2020-2021
* https://bsky.app/profile/tholanda.com
*
* (the twitter account is now deleted, please, do not try to reach me there)
* https://twitter.com/tholanda
*
* MIT license
*/
@kainjow
kainjow / libproc_example.swift
Created November 24, 2018 20:09
Swift example of C libproc API
import Darwin
// Call proc_listallpids once with nil/0 args to get the current number of pids
let initialNumPids = proc_listallpids(nil, 0)
// Allocate a buffer of these number of pids.
// Make sure to deallocate it as this class does not manage memory for us.
let buffer = UnsafeMutablePointer<pid_t>.allocate(capacity: Int(initialNumPids))
defer {
buffer.deallocate()
@fnky
fnky / ANSI.md
Last active October 13, 2025 13:04
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@PLG
PLG / Keylogger-main.m
Last active February 8, 2022 20:56
Skrew Everything Keylogger using HID in Objective-C
//
// main.m
// UniversalStatusBarClient
//
#import <Cocoa/Cocoa.h>
#import <IOKit/hid/IOHIDLib.h>
NSArray* keyMap[256];
void fill_keyMap(NSArray * __strong map[]);