Skip to content

Instantly share code, notes, and snippets.

View raeidsaqur's full-sized avatar
💭
I may be slow to respond.

Raeid raeidsaqur

💭
I may be slow to respond.
View GitHub Profile
@raeidsaqur
raeidsaqur / wolf-py310-requirements.txt
Created January 13, 2023 16:20
python version: 3.10.6. Installed modules on `teach.cs.toronto.edu` ($python3 -m pip freeze > requirement.txt).
absl-py==1.1.0
astroid==2.12.13
astunparse==1.6.3
attrs==21.4.0
blis==0.7.8
cachetools==5.2.0
catalogue==2.0.7
certifi==2022.6.15
chardet==5.0.0
charset-normalizer==2.1.0
@raeidsaqur
raeidsaqur / jupyter.slurm
Last active November 19, 2023 13:17
SLURM script for opening a Jupyter Notebook tunnel
#!/bin/bash
#SBATCH -p p100
#SBATCH --gres=gpu:1
#SBATCH -c 4
#SBATCH --mem=16G
#SBATCH --nodes=1
#SBATCH --ntasks=1
##SBATCH --ntasks-per-node=1
#SBATCH --time=04:00:00
#SBATCH --job-name=jupyter-notebook
@raeidsaqur
raeidsaqur / headless_rendering_unity.py
Created June 24, 2022 17:58
Create a WSGI server to allow declarative headless rendering for unity based gaming environments.
## For general architecture see: https://silverweed.github.io/assets/docs/distributed_rendering_in_vulkan.pdf
import Xlib.display
import glob
import warnings
import os
import ctypes.util
import xml.etree.ElementTree
@raeidsaqur
raeidsaqur / virtual_x-server_setup.sh
Created April 26, 2022 17:51
Bash script for Virtual X-server setup
#!/bin/bash
# Install NVIDIA driver:
sudo apt-get update
sudo apt-get install nvidia-driver-460
sudo reboot now
# Wait 3 minutes and reconnect
sleep 3m
# Check that nvidia driver is loaded:
@raeidsaqur
raeidsaqur / wolf_requirements.txt
Last active January 12, 2022 01:37
Installed modules on `teach.cs.toronto.edu` ($python3 -m pip freeze > requirement.txt). For last year's (python 3.8) use $python3.8 -m pip freeze
astroid==2.7.3
attrs==20.3.0
certifi==2020.12.5
chardet==4.0.0
click==8.0.1
colorama==0.4.4
conllu==4.4.1
filelock==3.0.12
funcparserlib==0.3.6
huggingface-hub==0.0.17
@raeidsaqur
raeidsaqur / virtual_x-server_setup
Created November 2, 2021 20:16
Setup a cluster (gpu) node for rendering unity (ALFRED or AI2Thor for e.g.) simulations using virutal X-Server
#!/bin/bash
# Author: Raeid Saqur
# Email: raeidsaqur@cs.toronto.edu
# Install NVIDIA driver:
sudo apt-get update
sudo apt-get install nvidia-driver-460
sudo reboot now
# Wait 3 minutes and reconnect
@raeidsaqur
raeidsaqur / rsync_local2remote_v.sh
Last active October 2, 2021 19:01
[Vector Institute] Cron Rsync Script for LOCAL <-> REMOTE syncing
#!/bin/bash
# Author: Raeid Saqur
# Email: raeidsaqur@cs.toronto.edu
LOCAL_KEY=id_rsa
REMOTE_USER=raeidsaqur
REMOTE_SERVER="vdm1.vectorinstitute.ai" # use dedicated data mover server networked to Vaughan
PROJ_PATH="<SOME/PROJ/PATH>"
LOCAL_PROJ_DIR="$HOME/Research/projects/${PROJ_PATH}"
@raeidsaqur
raeidsaqur / conda_jupyter_snippets.sh
Created April 30, 2020 20:29
Handling Conda Environments in Jupyter Notebook
#!/bin/bash
# Create virtual env in Conda
conda create -n aenv python=3.8
conda activate aenv
# To [list|remove]
#conda env [list|remove] [-n aenv]
# Add Conda env to Jupyter Notebook
pip install --user ipykernel
@raeidsaqur
raeidsaqur / graph_top_sort.py
Created April 30, 2020 15:06
Py_3.9-TopologicalSorter
from functools import TopologicalSorter
graph = {"A": {"D"}, "B": {"D"}, "C": {"E", "H"}, "D": {"F", "G", "H"}, "E": {"G"}}
ts = TopologicalSorter(graph)
list(ts.static_order())
# ['H', 'F', 'G', 'D', 'E', 'A', 'B', 'C']
@raeidsaqur
raeidsaqur / wandb_run_identifier.py
Last active March 31, 2020 00:07
WandB Run Identifier (naive, untested example) to exemplify the idea
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import time, logging, platform
import wandb
def wandb_init(opt, *args, **kwargs):
"""A quick naive example """
wandb_identifier = get_run_identifier(opt, *args, **kwargs)
wandb.init(project="aProj", name=wandb_identifier, notes="<Intriguing notes>")