Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.
![Screenshot 2023-12-18 at 10 40 27 PM](https://private-user-images.githubusercontent.com/3837836/291468646-4c30ad72-76ee-4939-a5fb-16b570d38cf2.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAwMjI4NzAsIm5iZiI6MTcyMDAyMjU3MCwicGF0aCI6Ii8zODM3ODM2LzI5MTQ2ODY0Ni00YzMwYWQ3Mi03NmVlLTQ5MzktYTVmYi0xNmI1NzBkMzhjZjIucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcwMyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MDNUMTYwMjUwWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZWUyMTc1MmZhNTU4YzdmMzcxOGU4MWY3Y2NhN2E1OWZhMDE4ZDA5MGM2YjBjMGUxNmFkMzhiOTY2YzkzZGU3OCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.VPIsr4tKO9Wj2dhFbLgMHMbYzHZ1vVXD_bk-11Usx7c)
Mix.install( | |
[ | |
{:phoenix_playground, "~> 0.1.0"}, | |
{:openai, "~> 0.6.1"} | |
], | |
config: [ | |
openai: [ | |
api_key: System.get_env("OPENAI_API_KEY"), | |
organization_key: System.get_env("OPENAI_ORGANIZATION_KEY") | |
] |
Application.put_env(:elixir, :ansi_enabled, true) | |
# IEx shell customization for color | |
# - Added as a comment: https://thinkingelixir.com/course/code-flow/module-1/pipe-operator/ | |
# - Original source: https://samuelmullen.com/articles/customizing_elixirs_iex/ | |
# - Can add to a specific project or can put in the User home folder as a global config. | |
# Updates from: | |
# - https://github.com/am-kantox/finitomata/blob/48e1b41b21f878e9720e6562ca34f1ce7238d810/examples/ecto_intergation/.iex.exs | |
timestamp = fn -> | |
{_date, {hour, minute, _second}} = :calendar.local_time |
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 |
#!/usr/bin/env bash | |
DATABASE_URL="postgres://MyPostgresUser:MyPostgresPassword@192.168.0.1:5432/MyPostgresDB" | |
# `cut` is used to cut out the separators (:, @, /) that come matched with the groups. | |
DATABASE_USER=$(echo $DATABASE_URL | grep -oP "postgres://\K(.+?):" | cut -d: -f1) | |
DATABASE_PASSWORD=$(echo $DATABASE_URL | grep -oP "postgres://.*:\K(.+?)@" | cut -d@ -f1) | |
DATABASE_HOST=$(echo $DATABASE_URL | grep -oP "postgres://.*@\K(.+?):" | cut -d: -f1) | |
DATABASE_PORT=$(echo $DATABASE_URL | grep -oP "postgres://.*@.*:\K(\d+)/" | cut -d/ -f1) |
defmodule Commerce.Orders.MockWebsocketServer do | |
use Plug.Router | |
plug(:match) | |
plug(:dispatch) | |
match _ do | |
send_resp(conn, 200, "Hello from plug") | |
end |
sudo apt update && sudo apt upgrade -y | |
sudo apt install apache2 -y | |
sudo apt install easy-rsa -y | |
cd /usr/share/easy-rsa | |
sudo ./easyrsa init-pki | |
yes "" | sudo ./easyrsa build-ca nopass |
--- | |
# Checks if files exists that related to Exaramel Malware | |
# Ref:https://www.cert.ssi.gouv.fr/uploads/CERTFR-2021-CTI-005.pdf | |
- name: Setting files to check | |
set_fact: | |
maliciousFiles: | |
- /tmp/.applocktx | |
- /tmp/.applock | |
- /usr/local/centreon/www/search.php |
import Ecto.Query | |
... | |
defmacro store_items_not_exist(store_items_table_name, store_id, item_name) do | |
args = [ | |
"NOT EXISTS (SELECT * FROM #{store_items_table_name} item WHERE item.store_id = ? AND item.name == ?)", | |
store_id, | |
item_name | |
] |