Skip to content

Instantly share code, notes, and snippets.

View n8felton's full-sized avatar
🍎

Nate Felton n8felton

🍎
View GitHub Profile
@joshua-d-miller
joshua-d-miller / 802.1x Fix.py
Last active January 18, 2019 12:46
When deploying an EAP-TLS profile for 802.1x Ethernet, this script will create a User Identity preference which will allow a logged in user to use any Ethernet interface that is connected to their machine.
#!/usr/bin/python
# pylint: disable=C0103, W0612, E1101, E0602, E0611
# pylint: disable=W0101, W0110, W0141
''''Fix 802.1x When Using Config Profiles and EAP-TLS'''
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# This script will determine the profile ID that was used when
# installing the 802.1x Ethernet Identity preference and make
# a copy of the keychain entry to be used as a user identity preference
# so that any Ethernet can be used when a user is logged in. As of 10.12.3
@166MMX
166MMX / cmd.origin.sh
Last active May 8, 2025 15:08
macOS Sierra /usr/bin/ Origin
#!/usr/bin/env bash
main() {
header
find "$1" \( -type f -o -type l \) -print0 | while IFS= read -r -d ''; do
second "$REPLY"
done
}
second() {
@corbanb
corbanb / pre-request-jwt.js
Last active July 22, 2024 13:12
JWT tokenize - Postman Pre-Request Script
function base64url(source) {
// Encode in classical base64
encodedSource = CryptoJS.enc.Base64.stringify(source);
// Remove padding equal characters
encodedSource = encodedSource.replace(/=+$/, '');
// Replace characters according to base64url specifications
encodedSource = encodedSource.replace(/\+/g, '-');
encodedSource = encodedSource.replace(/\//g, '_');
@ravibhure
ravibhure / git_rebase.md
Last active October 21, 2025 14:16
Git rebase from remote fork repo

In your local clone of your forked repository, you can add the original GitHub repository as a "remote". ("Remotes" are like nicknames for the URLs of repositories - origin is one, for example.) Then you can fetch all the branches from that upstream repository, and rebase your work to continue working on the upstream version. In terms of commands that might look like:

Add the remote, call it "upstream":

git remote add upstream https://github.com/whoever/whatever.git

Fetch all the branches of that remote into remote-tracking branches, such as upstream/master:

git fetch upstream

@homebysix
homebysix / https_spotter.py
Last active September 6, 2025 20:32
HTTPS Spotter
#!/usr/local/autopkg/python
# HTTPS Spotter
# Copyright 2016-2025 Elliot Jordan
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
@vmiller
vmiller / SPSS.make
Created October 6, 2016 18:09
Luggage Makefile to repackage SPSS
include /usr/local/share/luggage/luggage.make
TITLE=SPSS
PACKAGE_VERSION=24
REVERSE_DOMAIN=org.domain
PAYLOAD=pack-from-applications-IBM \
pack-Library-Application-Support-IBM \
pack-script-pb-postinstall
pack-Library-Application-Support-IBM: l_Library_Application_Support
@sudo ${CP} -R /Library/Application\ Support/IBM ${WORK_D}/Library/Application\ Support/
@pudquick
pudquick / autotimezone.py
Last active February 11, 2020 15:55
Forcing automatic timezone discovery with pyobjc on OS X
# Tested on 10.11
# Assumes your network is in a state to actually do the discovery and that you have
# automatic timezone discovery enabled in Date & Time and Location services enabled
# (Generally this means wifi enabled on your device and network stack is up)
# For enabling location services and auto, check Allister's work here:
# https://gist.github.com/arubdesu/b72585771a9f606ad800
from Foundation import NSBundle
TZPP = NSBundle.bundleWithPath_("/System/Library/PreferencePanes/DateAndTime.prefPane/Contents/Resources/TimeZone.prefPane")
@gboddin
gboddin / build-httpd-2.4-el6.sh
Last active July 3, 2018 20:32
centos-httpd-2.4.x RPM gen
#!/bin/bash
APACHE_VERSION=2.4.23
DISTCACHE_VERSION=1.4.5-23
APR_VERSION=1.5.2
APR_UTIL_VERSION=1.5.4
echo Downloading deps :
rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
yum install tar expat-devel freetds-devel db4-devel rpm-build postgresql-devel mysql-devel sqlite-devel wget unixODBC-devel nss-devel doxygen automake libtool autoconf zlib-devel libselinux-devel libuuid-devel pcre-devel openldap-devel lua-devel libxml2-devel openssl-devel -y
wget -c https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/18/Fedora/source/SRPMS/d/distcache-${DISTCACHE_VERSION}.src.rpm
#!/bin/bash -x
VERSION=24
AUTHCODE=<redacted>
APPPATH="/Applications/IBM/SPSS/Statistics/$VERSION/SPSSStatistics.app/"
cd "$APPPATH/Contents/bin"
"$APPPATH/Contents/PlugIns/jre1.8.0_71.jre/Contents/Home/bin/java" -jar "$APPPATH/Contents/bin/licenseactivator.jar" SILENTMODE CODES=$AUTHCODE
@pudquick
pudquick / ctypes_printers.py
Created July 7, 2016 00:30
Various PrintCore functions via ctypes on OS X
from ctypes import CDLL, Structure, POINTER, c_void_p, byref
from ctypes.util import find_library
import objc
PrintCore = CDLL('/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/PrintCore')
CFoundation = CDLL(find_library('CoreFoundation'))
class OpaqueType(Structure):
pass