Skip to content

Instantly share code, notes, and snippets.

<?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>PayloadContent</key>
<array>
<dict>
<key>PayloadCertificateFileName</key>
<string>my.org.cer</string>
<key>PayloadContent</key>
#include <CoreFoundation/CoreFoundation.h>
CFPropertyListRef _CFPreferencesCopyApplicationMap(CFStringRef userName, CFStringRef hostName);
int main()
{
CFPropertyListRef app_map;
app_map = _CFPreferencesCopyApplicationMap(kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
#!/usr/bin/env python
# To look at: https://github.com/kcrawford/mac-network/blob/master/lib/mac-network/wifi.rb
# To look at: https://stackoverflow.com/questions/28096630/mac-os-x-10-10-reorder-preferred-networks
'''
Playing around with CoreWLAN to return information about the wi-fi connection
Documentation:
https://developer.apple.com/library/mac/documentation/CoreWLAN/Reference/CWInterface_reference/translated_content/CWInterface.html

Intercepts HTTPs Traffic with Python & mitmproxy

Introduction

Modern applications usually make use of back-end API servers to provide their services. With a non-transparent HTTPs proxy, which intercepts the communication between clients and servers (aka the man-in-the-middle scheme), you can easily manipulate both API requests and responses.

This manual helps you create your own proxy with Python and mitmproxy/libmproxy. Mitmproxy ships with both a standalone command-line tool (mitmproxy) and a Python library (libmproxy).

#!/bin/sh
# Copyright 2000-2011, Apple Inc.
#
# Disable prebinding-on-the-fly while we're read-only boted
#
export DYLD_NO_FIX_PREBINDING=1
#
# Set autopower on after power failure
@pudquick
pudquick / FileBrowser.py
Created January 15, 2016 06:43 — forked from steventroughtonsmith/FileBrowser.py
File Browser for Pythonista
# coding: utf-8
from UIKit import *
from Foundation import *
from ctypes import *
libobjc = CDLL('/usr/lib/libobjc.dylib')
QLPreviewController = ObjCClass('QLPreviewController')
Quick Instructions for Compiling under OS X
1. Install gcc from Homebrew and set the env variables + aliases:
export CC=/usr/local/bin/gcc-5
export CXX=/usr/local/bin/g++-5
export CPP=/usr/local/bin/cpp-5
export LD=/usr/local/bin/gcc-5
alias c++=/usr/local/bin/c++-5
alias g++=/usr/local/bin/g++-5
@pudquick
pudquick / Get-SSLThumbprint.ps1
Created May 22, 2016 15:07 — forked from lamw/Get-SSLThumbprint.ps1
Powershell snippet to help extract the SSL Thumbprint (SHA1) of a remote system
Function Get-SSLThumbprint {
param(
[Parameter(
Position=0,
Mandatory=$true,
ValueFromPipeline=$true,
ValueFromPipelineByPropertyName=$true)
]
[Alias('FullName')]
[String]$URL
@pudquick
pudquick / flag_to_string.rb
Created September 5, 2016 18:23 — forked from djberg96/flag_to_string.rb
Trying to stringify filesystem flags
require 'ffi'
class Filesystem
extend FFI::Library
ffi_lib FFI::Library::LIBC
attach_function(:strerror, [:int], :string)
attach_function(:getmntinfo64, [:pointer, :int], :int)
class Statfs < FFI::Struct