Skip to content

Instantly share code, notes, and snippets.

@darconeous
darconeous / os-x-syslog-server.md
Last active April 14, 2025 15:28
Using OS X as a Syslog Server

Using OS X as a Syslog Server

This document describes how to set up an OS X to be a syslog server that logs messages from the local network. It was largely meant for my own purposes so that I don't forget what I did, but feel free to use it for your own purposes.

A problem with just "turning this on" is that you will not see the correct hostname in the syslog entries. What we will do is use

@Kronopath
Kronopath / converter.py
Last active January 30, 2025 14:05
WeChat audio converter script. See http://kronopath.net/blog/extracting-audio-messages-from-wechat/ for more details.
# WeChat aud file converter to wav files
# Dependencies:
# SILK audio codec decoder (available at https://github.com/gaozehua/SILKCodec)
# ffmpeg
#
# By Gabriel B. Nunes ([email protected])
# Adapted from another script by Nicodemo Gawronski ([email protected])
#
import os, argparse, subprocess
@jason5ng32
jason5ng32 / surge.conf
Last active November 6, 2024 06:39
Surge Configs ( for 2.x )
[General]
loglevel = notify
skip-proxy = 127.0.0.1, 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12, 100.64.0.0/10, localhost, *.local, ::ffff:0:0:0:0/1, ::ffff:128:0:0:0/1
bypass-tun = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12
# dns-server = 119.29.29.29,223.5.5.5,114.114.115.115
# external-controller-access = [email protected]:6155
# ipv6 = true
// REMEMBER TO CHANGE THE external-controller-access' PASSWORD
@jcayzac
jcayzac / gist.m
Created July 9, 2015 00:18
Fun with embedded.mobileprovision
NSData *provisioningProfile = nil;
NSData *raw = [NSData dataWithContentsOfURL:[NSBundle.mainBundle URLForResource:@"embedded" withExtension:@"mobileprovision"]];
char *start = memmem(raw.bytes,
raw.length,
"<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0",
47);
if (start) {
char *end = memmem(start,
(uintptr_t)start - raw.length,
"</plist>",
@miguelcma
miguelcma / DeviceUID.m
Created May 25, 2015 15:09
iOS Unique Device ID that persists between app reinstalls
/* DeviceUID.h
#import <Foundation/Foundation.h>
@interface DeviceUID : NSObject
+ (NSString *)uid;
@end
*/
// Device.m
@kristopherjohnson
kristopherjohnson / SystemLog.swift
Last active November 6, 2020 05:59
Demo of using the Apple System Log (ASL) API from Swift
// Note: This must be used in an Xcode project that contains a bridging header
// that includes <asl.h>
import Foundation
/// Provides high-level methods to access the raw data in
/// an ASL message.
struct SystemLogEntry {
/// Key-value pairs read from ASL message
let data: [String : String]
@rweichler
rweichler / Makefile
Last active March 29, 2023 10:46
HOOK C++ FUNCTION
SDK=/var/root/code/iPhoneOS7.1.sdk
CCPP=clang++ -isysroot $(SDK)
CC=clang -isysroot $(SDK)
all: cat cat.dylib
clean:
rm -f cat cat.dylib
@syshen
syshen / gist:c24d127e1adc2783e0e7
Last active March 3, 2025 15:02
Universal framework
######################
# Options
######################
REVEAL_ARCHIVE_IN_FINDER=false
FRAMEWORK_NAME="${PROJECT_NAME}"
SIMULATOR_LIBRARY_PATH="${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/${FRAMEWORK_NAME}.framework"
@BennettSmith
BennettSmith / .gitignore
Last active March 14, 2025 12:16
Google Protobuf v2.6.0 Build Script for iOS
protobuf
protobuf-2.6.0
protobuf-2.6.1
protobuf-master
@bomberstudios
bomberstudios / Change Font.sketchplugin
Last active May 20, 2024 03:42
Change font family for all text layers in Sketch
// Change font (ctrl a)
var doc = context.document,
selection = context.selection,
font_name = [doc askForUserInput:"Font name:" initialValue:"Arial"];
function check_layer(layer){
log(layer)
var className = layer.className()
log("Checking layer " + layer + " of klass: " + className)
if (className == "MSTextLayer") {