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 | |
# your funeral | |
LOCAL_INSTALL_MANAGER="/Applications/Utilities/Adobe Flash Player Install Manager.app/Contents/MacOS/Adobe Flash Player Install Manager" | |
DOWNLOAD_URL="https://fpdownload.macromedia.com/get/flashplayer/current/support/uninstall_flash_player_osx.dmg" | |
DMG_NAME=$(printf "%s" "$DOWNLOAD_URL" | sed 's@.*/@@') | |
LOCAL_DMG_PATH="/tmp/$DMG_NAME" | |
LOCAL_VOLUME_NAME="Flash Player" | |
localFlashVersion=$(/usr/bin/defaults read "/Library/Internet Plug-Ins/Flash Player.plugin/Contents/version" CFBundleShortVersionString) |
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
I use Homebrew and wanted to install pip for mercurial. Pip requires a homebrew-installed version of Python, which is fine and dandy; however, I noticed that webkit2png was broken after I installed Python with Homebrew (it was missing pyobjc libs, which comes with the OS X Python install by default). | |
This assumes that the current homebrewed version of Python is 2.7.1 and that homebrew is set up for /usr/local. If that's not the case, you may have to change the minor version of setuptools (e.g. from 2.7 to 2.8) and change the PATH accordingly. | |
$ brew install python | |
Modify your PATH to include the path to Python's bin directory: | |
export PATH="/usr/local/Cellar/python/2.7.1/bin:/usr/local/bin:$PATH" |
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
FROM debian:jessie | |
ARG VERSION=0.12.1 | |
ARG SHA256HASH=34de171ac1b48b0780d68f3844c9fd2e8bfe6a7780b55e1f012067c2440ebd8a | |
RUN apt-get update && \ | |
apt-get install -y wget ca-certificates && \ | |
apt-get clean && \ | |
wget https://www.bitcoinunlimited.info/downloads/bitcoinUnlimited-${VERSION}-linux64.tar.gz && \ |
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
<!DOCTYPE html> | |
<script src="http://mbostock.github.com/d3/d3.v2.js?2.8.1"></script> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> | |
<style> | |
body { | |
font: 10px sans-serif; | |
} | |
rect { |
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 objc | |
from Foundation import NSBundle | |
CG_bundle = NSBundle.bundleWithIdentifier_('com.apple.CoreGraphics') | |
functions = [("CGSSessionCopyAllSessionProperties", b"@"),] | |
objc.loadBundleFunctions(CG_bundle, globals(), functions) | |
# example usage: graphical_security_sessions = CGSSessionCopyAllSessionProperties() |
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 | |
echo 'Requires Ubuntu = 16.04 and installs Nginx + uWSGI + Web2py' | |
# Check if user has root privileges | |
if [[ $EUID -ne 0 ]]; then | |
echo "You must run the script as root or using sudo" | |
exit 1 | |
fi | |
# parse env vars | |
WEB2PY_PASS="${WEB2PY_PASS:-0}" | |
NOPASSWORD="${NOPASSWORD:-0}" |
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/sh | |
# | |
# Provides standard user access to preference panels they would expect to be able to access, and might need access to. | |
# | |
# Provides standard users access to system preferences | |
/usr/bin/security authorizationdb write system.preferences allow |
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
#!/usr/bin/python | |
# Requires passlib: pip install passlib | |
from passlib.hash import pbkdf2_sha512 | |
from passlib.util import ab64_decode | |
from biplist import * | |
# Checksum size must be 128 bytes for use as OS X password hash! | |
pbkdf2_sha512.checksum_size = 128 | |
hash = pbkdf2_sha512.encrypt("password", rounds=38000, salt_size=32) |
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
#!/bin/bash -x | |
# Wait for networking to be up, just in case | |
/usr/sbin/ipconfig waitall | |
# Loop on the presence of the standard Apple ruleset before proceeding | |
# This way we don't accidentally get overruled (SWIDT) if com.apple.pfctl | |
# happens to be loaded after myorg.pf. | |
count=0 | |
while [[ $(pfctl -sr 2>&1 | egrep "apple" | wc -l) -eq 0 && $count -lt 12 ]]; do |
OlderNewer