Skip to content

Instantly share code, notes, and snippets.

@calum-github
calum-github / app_store_configuration.mobileconfig
Created July 30, 2015 03:21
Profile to prevent app adoption notification in AppStore
<?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>PayloadContent</key>
<array>
<dict>
<key>PayloadType</key>
<string>com.apple.appstore</string>
<key>PayloadVersion</key>
@calum-github
calum-github / site_info.sh
Created June 22, 2015 02:00
Site Info script
#!/bin/bash
#####################################################################
# #
# Author: Calum Hunter #
# Date: 17-10-2014 #
# Version 0.1 #
# Purpose: Script to capture the site #
# and send this to our Munki Report server #
# #
May 15 11:21:45 c8e0eb2f5cfdM LoginScriptPlugin[656]: / is group writable
May 15 11:21:45 c8e0eb2f5cfdM LoginScriptPlugin[656]: Not executing /Library/Application Support/LoginScriptPlugin/postmount-user-lpadmin_check.s
[root@munki nbi]# docker logs -f bsdpy
+ tail -f /var/log/bsdpserver.log
+ /usr/bin/env python /bsdpy/bsdpserver.py
File "/bsdpy/bsdpserver.py", line 1077
logging.debug'\n-=============================[-> BSDP SELECT <-]=======================================-')
^
SyntaxError: invalid syntax
+ tail -f /var/log/bsdpserver.log
+ /usr/bin/env python /bsdpy/bsdpserver.py
File "/bsdpy/bsdpserver.py", line 1077
-=- Starting new BSDP server session -=-
05/04/2015 12:48:06 AM - DEBUG: Considering NBI source at /nbi/DEC_NetBoot_14C109_v2.nbi
05/04/2015 12:48:06 AM - DEBUG: [========= Using the following boot images =========]
05/04/2015 12:48:06 AM - DEBUG: /nbi/DEC_NetBoot_14C109_v2.nbi
05/04/2015 12:48:06 AM - DEBUG: [========= End boot image listing =========]
05/04/2015 01:00:00 AM - DEBUG: -=========================================-
05/04/2015 01:00:00 AM - DEBUG: Got BSDP INFORM[LIST] packet:
05/04/2015 01:00:00 AM - DEBUG: Determining image list for system ID Macmini6,2
05/04/2015 01:00:00 AM - DEBUG: Found enabled system ID Macmini6,2 - adding "Mac OS 10.10.2 (14C109) Created by, Calum Hunter on: Wednesday, 25 February 2015." to list
@calum-github
calum-github / gist:15b4739c85ccf7813d82
Last active August 29, 2015 14:19
This script sets up a centos7 server as a linux netboot server
#!/bin/bash
# Set some variables
samba_user_name="smbuser"
samba_user_password="password"
# This will attempt to get the IP address for the server. YMMV with this, if in doubt, hardcode the IP address of your server here.
my_ip_address=`ip addr | grep "en" | awk '/inet/ {print $2}' | cut -d "/" -f1`
# Install some packages
echo "Installing Packages"
@calum-github
calum-github / gist:9152985ab2b4dce96f7a
Created April 24, 2015 05:52
This script disables the firewall and SELinux
#!/bin/bash
echo "*** Stopping and disabling Firewalld ***"
systemctl stop firewalld && systemctl disable firewalld
echo "*** Firewalld: Disabled ***"
echo "*** Disabling SELinux ***"
sed -i -e 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
echo "*** SELinux: Disabled ***"
echo ""
echo "Ready to reboot? (y/n)"
#!/bin/sh
# Copyright 2000-2011, Apple Inc.
#
# Disable prebinding-on-the-fly while we're read-only boted
#
export DYLD_NO_FIX_PREBINDING=1
#
# Set autopower on after power failure
@calum-github
calum-github / change_desktop.py
Created February 26, 2015 01:57
change desktop 10.9+
#!/usr/bin/python
'''Uses Cocoa classes via PyObjC to set a desktop picture on all screens.
Tested on Mountain Lion and Mavericks. Inspired by Greg Neagle's work: https://gist.github.com/gregneagle/6957826
See:
https://developer.apple.com/library/mac/documentation/cocoa/reference/applicationkit/classes/NSWorkspace_Class/Reference/Reference.html
https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSURL_Class/Reference/Reference.html
@calum-github
calum-github / gist:b74d65efa75702f1fca0
Created February 11, 2015 23:08
Office 2011 updates
#!/bin/bash
###################################################################################
# #
# Author: Calum Hunter #
# Date: 21-10-2014 #
# Vesion: 0.1 #
# Purpose: This script removes the all quit apps pre-install script #
# From the Office 2011 Updates as this normally causes a hang #
# when deployed as unattended install in some management tools. #