This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*--- waitForKeyElements(): A utility function, for Greasemonkey scripts, | |
that detects and handles AJAXed content. | |
Usage example: | |
waitForKeyElements ( | |
"div.comments" | |
, commentCallbackFunction | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def isFailed = false | |
def errMsg = "" | |
node { | |
stage('git checkout') { | |
checkout scm | |
} | |
stage('run test') { | |
dir(pwd()) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# iptables config script | |
# | |
# Flush all current rules from iptables | |
# | |
iptables -F | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
email: | |
action_mailer: 1 | |
default_from_address: CHANGE_ME | |
default_bcc_address: CHANGE_ME | |
default_from_address: CHANGE_ME |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
NewerOlder