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:
| // format an ISO date using Moment.js | |
| // http://momentjs.com/ | |
| // moment syntax example: moment(Date("2011-07-18T15:50:52")).format("MMMM YYYY") | |
| // usage: {{dateFormat creation_date format="MMMM YYYY"}} | |
| Handlebars.registerHelper('dateFormat', function(context, block) { | |
| if (window.moment) { | |
| var f = block.hash.format || "MMM DD, YYYY hh:mm:ss A"; | |
| return moment(context).format(f); //had to remove Date(context) | |
| }else{ | |
| return context; // moment plugin not available. return data as is. |
| # /etc/nginx/sites-enabled/magento | |
| server { | |
| listen 80; | |
| server_name ec2-184-72-68-219.compute-1.amazonaws.com; | |
| root /var/www/magento/; | |
| access_log /var/log/nginx/magento-access_log; | |
| error_log /var/log/nginx/magento-error_log; | |
| location / { |
| <?php | |
| $my_page_type = 'php_news'; | |
| $parent_path = '/languages/php/news'; | |
| $hide_from_nav = TRUE; | |
| $parent = Page::getByPath($parent_path); | |
| /** | |
| * Let's pretend the title and description have been set by POST values | |
| * and added to the variables $title, $description and $content |
| #!/usr/bin/env php | |
| <?php | |
| /* | |
| Copyright 2013 Stuart Carnie and other contributors | |
| Permission is hereby granted, free of charge, to any person obtaining | |
| a copy of this software and associated documentation files (the | |
| "Software"), to deal in the Software without restriction, including | |
| without limitation the rights to use, copy, modify, merge, publish, | |
| distribute, sublicense, and/or sell copies of the Software, and to |
| #!/usr/bin/env python | |
| import os | |
| import sys | |
| import argparse | |
| try: | |
| from boto.ec2.connection import EC2Connection | |
| except ImportError: | |
| sys.stderr.write('Please install boto ( http://docs.pythonboto.org/en/latest/getting_started.html )\n') | |
| sys.exit(1) |
| import java.io.UnsupportedEncodingException; | |
| import java.util.Map; | |
| import org.simpleframework.xml.Serializer; | |
| import org.simpleframework.xml.core.Persister; | |
| import com.android.volley.AuthFailureError; | |
| import com.android.volley.NetworkResponse; | |
| import com.android.volley.ParseError; | |
| import com.android.volley.Request; |
| git branch -m old_branch new_branch # Rename branch locally | |
| git push origin :old_branch # Delete the old branch | |
| git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote |
By default when Nginx starts receiving a response from a FastCGI backend (such as PHP-FPM) it will buffer the response in memory before delivering it to the client. Any response larger than the set buffer size is saved to a temporary file on disk.
This process is outlined at the Nginx ngx_http_fastcgi_module page manual page.