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
# An implementation of Pedersen Commitments. | |
# This is like tweeting out a hash of a statement you want to make but better. | |
# Why is it better? | |
# 1) If the universe of things you want to commit to is small, an attacker can just hash them to see which one you committed to. | |
# 2) I'm sure there are other nice security properties but I don't know them yet. | |
# Learning purposes only, DON'T USE THIS, I have no idea what I'm doing, etc etc |
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
#hacky way to get a hosts ip | |
function ipfor() { | |
ping -c 1 $1 | grep -Eo -m 1 '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}'; | |
} | |
# localtunnel replacement (note that I default ssh to port 443 because thats how I roll | |
localtunnel() { if [ $# -lt 2 ]; then echo "Usage: localtunnel hostname port [ssh_port]"; else ssh_port=${3-443}; echo "Setting up localtunnel on `ipfor $1`"; ssh -N -R "*:0:localhost:$2" $1 -p $ssh_port; fi;} |
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
with (import <nixpkgs> { }); | |
let | |
inherit (lib) optional; | |
inherit (python3.pkgs) buildPythonPackage fetchPypi; | |
basePackages = | |
[ git libxml2 openssl zlib curl libiconv docker-compose postgresql ] | |
++ optional stdenv.isLinux inotify-tools; | |
elixirPackages = [ elixir_1_10 ]; |
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
defmodule BikeBrigade.HoneybadgerTelemetry do | |
require Logger | |
@events [ | |
[:phoenix, :live_view, :mount, :start], | |
[:phoenix, :live_view, :handle_params, :start], | |
[:phoenix, :live_view, :handle_event, :start], | |
[:phoenix, :live_component, :handle_event, :start] | |
] |
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
defmodule GigalixirCanonicalHost do | |
defdelegate init(opts), to: PlugCanonicalHost | |
def call(conn, opts) do | |
# There's a bug in gigagilir where requests to foo.gigaglixirapp.com | |
# get `x-forwarded-proto: https` but `x-forwarded-port: 80` which messes up canonical host | |
conn = | |
if Plug.Conn.get_req_header(conn, "x-forwarded-proto") == "https" && | |
Plug.Conn.get_req_header(conn, "x-forwarded-port") == "80" do | |
conn |
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
ARG PG_VERSION=12.5 | |
ARG VERSION=dev | |
FROM golang:1.16 as flyutil | |
ARG VERSION | |
WORKDIR /go/src/github.com/fly-examples/postgres-ha | |
COPY . . |
OlderNewer