# ssh to remote
localhost$ ssh -p 30000 my_app@diamond
my_app@my_app.com$ epmd -names
epmd: up and running on port 4369 with data:
name my_app at port 43108
my_app@my_app.com$ exit
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
~/sql ❯❯❯ createdb -T template0 db_name ⏎ | |
~/sql ❯❯❯ pg_restore -C -d db_name db_name.custom |
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
# in your app supervisor | |
:phx_dyn_dispatch = :ets.new(:phx_dyn_dispatch, [:named_table, :bag, :public]) | |
defmodule DynamicDispatch do | |
def register(group, plug, opts) do | |
true = :ets.insert(:phx_dyn_dispatch, {group, plug, opts}) | |
end | |
def unregister(group, plug) 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
location ~ \.(eot|svg|ttf|woff|otf)$ { | |
valid_referers blocked mysite.com *.mysite.com; | |
if ($invalid_referer) { | |
return 403; | |
} | |
} |