Skip to content

Instantly share code, notes, and snippets.

@alirobe
alirobe / reclaimWindows10.ps1
Last active November 15, 2025 07:56
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
###
###
### UPDATE: For Win 11, I recommend using this tool in place of this script:
### https://christitus.com/windows-tool/
### https://github.com/ChrisTitusTech/winutil
### https://www.youtube.com/watch?v=6UQZ5oQg8XA
### iwr -useb https://christitus.com/win | iex
###
### OR take a look at
### https://github.com/HotCakeX/Harden-Windows-Security
@erikng
erikng / Office2016-15.11.2.plist
Last active August 29, 2015 14:26
O2016_installs_munki
<?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>erik</string>
<key>creation_date</key>
<date>2015-08-05T14:27:18Z</date>
@pudquick
pudquick / mount_shares.py
Last active March 7, 2021 16:27
Programmatically mount shares in OS X via python without the need for AppleScript
# This actually uses the same API call (NetFSMountURLSync) that AppleScript uses :D
# Note: As written, requires OS X 10.10+ / pyobjc 2.5.1+
import objc, CoreFoundation
from ctypes import c_void_p, pointer, cast
# The only reason I'm doing this the XML way is because I don't have a better way (yet)
# for correcting a function signature -after- it's already been imported.
# The problem is the last argument is a pointer to a CFArrayRef, which works out to a
# pointer to a pointer to a CFArray. pyobjc doesn't hadnle that much abstraction, so I created
@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
#!/usr/bin/python
# As written, this requires the following:
# - OS X 10.6+ (may not work in 10.10, haven't tested)
# - python 2.6 or 2.7 (for collections.namedtuple usage, should be fine as default python in 10.6 is 2.6)
# - pyObjC (as such, recommended to be used with native OS X python install)
# Only tested and confirmed to work against 10.9.5
# Run with root
@bochoven
bochoven / gist:4d27022a63c725c3a2b9
Created June 17, 2015 12:31
Mac OSX: gather info on local disks
#!/usr/bin/python
"""Mac OS X Disk/Volume script for munkireport.
https://github.com/munkireport/munkireport-php
Some ideas and functions are borrowed from gmacpyutil
https://github.com/google/macops
The script iterates over all partitions and returns a list
of Volumes with basic info (TotalSize, FreeSpace, MountPoint, VolumeName)
<p>
My programming language of preference is python for the simple reason that I feel I write better code faster with it then I do with other languages. However also has a lot of nice tricks and idioms to do things well. And partly as a reminder to myself to use them, and partly because I thought this might be of general interest I have put together this collection of some of my favourite idioms. I am also putting this on <a href="https://gist.github.com/codefisher/9d7993ddbf404c505128">gist.github.com</a> so that anyone that wants to contribute there own things can, and I will try and keep this post up to date.
</p>
<h2>enumerate</h2>
<p>
A fairly common thing to do is loop over a list while also keeping track of what index we are up to. Now we could use a <code>count</code> variable, but python gives us a nicer syntax for this with the <code>enumerate()</code> function.
<script src="https://gist.github.com/codefisher/9d7993ddbf404c505128.js?file=enumerate.py"></script>
@timsutton
timsutton / Notes.md
Last active August 29, 2015 14:08 — forked from arubdesu/Notes.txt
@bruienne
bruienne / sign_configprofile.sh
Created October 23, 2014 21:11
Sign config profile from CLI
openssl smime -sign -nodetach -in "My Awesome.mobileconfig" -signer MyAwesomeCert.pem -inkey MyAwesome.key -outform DER -out "My Awesome Signed.mobileconfig" -certfile MyAwesomeCert.pem
<?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>catalogs</key>
<array>
</array>
<key>conditional_items</key>
<array>
<dict>