Skip to content

Instantly share code, notes, and snippets.

AML/CTF Training Summary

Key Learnings

1. What is Money Laundering?

  • Process of hiding the origin of illegally gained money to make it appear legitimate.
  • Linked to predicate offences like fraud, human trafficking, tax evasion, etc.
  • Terrorist financing uses legal or illegal funds to support terrorism.

2. Money Laundering Stages

@sergioloppe
sergioloppe / 8-rules-improve-query-performance-postgresql.md
Created September 26, 2024 13:02
8 Rules to Improve Query Performance in PostgreSQL

1. Indexing

  • Create indexes on frequently filtered columns: Ensure you have indexes on columns used in WHERE, JOIN, and ORDER BY clauses (e.g., deleted_at IS NULL, created_at).
  • Use conditional indexes: If you’re often filtering by a condition (e.g., deleted_at IS NULL), create a partial index.
  • Use CONCURRENTLY when creating indexes in production: This prevents locking the table during the index creation.
  • Remove duplicate indexes: Multiple identical or overlapping indexes slow down writes without providing extra benefits.

2. Parallelism and PostgreSQL Settings

  • Enable parallel execution: Make sure PostgreSQL is configured to utilize parallelism for large queries by adjusting parameters like max_parallel_workers_per_gather and max_parallel_workers.
  • Use enable_parallel_append for UNION queries: For UNION queries across multiple tables, enabling parallel append can optimize performance.
@sergioloppe
sergioloppe / 01-instructions.md
Last active May 30, 2024 14:08
ComfyUI 2D to 3D
@sergioloppe
sergioloppe / Llama3 on Triton Inference Server running on Ubuntu 22.04 with NVIDIA 4090.md
Last active May 3, 2024 11:45
Llama3 on Triton Inference Server running on Ubuntu 22.04 with NVIDIA 4090

1. Installing Docker in Ubuntu

sudo apt install apt-transport-https ca-certificates curl software-properties-common curl gnupg lsb-release

sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo     "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu sb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

sudo apt update
@sergioloppe
sergioloppe / How to install Docker with NVIDIA CUDA support in Ubuntu 2X.04
Created April 30, 2024 18:37
How to install Docker with NVIDIA CUDA support in Ubuntu 20.04 or Ubuntu 22.04
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install ca-certificates curl gnupg lsb-release
# Add docker’s GPG key
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
@sergioloppe
sergioloppe / Setup LLaMa-2 in Ubuntu 22.04 for Nvidia RTX 4090.txt
Last active March 28, 2024 08:54
Setup LLaMa-2 in Ubuntu 22.04 for Nvidia RTX 4090
1. Check if your Ubuntu is ready for your GPU card. In my case RTX4090
```
nvidia-smi
# If you have an error like "Failed to initialize NVML: Driver/library version mismatch. NVML library version: 535.161"
ubuntu-drivers devices
sudo ubuntu-drivers autoinstall
## Or as alternative if you want to do it manually
sudo apt-get install nvidia-driver-535
@sergioloppe
sergioloppe / Kubernetes network policy generator.md
Last active October 13, 2023 07:21
Kubernetes Network policy generator

How to use it

To run the code:

  1. Setup:

    • Install Go if you haven't already. You can get it from Go's official website.

    • Ensure your GOPATH is set. Typically it's ~/go, but you might want to check or configure it according to your needs.

@sergioloppe
sergioloppe / Pairwise Comparison for Personal Data.ipynb
Last active September 11, 2023 20:21
Pairwise comparison for personal data
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

How to use JWT Auth in Laravel 9

  1. Install the "php-open-source-saver/jwt-auth" package: Use the following command to install it:
composer require php-open-source-saver/jwt-auth
  1. Copy the package config file: Use the following command to copy the package config file to the config directory:
php artisan vendor:publish --provider="PHPOpenSourceSaver\JWTAuth\Providers\LaravelServiceProvider"