Skip to content

Instantly share code, notes, and snippets.

@chilcote
chilcote / gist:4abf81a0be65a675e7c2
Created July 9, 2015 15:34
osquery vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "osx104"
config.vm.synced_folder "./data", "/vagrant_data"
config.vm.provision "shell", inline: <<-SHELL
curl -s -O "https://osquery-packages.s3.amazonaws.com/darwin/osquery-1.4.5.pkg"
installer -pkg osquery-1.4.5.pkg -target /
SHELL
@chilcote
chilcote / gist:3314df7316a967f054cd
Created July 9, 2015 15:07
Vagrantfile to pull softwareupdate -l output
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "osx103"
config.vm.provision "shell", inline: <<-SHELL
softwareupdate -l
SHELL
end
AnsibleFest notes
==============
Keynote
-------
1.7.1
- enable windows powershell remoting modules in PowerShell
- can push raw powershell scripts
@chilcote
chilcote / gist:f5af1a788ac4a2e4d5df
Created September 2, 2014 03:49
python script to set dns servers and search domains in os x
#!/usr/bin/env python
'''
This script sets dns servers and search domains for all
Ethernet adapters and Wi-fi interfaces.
Requirements
------------
+ OS X 10.9.x
+ python 2.7
#!/usr/bin/env python
'''
This script returns the version of the specified Application
usage:
./pyappvers.py "VMware Fusion"
Documentation:
https://developer.apple.com/library/mac/documentation/CoreFoundation/Reference/CFPreferencesUtils/Reference/reference.html
@chilcote
chilcote / gist:10010307
Created April 6, 2014 19:14
Fun with CoreWLAN and python
#!/usr/bin/env python
'''
Playing around with CoreWLAN to return information about the wi-fi connection
Documentation:
https://developer.apple.com/library/mac/documentation/CoreWLAN/Reference/CWInterface_reference/translated_content/CWInterface.html
'''
import objc
#disable icloud prompts
osvers_major=$(sw_vers -productVersion | awk -F. '{print $1}')
osvers_minor=$(sw_vers -productVersion | awk -F. '{print $2}')
/usr/bin/defaults write /System/Library/User\ Template/English.lproj/Library/Preferences/com.apple.SetupAssistant DidSeeCloudSetup -bool true
/usr/bin/defaults write /System/Library/User\ Template/English.lproj/Library/Preferences/com.apple.SetupAssistant GestureMovieSeen none
/usr/bin/defaults write /System/Library/User\ Template/English.lproj/Library/Preferences/com.apple.SetupAssistant LastSeenCloudProductVersion ${osvers_major}.${osvers_minor}
#!/bin/sh
while [ ${SECONDS} -le 10 ]; do
if [ "$(scutil -r dc.yourdomain.com)" = "Reachable" ]; then
echo yep
break
fi
done
@chilcote
chilcote / Makefile
Created November 25, 2010 23:35
example Makefile for packaging Firefox with custom settings
include /usr/local/share/luggage/luggage.make
TITLE=app_firefox
REVERSE_DOMAIN=com.example.corp
PAYLOAD=unbz2-applications-firefox.app \
pack-firefox-settings-local-settings.js \
pack-firefox-settings-firefox_AA.cfg \
pack-firefox-settings-override.ini
unbz2-applications-firefox.app: firefox.app.tar.bz2 l_Applications
@sudo ${TAR} xjf firefox.app.tar.bz2 -C ${WORK_D}/Applications