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/python3 | |
import os | |
# pip3 install openpyxl pandas to be able to read Excel contents | |
import pandas | |
import sys | |
# Sub in your actual excel file for NAMEOFEXCELFILE.xlsx | |
excel_file = os.path.expanduser('~/Downloads/NAMEOFEXCELFILE.xlsx') |
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/local/munki/munki-python | |
import random | |
import sys | |
## Specify the total number of winners | |
total_winners = 3 | |
## Specify the potential contestants | |
raffle_contestants = ['contestant 1', 'contestant 2', 'contestant 3', 'contestant 4', 'contestant 5'] |
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
<?php | |
/* Notes: | |
This is a simple page that allows users to change their own passwords in Active Directory via LDAP. | |
Believe it or not, this kind of password-change PHP page is not easy to find, at least as of summer 2018. | |
Some easy-to-find resources on this are outdated and don't work. | |
Many involve the need for an admin password in order to change the user's password, which is fine, but I really wanted to have something that didn't require a separate admin account. This may still require an account of some kind (not necessarily admin) that can just search for a distinguished name, since some instances of AD don't allow for anonymous LDAP binding. | |
Even though Active Directory uses LDAP, there are also some specific quirks to password changes on AD, as opposed to general LDAP password changes. |
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
<?php | |
// A bit messy... would be easier using CFPropertyList | |
// Put in the relative path to your optional installs manifest, assuming you have only one, in this situation | |
$optionals_manifest='RELATIVE/PATH/TO/manifests/OPTIONALINSTALLSMANIFEST'; | |
// Get the contents of the manifest | |
$xml=simplexml_load_file($optionals_manifest); |
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/python | |
import os | |
import plistlib | |
# Modify to be the pkgsinfo path for your Munki repo | |
pkgsinfo_path='/PATH/TO/YOUR/MUNKI/REPO/pkgsinfo' | |
# Create a list to hold all unattended installs items | |
unattended_installs=[] |
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
function SourceDestinationMove() { | |
// The folder IDs are the tailend of the URL for the folder in Google Drive | |
// The source folder where you want things moved out of. | |
var source_folder = DriveApp.getFolderById('INSERTSOURCEFOLDERIDHERE'); | |
// The destination folder where you want things moved to. | |
var destination_folder = DriveApp.getFolderById('INSERTDESTINATIONFOLDERIDHERE'); |
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
<script> | |
// Put this at the top of the footer_template.html | |
// Get the page name | |
var current_page=document.getElementsByClassName('title')[0].getElementsByTagName('H2')[0].innerHTML; | |
// If the page name is All items or Featured items | |
if ( current_page == "All items" || current_page == "Featured items"){ | |
// Create an array of optional items to hide |
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 | |
# Loop through everything that has a Printer as the first part of the name and 1.0 as the last part | |
for pkginfo in /PATH/TO/pkgsinfo/Printer*1.0*; do | |
echo "$pkginfo" | |
# See if a 1.1 version already exists | |
newer=$(echo "$pkginfo" | sed -e "s/1\.0/1\.1/g") | |
if [ ! -f "$newer" ]; then | |
# If it doesn't exist, let's create it | |
cp "$pkginfo" "$newer" |
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/python | |
# Some notes about using this script: | |
# - Configure the application path and bundle id below | |
# - This script needs to be run as the user you need to set the checkmark for | |
# - The setting will not take effect until they log out and log back in at least once | |
import os.path | |
from Foundation import NSHomeDirectory, CFPreferencesCopyMultiple, CFPreferencesSetMultiple, kCFPreferencesAnyUser, kCFPreferencesCurrentHost, NSMutableDictionary, NSURL, NSURLBookmarkCreationMinimalBookmark, NSMutableArray |