Skip to content

Instantly share code, notes, and snippets.

@scriptingosx
scriptingosx / ActiveDirectory_Generic.mobileconfig
Created January 28, 2015 17:33
Active Directory Configuration Profile
<?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>ADAllowMultiDomainAuth</key>
<true/>
<key>ADAllowMultiDomainAuthFlag</key>
@scriptingosx
scriptingosx / firefox.cfg
Last active August 29, 2015 14:14
Firefox Configuration File for USC Labs
// This file sets some default prefs for use at USC Labs
// and locks down some other prefs.
//
// Safari Migration
lockPref("browser.migration.version", 1);
lockPref("browser.places.importBookmarksHTML", false);
lockPref("network.cookie.prefsMigrated", true);
// application updates
lockPref("app.update.enabled", false);
@scriptingosx
scriptingosx / Lock Mac.scpt
Created February 3, 2015 19:40
Use these scripts to lock and unlock your Mac with GeoHopper.
on processIsRunning(appName)
tell application "System Events"
return process appName exists
end tell
end processIsRunning
on GoGoGeohop(email, subject)
-- pause iTunes
if processIsRunning("iTunes") then
tell application "iTunes"
@scriptingosx
scriptingosx / create_netloc.py
Last active March 5, 2023 03:09
Create OS X inetloc files
#!/usr/bin/python
import sys
import argparse
import urlparse
import urllib
import plistlib
import os.path
import subprocess
<?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>PayloadContent</key>
<dict>
<key>com.apple.driver.AppleHIDMouse</key>
@scriptingosx
scriptingosx / Check with flake8.applescript
Last active August 29, 2015 14:19
BBEdit: Check Python with flake 8
(*
run flake8 against the frontmost BBEdit document
You need to install flake8 with
sudo easy_install flake8
more info here http://flake8.readthedocs.org/en/latest/
*)
@scriptingosx
scriptingosx / shellcheck
Last active January 13, 2017 19:24
check frontmost BBEdit window with spellcheck http://shellcheck.net
tell application "BBEdit"
if not (exists text document 1) then
return
end if
if source language of text document 1 is not "UNIX Shell Script" then
set thename to name of text document 1
display dialog "Document '" & thename & "' does not seem to be a shell script!"
return
end if
@scriptingosx
scriptingosx / Build text link list from Tabs.applescript
Created January 5, 2016 09:10
Safari - Build Text Link List from Tabs
@scriptingosx
scriptingosx / Save Tabs to Notes.applescript
Created January 5, 2016 09:11
Save Safari Tabs to Notes
property defaultAccountName : "iCloud"
property defaultFolderName : "Saved Safari Windows"
global html
global processedURLs
on appendLineWithDoc(theDoc)
tell application "Safari"
tell theDoc
try
property defaultAccountName : "iCloud"
property defaultFolderName : "Saved iCloud Tabs"
global html
global processedURLs
on appendLineWithURLItem(urlItem)
my appendHTML(" <li>")
my appendHTML("<a href=\"" & |url| of urlItem & "\">")
my appendHTML(|Title| of urlItem)