First I created 3 droplets on digital ocean with 4-cores and 8GB of RAM. Login as root to each and run:
sysctl -w fs.file-max=12000500
sysctl -w fs.nr_open=20000500
ulimit -n 4000000
sysctl -w net.ipv4.tcp_mem='10000000 10000000 10000000'| # Specifically we are trying to do 2 things with the erlang `:ssh` module: | |
| # Make a connection (use :ssh.connect/4`) and pass in the ssh key from something other than a file on disk | |
| # And then with an open connection, bind the connection to a local port (i.e. setup a ssh tunnel) | |
| # use :ssh.tcpip_tunnel_to_server/5 or :ssh.tcpip_tunnel_to_server/6 | |
| # Example (working) code: | |
| defmodule SSHTunnel do | |
| @local_port 9999 | |
| @remote_port 1234 |
| See: https://github.com/cpursley/vecto |
| defmodule NestedWeb.FormLive do | |
| use NestedWeb, :live_view | |
| require Logger | |
| defmodule Form do | |
| use Ecto.Schema | |
| import Ecto.Changeset | |
| embedded_schema do | |
| field :name, :string |
| defmodule MyAppWeb.GettextTest do | |
| use ExUnit.Case | |
| import MyAppWeb.Gettext | |
| # A unit test for Gettext translations that checks if the original and the translation | |
| # use the same HTML tags. | |
| # | |
| # Uses Floki to parse HTML. | |
| describe "translations" do |
| #!/bin/bash | |
| if [ "$EUID" -ne 0 ] | |
| then echo "Please run as root" | |
| exit | |
| fi | |
| apt-get install pkg-config libmagickwand-dev -y | |
| cd /tmp | |
| wget https://pecl.php.net/get/imagick-3.4.4.tgz | |
| tar xvzf imagick-3.4.4.tgz |
| /* | |
| Copy this into the console of any web page that is interactive and doesn't | |
| do hard reloads. You will hear your DOM changes as different pitches of | |
| audio. | |
| I have found this interesting for debugging, but also fun to hear web pages | |
| render like UIs do in movies. | |
| */ | |
| const audioCtx = new (window.AudioContext || window.webkitAudioContext)() |
| default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam' | |
| default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes' | |
| default['sshd']['sshd_config']['PasswordAuthentication'] = 'no' |
| /** | |
| * Returns a new object that merges the values of | |
| * `newObj` into `oldObj`. Uses shallow copying. | |
| * | |
| * **WARNING: Do NOT pass cyclical objects! | |
| * This includes React nodes!** | |
| * | |
| * **IMPORTANT:** util.merge does **NOT** behave like | |
| * lodash merge! *TL;DR:* (typed) arrays are not merged | |
| * but replaced by the newer array. |
| FROM elixir:1.4.5 as asset-builder-mix-getter | |
| ENV HOME=/opt/app | |
| RUN mix do local.hex --force, local.rebar --force | |
| # Cache elixir deps | |
| COPY config/ $HOME/config/ | |
| COPY mix.exs mix.lock $HOME/ | |
| COPY apps/myproject_web/mix.exs $HOME/apps/myproject_web/ | |
| COPY apps/myproject_web/config/ $HOME/apps/myproject_web/config/ |