Skip to content

Instantly share code, notes, and snippets.

View aidin-foroughi's full-sized avatar

aidin-foroughi

View GitHub Profile
@aidin-foroughi
aidin-foroughi / azure-vm.md
Last active October 24, 2023 22:47
azure vm recipe

opencv API cheatsheet

#include <opencv2/opencv.hpp> #include "opencv2/core.hpp" #include "opencv2/imgproc.hpp"

using namespace cv; using namespace std;

Mat image = imread(Guitar.jpg");

@aidin-foroughi
aidin-foroughi / basic_leetcode.md
Last active October 19, 2023 21:11
interview prep

Some tips

strings

iterate const auto& c .push_back .pop_back

@aidin-foroughi
aidin-foroughi / docker-nvidia.md
Last active October 24, 2023 21:51
docker nvidia
@aidin-foroughi
aidin-foroughi / fiftyone.md
Last active October 4, 2023 16:16
fiftyone

Some useful fiftyone tips

Visualize dataset using fifty one

import fiftyone
import fire
import pathlib
@aidin-foroughi
aidin-foroughi / airflow.md
Last active September 29, 2023 00:23
airflow

Put airflow learnings here

Essentially, you can use it to distribute work on a celery cluster very easily.

You typically want to use of the standard operators BashOperator PythonOperator or the best I think: DockerOperator

@aidin-foroughi
aidin-foroughi / docker-in-docker.md
Last active September 29, 2023 00:20
docker in docker

Some tips on docker in docker

mount /var/run.docker.sock:/var/run/docker.sock

in windows ///var/run.docker.sock:/var/run/docker.sock

learn about privileged mode

learn about the Docker Socket Proxy

@aidin-foroughi
aidin-foroughi / docker-compose.md
Last active October 6, 2023 20:59
docker-compose

Some docker compose tips and tricks

For environment variables, use poxis parameter expansion to set defaults:

services: myapp: environment: SOME_VALUE: ${SOME_VALUE:-default-value}

You can define a .env file next to docker-compose to provide the variables

@aidin-foroughi
aidin-foroughi / nginx.md
Last active September 29, 2023 00:16
nginx

Here is what nginx can be used for

Gateway / reverse proxy / load balancer: Instead of exposing a bunch of different backend services separately, have nginx route requests to the appropriate backend.

If you have multiple instances of the same service, you can automatically balance the load using simple round robin or least connection based strategies.

In terms of authentication, basic user/pass based authentication is possible. nginx plus, which is not free, supports more advanced authentication methods, but it's still possible to use nginx too, with a bit more extra work.

The configuration file is /etc/nginx/conf.d/default.conf, which uses a domain specific language looking like:

@aidin-foroughi
aidin-foroughi / resources.md
Last active September 18, 2023 23:34
research resources

Some bookmarks

human pose estimation

https://istvansarandi.com/dozens/

Describes how many different pose datasets with their different skeletons can be used to train one single model. Essentially comes up with a common skeleton, using autoencoders.