:crypto.hash/2
Phoenix.Channels
.Sample
show page.libcluster
and fly_postgres
for scalabilityInstall erlang
, Elixir
, NodeJS
, Postgres
brew update
brew install erlang elixir nodejs postgres
asdf
brew update
brew install asdf
asdf plugin-add erlang
asdf plugin-add elixir
asdf plugin-add nodejs
asdf install
mix setup
AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
S3_BUCKET_NAME
VIRUS_TOTAL_API_KEY
TRIAGE_API_KEY
DISCORD_BOT_TOKEN
DISCORD_CHANNEL_ID
iex -S mix phx.server
localhost:4000
or localhost:4001
from your browser.iex -S mix phx.server
in (yes we run commands in a running server)
VExchange.Accounts.get_user!(1) |> VExchange.Accounts.add_role_to_user("Admin")
You can run unit tests with the command
mix test
Documentation can be found at here and requires an API key generated when a user signs up.
Example script using the upload API to upload all files from a sub directory.
import requests, os, sys
from concurrent.futures import ThreadPoolExecutor
MAX_WORKERS = 10
API_LOGIN = "https://virus.exchange/api/login"
API_UPLOAD = "https://virus.exchange/api/upload"
TOKEN=""
EMAIL="ur email"
if TOKEN == "":
PASSWORD=input("Enter your password: ")
r = requests.post(API_LOGIN, data={"email":EMAIL, "password":PASSWORD})
TOKEN = r.json()["data"]["token"]
def process_file(subdir, file):
filename = os.path.join(subdir, file)
with open(filename, "rb+") as f:
file_content = f.read()
r = requests.post(API_UPLOAD, headers={'Authorization': f"Bearer {TOKEN}", "Content-Type": "application/x-www-form-urlencoded"}, data=file_content)
print(f"{os.path.basename(filename)}: STATUS({r.status_code}) {r.text}")
def main(directory):
with ThreadPoolExecutor(max_workers=MAX_WORKERS) as executor:
for subdir, dirs, files in os.walk(directory):
for file in files:
executor.submit(process_file, subdir, file)
if __name__ == '__main__':
main(sys.argv[1])
classDiagram
class Sample{
+Integer size
+String md5
+String sha1
+String sha256
+String sha512
+String s3_object_key
+Array names
+Array tags
+DateTime first_seen
}
class Users {
+String email
+String username
+String password
+Integer role_id
+String hashed_password
+DateTime confirmed_at
}
class Role {
+String name
+Jsonb permissions
}