Skip to content

Instantly share code, notes, and snippets.

View macmule's full-sized avatar

macmule macmule

View GitHub Profile
#!/bin/bash
####################################################################################################
#
# License: https://macmule.com/license/
#
####################################################################################################
# Get the username of the currently logged in user
loggedInUser=$(/bin/ls -l /dev/console | /usr/bin/awk '{ print $3 }')
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PrimaryCatalog</key>
<string>http://swupdate.example.com/content/catalogs/index.sucatalog</string>
<key>CatalogsList</key>
<array>
<string>http://swupdate.example.com/content/catalogs/index.sucatalog</string>
<string>http://swupdate.example.com/content/catalogs/others/index-leopard.merged-1.sucatalog</string>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.launchdaemon.name</string>
<key>ProgramArguments</key>
<array>
<string>/path/to/rsync/script</string>
</array>
#!/bin/sh
####################################################################################################
#
# License: https://macmule.com/license/
#
####################################################################################################
# wait for network, method pinched from chilcote
. /etc/rc.common
CheckForNetwork
sh-3.2# ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/var/root/.ssh/id_rsa):
Created directory '/var/root/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /var/root/.ssh/id_rsa.
Your public key has been saved in /var/root/.ssh/id_rsa.pub.
The key fingerprint is:
73:77:c8:83:17:2c:9e:b1:6e:71:2d:bf:68:e7:8e:3b [email protected]
#!/usr/bin/python
"""
License: https://macmule.com/license/
"""
import logging
import os
import shutil
import signal
import subprocess
+-------------+-------------------------------+
| computer_id | default_distribution_point_id |
+-------------+-------------------------------+
| 200 | -1 |
| 3 | -1 |
| 7 | -1 |
| 8 | -1 |
| 9 | -1 |
| 10 | -1 |
| 292 | -1 |
+-------------+-------------------------------+
| computer_id | default_distribution_point_id |
+-------------+-------------------------------+
| 200 | 8 |
| 3 | 14 |
| 7 | 7 |
| 8 | 6 |
| 9 | 4 |
| 10 | 8 |
| 292 | 12 |
#!/bin/bash
####################################################################################################
#
# License: https://macmule.com/license/
#
####################################################################################################
catalogURL=$(defaults read /Library/Preferences/com.apple.SoftwareUpdate CatalogURL)
if [ -z $catalogURL ];
#!/bin/bash
####################################################################################################
#
# License: https://macmule.com/license/
#
####################################################################################################
updateServerFQDN="UPDATES.MYCOMPANY.COM"
sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate CatalogURL http://"$updateServerFQDN":/index.sucatalog