Skip to content

Instantly share code, notes, and snippets.

View natewalck's full-sized avatar

Nate Walck natewalck

View GitHub Profile
@gregneagle
gregneagle / quarantine_demo.py
Created February 23, 2023 23:13
Using Apple's quarantine API from PyObjC
#!/usr/local/munki/munki-python
'''Demo only. Needs more robust error checking and handling'''
import os
from Foundation import NSURL, NSURLQuarantinePropertiesKey
def getQuarantineAttribute(pathname):
'''Returns a dict contaning quarantine info for pathname or None'''
@clee
clee / voron_sensorless.md
Last active April 24, 2024 19:25
how to sensorless XY on Vorons

Setting Up and Calibrating Sensorless XY Homing

When using the TMC2130 / TMC2209 / TMC2660 / TMC5160 drivers, the StallGuard feature makes it possible to set up sensorless homing on the X and Y axes for CoreXY machines. The Klipper project has a page with documentation and recommendations on getting it working.

Following are some more detailed instructions and suggestions to supplement the Klipper documentation specifically for Vorons.

Hardware Setup

@Jip-Hop
Jip-Hop / boot.sh
Last active June 21, 2023 17:38
Using Docker on TrueNAS SCALE (no Kubernetes)
#!/usr/bin/env bash
#
# Enable docker and docker-compose on TrueNAS SCALE (no Kubernetes)
#
# This script is a hack! Use it at your own risk!!
# Using this script to enable Docker is NOT SUPPORTED by ix-systems!
# You CANNOT use SCALE Apps while using this script!
#
# 1 Create a dedicated Docker zvol on one of your zpools: zfs create -V 100G data/_docker
@MScottBlake
MScottBlake / 1-Reboot to Recovery.command
Last active October 26, 2023 15:20
Removing a Non-Removable MDM Profile
#!/bin/zsh
# Elevate permissions, if needed
if [ $USER != 'root' ]; then
sudo $0
exit 0
fi
# Reboot to Recovery
/usr/sbin/nvram "recovery-boot-mode=unused"
@ahmetb
ahmetb / gcpauth.go
Created May 22, 2018 17:21
Authenticating to GKE cluster with client-go, IAM service account and a Google auth plugin written from scratch
package main
import (
"context"
"fmt"
"log"
"net/http"
"golang.org/x/oauth2"
"golang.org/x/oauth2/google"
@schmich
schmich / ducky.md
Last active April 5, 2024 14:20
Programming media keys on the Ducky One 2 Skyline

Programming Media Keys on the Ducky One 2 Skyline

To use media keys on the Ducky One 2 Skyline, you must record a macro to bind the media function to a hotkey combination, i.e. Fn plus some key.

Example

Important: In the instructions below, "Press X+Y+Z" means press and hold key X, press and hold key Y, press and hold key Z in that order, and then release all three.

As an example, to bind Fn+PgUp to the play/pause media function:

@groob
groob / hi_frogor.go
Last active December 12, 2019 01:26 — forked from pudquick/hi_groob.py
Search my gists ;p
package main
import (
"flag"
"fmt"
"io"
"log"
"net/http"
"os"
)
@n-st
n-st / .bash_profile
Created May 29, 2016 12:04
Start zsh from bashrc. Useful when you can't use chsh or when the same LDAP account is used both on systems with zsh installed and ones without.
# .bash_profile is executed for login shells,
# .bashrc is executed for interactive non-login shells.
# We want the same behaviour for both, so we source .bashrc from .bash_profile.
# Also, when .bash_profile exists, bash ignores .profile, so we have to source
# it explicitly.
if [ -f "$HOME/.profile" ]; then
. "$HOME/.profile"
fi
@pudquick
pudquick / 8021x_inspect.py
Last active September 27, 2022 10:04
802.1x configuration / data collection on OS X using python and the PrivateFramework "EAP8021X.framework"
# This was all run from user space
# I haven't tested it with root
# ... but it didn't prompt for any permissions under userspace ^_^
# Tested on 10.11.5
import objc
from Foundation import NSBundle
EAP8021X_bundle = NSBundle.bundleWithPath_('/System/Library/PrivateFrameworks/EAP8021X.framework')
Security_bundle = NSBundle.bundleWithIdentifier_('com.apple.security')
@lalibi
lalibi / Set-WindowState.ps1
Last active August 26, 2023 04:25 — forked from Nora-Ballard/Set-WindowState.ps1
Hide, Show, Minimize, Maximize, etc window from Powershell.
function Set-WindowState {
<#
.LINK
https://gist.github.com/Nora-Ballard/11240204
#>
[CmdletBinding(DefaultParameterSetName = 'InputObject')]
param(
[Parameter(Position = 0, Mandatory = $true, ValueFromPipeline = $true)]
[Object[]] $InputObject,