Enter this in the search box along with your search terms:
Get all gists from the user santisbon.
user:santisbon
Find all gists with a .yml extension.
extension:yml
Find all gists with HTML files.
language:html
// This playground shows you a few different ways to get device info via IOKit. | |
// If you want to explore IOKit and look for interesting data I would download | |
// the Additional Developer Tools from Apple and use the IORegistryExplorer app. | |
// It makes it super easy to poke around in the IOKit planes. | |
import IOKit | |
import Foundation | |
// For convient access we can make a computed getter for the PlatformExpert. | |
// Traditionally this has been where you go to find all sorts of data about the |
Enter this in the search box along with your search terms:
Get all gists from the user santisbon.
user:santisbon
Find all gists with a .yml extension.
extension:yml
Find all gists with HTML files.
language:html
// | |
// MIT License | |
// | |
// Copyright (c) 2024 Derek Selander | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is |
#/usr/bin/env python | |
from LaunchServices import LSSetDefaultHandlerForURLScheme | |
from LaunchServices import LSSetDefaultRoleHandlerForContentType | |
# 0x00000002 = kLSRolesViewer | |
# see https://developer.apple.com/library/mac/#documentation/Carbon/Reference/LaunchServicesReference/Reference/reference.html#//apple_ref/c/tdef/LSRolesMask | |
LSSetDefaultRoleHandlerForContentType("public.html", 0x00000002, "com.operasoftware.operanext") | |
LSSetDefaultRoleHandlerForContentType("public.xhtml", 0x00000002, "com.operasoftware.operanext") | |
LSSetDefaultHandlerForURLScheme("http", "com.operasoftware.operanext") | |
LSSetDefaultHandlerForURLScheme("https", "com.operasoftware.operanext") |
# Make a self-signed private/public keypair usable for HTTPS, including SAN / Subject Alternative Name and CN / Common Name, non-interactively and without additional files | |
# Parentheses around the command spin it up in a subshell so that the FQDOMAIN variable is local to execution and doesn't persist after it's created | |
(FQDOMAIN="example.local" && openssl req -x509 -nodes -newkey rsa:4096 -keyout server_key.pem -keyform PEM -days 365 -subj "/CN=${FQDOMAIN}" -addext 'basicConstraints=CA:FALSE' -addext "subjectAltName=DNS:${FQDOMAIN}" -addext 'keyUsage=digitalSignature' -addext 'extendedKeyUsage=serverAuth' -out server_cert.pem -outform PEM 2>/dev/null) | |
# Alternatively, if you're setting FQDOMAIN somewhere else, you can just run directly: | |
openssl req -x509 -nodes -newkey rsa:4096 -keyout server_key.pem -keyform PEM -days 365 -subj "/CN=${FQDOMAIN}" -addext 'basicConstraints=CA:FALSE' -addext "subjectAltName=DNS:${FQDOMAIN}" -addext 'keyUsage=digitalSignature' -addext 'extendedKeyUsage=serverAuth' -out server_ |
#!/bin/bash | |
# change the values below to match your system. | |
# target the BUILD_DIR to output from an nw.io build process. nwjs-shell-builder recommended! | |
# https://github.com/Gisto/nwjs-shell-builder | |
# BASE_DIR is the target directory for this script, where files will be gathered and packaged to | |
BUILD_DIR=”/var/www/deploy/TMP/osx-ia32/latest-git” | |
BASE_DIR=”/var/www/deploy/osx” |
#!/usr/bin/python | |
import os | |
import sys | |
from CoreFoundation import (CFPreferencesAppValueIsForced, | |
CFPreferencesCopyAppValue, | |
CFPreferencesCopyValue, | |
kCFPreferencesAnyUser, | |
kCFPreferencesAnyHost, |
# https://developer.apple.com/documentation/corefoundation/3684868-cfbundleisarchitectureloadable?language=objc | |
# https://developer.apple.com/documentation/foundation/1495005-mach-o_architecture?language=occ | |
# https://developer.apple.com/documentation/foundation/1495005-mach-o_architecture/nsbundleexecutablearchitecturearm64?language=occ | |
from Foundation import NSBundle | |
import objc | |
CF = NSBundle.bundleWithPath_('/System/Library/Frameworks/CoreFoundation.framework') | |
f = [('CFBundleIsArchitectureLoadable', 'BQ')] | |
objc.loadBundleFunctions(CF, globals(), f) | |
NSBundleExecutableArchitectureARM64 = 0x0100000c |
# OFFICIAL REPO: https://github.com/pudquick/nibbler | |
# (this gist will be preserved for historical purposes) | |
# demo video here: | |
# https://www.dropbox.com/s/k0bpekd13muknmz/nibbler%20-%20by%20frogor.mp4?dl=0 | |
# Example script using nibbler: | |
# from nibbler import * | |
# |