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
'''Routines for manipulating the Dock''' | |
import os | |
import subprocess | |
from Foundation import NSURL | |
from Foundation import CFPreferencesAppSynchronize | |
from Foundation import CFPreferencesCopyAppValue | |
from Foundation import CFPreferencesSetAppValue |
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 | |
# encoding: utf-8 | |
# | |
# Copyright 2009-2016 Greg Neagle. | |
# | |
# Licensed under the Apache License, Version 2.0 (the 'License'); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 |
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
% curl -s http://www.getmacapps.com/raw/3 | |
#!/bin/bash | |
mkdir ~/getmacapps_temp | |
cd ~/getmacapps_temp | |
# Installing Chrome | |
curl -L -O "https://dl.google.com/chrome/mac/stable/GGRO/googlechrome.dmg" | |
hdiutil mount -nobrowse googlechrome.dmg | |
cp -R "/Volumes/Google Chrome/Google Chrome.app" /Applications |
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
See https://github.com/project-imas/mdm-server#setup for starting point. | |
Assuming you have virtualenv installed.... | |
bash-3.2$ virtualenv mdm-server-env | |
New python executable in mdm-server-env/bin/python | |
Installing setuptools, pip...cd mdone. | |
bash-3.2$ cd mdm-server-env/ | |
bash-3.2$ source bin/activate | |
(mdm-server-env)bash-3.2$ easy_install web.py |
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
% python | |
Python 2.7.6 (default, Sep 9 2014, 15:04:36) | |
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> os_vers_1 = "10.9.5" | |
>>> os_vers_2 = "10.10" | |
>>> os_vers_2 > os_vers_1 | |
False | |
>>> from distutils import version | |
>>> version.LooseVersion(os_vers_2) > version.LooseVersion(os_vers_1) |
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
from munkilib import gurl | |
def run_connection(options): | |
connection = gurl.Gurl.alloc().initWithOptions_(options) | |
percent_complete = -1 | |
bytes_received = 0 | |
connection.start() | |
try: | |
while not connection.isDone(): | |
if connection.destination_path: |
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
<?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>_metadata</key> | |
<dict> | |
<key>created_by</key> | |
<string>gneagle</string> | |
<key>creation_date</key> | |
<date>2015-04-08T22:51:57Z</date> |
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 | |
some_dir = "/Users/Shared/temp" | |
for filename in os.listdir(some_dir): | |
name, ext = os.path.splitext(filename) | |
new_name = name[0:29] + ext | |
os.rename(os.path.join(some_dir, filename), os.path.join(some_dir, new_name)) |
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 | |
'''Ensures urls are in the Oracle Java exception.sites list''' | |
# See https://derflounder.wordpress.com/2014/01/16/managing-oracles-java-exception-site-list/ | |
import os | |
import sys | |
urls = [ | |
'http://server1.some.com', | |
'http://server2.another.com', |
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
<?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"> | |
<array> | |
<dict> | |
<key>Application ID</key> | |
<string>UCCP14</string> | |
<key>Date</key> | |
<date>2014-10-29T07:00:00Z</date> | |
<key>Download Time</key> |