Skip to content

Instantly share code, notes, and snippets.

View stacybrock's full-sized avatar
🤖
making robots do my bidding

Stacy Brock stacybrock

🤖
making robots do my bidding
  • Oregon State University
  • Oregon
View GitHub Profile
@stacybrock
stacybrock / Disable-Sequoia-Bloatware.sh
Created February 24, 2025 10:09 — forked from b0gdanw/Disable-Sequoia-Bloatware.sh
Disable Sequoia Bloatware
#!/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), macOS Sonoma (14) and macOS Sequoia (15)
# 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
@stacybrock
stacybrock / waitForKeyElements.js
Created June 24, 2022 16:05 — forked from BrockA/waitForKeyElements.js
A utility function, for Greasemonkey scripts, that detects and handles AJAXed content.
/*--- waitForKeyElements(): A utility function, for Greasemonkey scripts,
that detects and handles AJAXed content.
Usage example:
waitForKeyElements (
"div.comments"
, commentCallbackFunction
);
@stacybrock
stacybrock / mergulator.py
Created March 14, 2021 02:34
merge VM inventory CSVs
import csv
import pprint
pp_ = pprint.PrettyPrinter(indent=2)
pp = pp_.pprint
ad_inv = {}
vm_inv = {}
with open('winventory_ad_side.csv') as ad_file:
@stacybrock
stacybrock / Jenkinsfile_timeout_example
Last active November 1, 2024 16:26
Example Jenkins scripted pipeline that handles script timeouts
def isFailed = false
def errMsg = ""
node {
stage('git checkout') {
checkout scm
}
stage('run test') {
dir(pwd()) {
@stacybrock
stacybrock / spacer.py
Created January 31, 2019 21:06
fun with full width unicode
#!/usr/bin/env python
import argparse
import sys
parser = argparse.ArgumentParser()
parser.add_argument('-w', '--width', type=int, help='stretch to width')
parser.add_argument('words', nargs='+', help='words to convert to fullwidth')
args = parser.parse_args()
@stacybrock
stacybrock / iptables.sh
Created August 14, 2015 22:02
sample iptables ruleset
#!/bin/bash
# iptables config script
#
# Flush all current rules from iptables
#
iptables -F
#
@stacybrock
stacybrock / secrets.yml
Created November 13, 2014 19:28
secrets.yml snip
email:
action_mailer: 1
default_from_address: CHANGE_ME
default_bcc_address: CHANGE_ME
default_from_address: CHANGE_ME
@stacybrock
stacybrock / blah.pp
Created August 26, 2014 18:48
puppet apache::vhost with custom configuration via concat::fragment
apache::vhost { $::fqdn:
port => '80',
docroot => '/opt/graphite/webapp',
wsgi_application_group => '%{GLOBAL}',
wsgi_daemon_process => 'graphite',
wsgi_daemon_process_options => {
processes => '5',
threads => '5',
display-name => '%{GROUP}',
inactivity-timeout => '120',
@stacybrock
stacybrock / rbvmomi_grep_example.rb
Created February 21, 2014 00:00
example of RbVmomi grep usage
# expects a datacenter.vmFolder
# warning, this code is slow as molasses!
def get_all_vms(folder)
vms = []
folder.childEntity.grep(RbVmomi::VIM::Folder).each do |subfolder|
vms << get_all_vms(subfolder)
end
folder.childEntity.grep(RbVmomi::VIM::VirtualMachine).each do |vm|
vms << { :name => vm.summary.config.name,
:mo_ref => vm.instance_variable_get(:@ref),
@stacybrock
stacybrock / ruby-prof_example.rb
Created February 20, 2014 23:42
simple ruby-prof usage example
require 'ruby-prof'
result = RubyProf.profile {
# code to profile goes here
}
open("outputfile.profile", "w") do |f|
RubyProf::CallTreePrinter.new(result).print(f, :min_percent => 1)
end