Since Mavericks stopped using the deprecated ipfw
(as of Mountain Lion), we'll be using pf
to allow port forwarding.
####1. anchor file
Create an anchor file under /etc/pf.anchors/<anchor file>
with your redirection rule like:
server { | |
root /var/www/example.com/static; | |
server_name example.com; | |
access_log /var/log/nginx/example.com.access.log; | |
error_log /var/log/nginx/example.com.error.log; | |
try_files /maintenance.html @proxy; | |
location @proxy { | |
proxy_pass http://127.0.0.1:10001; |
Load up Terminal (Applications > Utilities > Terminal.app) and type the following. | |
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist | |
To turn it back on, just do the opposite: | |
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist |
#!/bin/bash | |
echo "Generating an SSL private key to sign your certificate..." | |
openssl genrsa -des3 -out myssl.key 1024 | |
echo "Generating a Certificate Signing Request..." | |
openssl req -new -key myssl.key -out myssl.csr | |
echo "Removing passphrase from key (for nginx)..." | |
cp myssl.key myssl.key.org | |
openssl rsa -in myssl.key.org -out myssl.key |
FILTER_PATTERNS =*.js=doxygen.js |
Arg Name or Optional Flags: | |
positional : str = "foo" | |
options : str = "-f", "--foo" | |
Standard: | |
action : str = [store], append, store_true, store_false, store_const, append_const, version | |
default : * = [None] | |
type : callable = [str], argparse.FileType(mode='wb', bufsize=0) | |
Exotic: |
#!/bin/bash | |
# This script downloads a gravatar image associated with EMAIL and saves it at | |
# AVATAR_OUTPUT_PATH then creates a favicon icon and saves it at | |
# FAVICON_OUTPUT_PATH. | |
EMAIL="[email protected]" | |
AVATAR_OUTPUT_PATH="static/img/avatar.png" | |
FAVICON_OUTPUT_PATH="static/favicon.ico" |
<!-- Video element (live stream) --> | |
<label>Video Stream</label> | |
<video autoplay id="video" width="640" height="480"></video> | |
<!-- Canvas element (screenshot) --> | |
<label>Screenshot (base 64 dataURL)</label> | |
<canvas id="canvas" width="640" height="480"></canvas> | |
<!-- Capture button --> | |
<button id="capture-btn">Capture!</button> |
def self.get_institution(financial_institution_name, ofx_client_id=nil, ssl_version=nil) | |
case financial_institution_name | |
when 'USAA' | |
FinancialInstitution.new('USAA', | |
URI.parse('https://service2.usaa.com/ofx/OFXServlet'), | |
OFX::Version.new("1.0.2"), | |
'USAA', '24591', '314074269', | |
ofx_client_id, ssl_version) |
set set target.max-string-summary-length 10000 |