This file contains 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
import plistlib | |
import CoreFoundation | |
from Foundation import NSDate, NSMutableArray, NSMutableDictionary | |
# read the current ManagedPlugInPolicies | |
policy = CoreFoundation.CFPreferencesCopyAppValue("ManagedPlugInPolicies", "com.apple.Safari") | |
if policy: | |
# policy is an immutable dict, so we have to make a mutable copy | |
my_policy = NSMutableDictionary.alloc().initWithDictionary_copyItems_(policy, True) |
This file contains 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
-- Example list of processes to ignore: {"xGestures"} or {"xGestures", "OtherApp", ...} | |
property processesToIgnore : {} | |
-- Get the size of the Display(s), only useful if there is one display | |
-- otherwise it will grab the total size of both displays | |
tell application "Finder" | |
set _b to bounds of window of desktop | |
set screen_width to item 3 of _b | |
set screen_height to item 4 of _b | |
end tell |
This file contains 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
<# | |
.SYNOPSIS | |
Detects if the passed Physical Disk Id is a Solid State Disk (SSD) or a | |
spindle disk. Returns true for an SSD and false for anything else. | |
.DESCRIPTION | |
Use Get-PhysicalDisk to get the Physical Disk Ids for the system you wish | |
to test. This script supports values being passed throught the pipeline. | |
The methods used for detecting are by reading the Nominal Media Rotation |
This file contains 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
#!/bin/bash | |
# 1 = VMware Tools ISO is mounted from vSphere | |
# 2 = Download VMware Tools (assumes you can connect to internet) | |
INSTALL_METHOD=2 | |
# Thanks to Rich Trouton for tip on Tools being available online | |
VMWARE_TOOLS_DOWNLOAD_URL=http://softwareupdate.vmware.com/cds/vmw-desktop/fusion/7.1.2/2779224/packages/com.vmware.fusion.tools.darwin.zip.tar | |
# DO NOT MODIFY BEYOND HERE # |
This file contains 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
echo -----BEGIN CERTIFICATE----- > encoded.txt | |
echo Just Base64 encode your binary data | |
echo TVoAAA== >> encoded.txt | |
echo -----END CERTIFICATE----- >> encoded.txt | |
certutil -decode encoded.txt decoded.bin |
This file contains 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
function Get-DellFoundationServicesWmiObject { | |
<# | |
.SYNOPSIS | |
Performs a WMI query on a Dell Foundation Services server. | |
Author: Matthew Graeber (@mattifestation) | |
License: BSD 3-Clause | |
.DESCRIPTION |
This file contains 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
' Calls WshShell.Exec with c and kills the process tree after the specified timeout t | |
' Returns the created WshScriptExec object | |
Function Exec(c, t) | |
Dim s, e : Set s = CreateObject("WScript.Shell") : Set e = s.Exec(c) | |
Do While e.Status = 0 | |
Call s.Run("waitfor /t 1 OneSecond", 0, True) | |
t = t - 1 | |
If 0 >= t Then | |
Call s.Run("taskkill /t /f /pid " & e.ProcessId, 0, True) | |
Exit Do |
This file contains 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
### | |
### | |
### 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 | |
### | |
### |
This file contains 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
function Get-WmiNamespace { | |
<# | |
.SYNOPSIS | |
Returns a list of WMI namespaces present within the specified namespace. | |
.PARAMETER Namespace | |
Specifies the WMI repository namespace in which to list sub-namespaces. Get-WmiNamespace defaults to the ROOT namespace. |
This file contains 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 --include \ | |
--no-buffer \ | |
--header "Connection: Upgrade" \ | |
--header "Upgrade: websocket" \ | |
--header "Host: example.com:80" \ | |
--header "Origin: http://example.com:80" \ | |
--header "Sec-WebSocket-Key: SGVsbG8sIHdvcmxkIQ==" \ | |
--header "Sec-WebSocket-Version: 13" \ | |
http://example.com:80/ |
OlderNewer