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
How to convert existing phoenix app to an umbrella app. | |
https://elixir-lang.slack.com/archives/phoenix/p1472921051000134 | |
chrismccord [10:14 PM] | |
@alanpeabody yes, it's straightforward | |
[10:14] | |
1) mix new my_umbrella --umbrella |
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
Support SASL_PLAIN auth for kafka broker | |
Kafka broker can be configure like | |
`/usr/local/etc/kafka/server.properties`: | |
``` | |
listeners=SASL_PLAINTEXT://localhost:9093 | |
advertised.listeners=SASL_PLAINTEXT://localhost:9093 | |
security.inter.broker.protocol=SASL_PLAINTEXT | |
sasl.mechanism.inter.broker.protocol=PLAIN |
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
alter table declarations rename to declarations_old; | |
/*Drop triggers*/ | |
drop trigger on_declaration_insert ON public.declarations_old; | |
drop trigger on_declaration_update ON public.declarations_old; | |
/*Drop all indexes*/ | |
drop index declarations_declaration_number_index; | |
drop index declarations_declaration_request_id_index; | |
drop index declarations_employee_id_status_index; |
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
#!/bin/bash | |
CERT_NAME=cert_ | |
META=.meta | |
#openssl pkcs7 -in ~/Downloads/PB2019.p7b -inform DER -print_certs -out chain.pem | |
if [ $1 ] | |
then | |
if [ -f $1 ] | |
then |
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
mix phx.new --umbrella --database postgres --no-webpack --no-ecto --no-html --binary-id to_do | |
cd apps/to_do | |
mix phx.gen.schema ToDo.Item items title:string description:text status:text owner:uuid | |
mix ecto.gen.repo -r ToDo.Repo | |
mix ecto.create | |
mix ecto.migrate | |
cd ../ | |
mix new protobuf |
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
cat data.csv | awk -F',' '{print " SET \""$1"\" \""$2"\" \n"}' | redis-cli --pipe |
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
cat data.csv | awk -F',' '{print " SET \""$1"\" \""$2"\" \n"}' | redis-cli --pipe |
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 HV.ConfigProviders.VaultConfigProvider do | |
@moduledoc false | |
@behaviour Config.Provider | |
require Logger | |
# Let's pass the path to the JSON file as config | |
def init(nil), do: "/path/to/vault/token" | |
def init(path) when is_binary(path), do: path |
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 HV.MixProject do | |
use Mix.Project | |
def project do | |
[ | |
app: :hello_vault, | |
version: "0.1.0", | |
elixir: "~> 1.12", | |
elixirc_paths: elixirc_paths(Mix.env()), | |
compilers: Mix.compilers(), |