-
Restart the computer in Recovery mode (hold down Cmd-R). Open Terminal and run:
$ csrutil disable
-
Restart the computer normally.
-
Edit the Apache2 plist file with whatever editor you like (example using vim):
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
[CmdletBinding()] | |
param ( | |
[Parameter(Mandatory=$True)] | |
[string]$grep_pattern, | |
[Parameter(Mandatory=$True)] | |
[string]$glob_pattern, | |
[Parameter(Mandatory=$False)] | |
[string]$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
#!/bin/bash -x | |
if [ "$EUID" -ne 0 ] | |
then echo "Must be run as root." | |
exit | |
fi | |
setsebool -P httpd_anon_write 1 | |
setsebool -P httpd_sys_script_anon_write 1 | |
for d in $(echo "ezpublish/cache,ezpublish/logs,ezpublish/config,ezpublish_legacy/design,ezpublish_legacy/extension,ezpublish_legacy/settings,ezpublish_legacy/var,web" | tr "," "\n"); do | |
semanage fcontext -a -t public_content_rw_t "/var/www/html/ez/$d(/.*)?" | |
done |
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
def safeResult(fn, expectedError = Exception, alternative = None, **kwargs): | |
"""Returns the result of fn(kwargs), or if there are exceptions, returns alternative instead.""" | |
result = alternative | |
try: | |
result = fn( kwargs ) | |
except expectedError: | |
pass | |
return result |
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
Modernizr.addTest "rem", -> | |
elem = document.createElement "div" | |
elem.setAttribute "style", "font-size: 1rem" | |
return elem.style.fontSize == "1rem" |
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
ul { | |
/* Fix for inline-block whitespace issue. Source: http://www.lifeathighroad.com/web-development/css-web-development/inline-block-whitespace-workaround/ */ | |
letter-spacing: -4px; | |
word-spacing: -4px; | |
} | |
li { | |
background-color: lightgray; | |
display: inline-block; | |
height: 75px; |
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
[loggers] | |
keys=root | |
[handlers] | |
keys=consoleHandler,fileHandler | |
[formatters] | |
keys=simpleFormatter | |
[logger_root] |
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
<? | |
$dom = new DOMDocument('1.0', 'utf-8'); | |
@$dom->loadHTML( mb_convert_encoding($htmldoc, 'HTML-ENTITIES', 'UTF-8') ); | |
$x = new DOMXPath($dom); |
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/env python | |
import argparse, subprocess | |
parser = argparse.ArgumentParser() | |
parser.add_argument("file_glob", help="a quoted string to use when globbing for files; example: \"*.py\"") | |
parser.add_argument("search_string", help="the string to search for in the files") | |
args = parser.parse_args() | |
find = subprocess.Popen(["find", ".", "-type", "f", "-name", args.file_glob, "-print0"], stdout=subprocess.PIPE) |
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 | |
CURRENT_DATETIME=`date "+%Y%m%d_%H%M%S_%z" | sed -e "s/+//"` | |
REPORTFILE="${CURRENT_DATETIME}_storage_report.txt" | |
echo "Generating file ${REPORTFILE} ..." | |
echo "Storage report for `date "+%Y-%m-%d %H:%M:%S %z"`" > ${REPORTFILE} | |
echo "========================================================================" >> ${REPORTFILE} | |
# If you have sort version 8.17 or newer, use the following code: | |
find . -mindepth 1 -maxdepth 1 -print0 | xargs -0 du -hs | sort -hr >> ${REPORTFILE} | |
# If you have an older version of sort, use this code instead: | |
# (find . -mindepth 1 -maxdepth 1 -print0 | xargs -0 du -sk) | sort -n | perl -ne '($s,$f)=split(m{\t});for (qw(K M G)) {if($s<1024) {printf("%.1f",$s);print "$_\t$f"; last};$s=$s/1024}' | tac >> ${REPORTFILE} |