Skip to content

Instantly share code, notes, and snippets.

#!/bin/zsh
# WARNING! The script is meant to show how and what can be disabled. Don’t use it as it is, adapt it to your needs.
# Credit: Original idea and script disable.sh by pwnsdx https://gist.github.com/pwnsdx/d87b034c4c0210b988040ad2f85a68d3
# Disabling unwanted services on macOS Big Sur (11), macOS Monterey (12), macOS Ventura (13) and macOS Sonoma (14)
# Disabling SIP is required ("csrutil disable" from Terminal in Recovery)
# Modifications are written in /private/var/db/com.apple.xpc.launchd/ disabled.plist, disabled.501.plist
# To revert, delete /private/var/db/com.apple.xpc.launchd/ disabled.plist and disabled.501.plist and reboot; sudo rm -r /private/var/db/com.apple.xpc.launchd/*
# user
@b0gdanw
b0gdanw / disable.sh
Last active July 11, 2024 18:14
Disable bunch of #$!@ in Catalina
# Credit: pwnsdx https://gist.github.com/pwnsdx/1217727ca57de2dd2a372afdd7a0fc21; nebular https://gist.github.com/pwnsdx/d87b034c4c0210b988040ad2f85a68d3#gistcomment-3019082
# IMPORTANT: Don't forget to logout from your Apple ID in the settings before running it!
# IMPORTANT: You will need to disable SIP: Reboot to Recovery, in Terminal csrutil disable
# WARNING: It might disable things that you may not like. Please double check the services in the TODISABLE vars.
# Get active services: launchctl list | grep -v "\-\t0"
# Find a service: grep -lR [service] /System/Library/Launch* /Library/Launch* ~/Library/LaunchAgents
# List disabled services: launchctl print-disabled user/501 |grep true & launchctl print-disabled system |grep true
@aberezin
aberezin / iterm
Created June 22, 2018 22:53 — forked from vyder/iterm
iterm.bash - Launch iTerm from command line
#!/usr/bin/env bash
#
# Open new iTerm window from the command line using v3 syntax for applescript as needed in iTerm2 Version 3+
# This script blocks until the cmd is executed in the new iTerm2 window. It then leaves the window open.
# TODO Add option to close iTerm2 after cmd execs
# See also https://www.iterm2.com/documentation-scripting.html
#
# Usage:
@barrosfelipe
barrosfelipe / insert-url.el
Created July 20, 2017 19:27
Inserts the content of an URL into the Emacs buffer, like VIm's :r <url>
(defun insert-url-1 (url insert-func)
(let* ((tem (funcall insert-func url)))
(push-mark (+ (point) (car (cdr tem))))))
(defun insert-url (url)
"Insert contents of URL into buffer after point.
Set mark after the inserted text.
This function is meant for the user to run interactively.
Don't call it from programs!
@JoachimL
JoachimL / barcodereader.py
Last active November 8, 2022 07:33
Python USB barcode reader
import evdev
from evdev import *
from azure.storage.queue import QueueService, QueueMessageFormat
import threading
import time
from queue import *
import datetime
# responsible for uploading the barcodes to the azure storage queue.
class BarcodeUploader:
@cfriedline
cfriedline / gist:0b2f5ab92aec3f5bf0dc
Last active August 30, 2020 01:54
WIP: Migrating from Sente 6 to Papers 3 via Endnote XML export

#This is a work in progress: YMMV (I'm working on an AppleScript supplement, so stay tuned...)

Migrating from Sente 6 to Papers3 via Endnote XML export

This process will export all of the references from Sente to an EndNote XML library suitable for import into Papers3. With a little shell magic, it will also set up the PDFs

Export