Skip to content

Instantly share code, notes, and snippets.

View varunagrawal's full-sized avatar

Varun Agrawal varunagrawal

View GitHub Profile
varunagrawal /
Last active March 25, 2024 17:07 — forked from artificialsoph/
Quickest way to get Jupyter notebook running on a remote server.

Log into your server with ssh or TeamViewer.

If it's a new server, install Python (using pyenv) and jupyter.

pip install jupyter -y

To use jupyter, we need to modify a few settings and create a password:

Building GTSAM with custom path


To allow CMake to find the custom path, we need to set the CMAKE_PREFIX_PATH environment variable.

Insert the following line in your .bashrc file (usually located at ~/.bashrc) or the RC file for whatever shell you're using (in my case ~/.zshrc).

varunagrawal / brew_ignition-math6_log.make
Created November 13, 2020 15:22
Ignition Math6 error log
2020-11-13 10:20:20 -0500
/home/varun/.linuxbrew/Cellar/cmake/3.18.4/bin/cmake -S/tmp/ignition-math6-20201113-31262-1tcx3yt/ignition-math-6.6.0 -B/tmp/ignition-math6-20201113-31262-1tcx3yt/ignition-math-6.6.0 --check-build-system CMakeFiles/Makefile.cmake 0
/home/varun/.linuxbrew/Cellar/cmake/3.18.4/bin/cmake -E cmake_progress_start /tmp/ignition-math6-20201113-31262-1tcx3yt/ignition-math-6.6.0/CMakeFiles /tmp/ignition-math6-20201113-31262-1tcx3yt/ignition-math-6.6.0//CMakeFiles/progress.marks
/usr/bin/make -f CMakeFiles/Makefile2 all
make[1]: Entering directory '/tmp/ignition-math6-20201113-31262-1tcx3yt/ignition-math-6.6.0'
/usr/bin/make -f CMakeFiles/doc.dir/build.make CMakeFiles/doc.dir/depend
varunagrawal /
Created August 27, 2020 17:15 — forked from SKempin/Git Subtree
Git Subtree Basics

Git Subtree Basics

If you hate git submodule, then you may want to give git subtree a try.


When you want to use a subtree, you add the subtree to an existing repository where the subtree is a reference to another repository url and branch/tag. This add command adds all the code and files into the main repository locally; it's not just a reference to a remote repo.

When you stage and commit files for the main repo, it will add all of the remote files in the same operation. The subtree checkout will pull all the files in one pass, so there is no need to try and connect to another repo to get the portion of subtree files, because they were already included in the main repo.

Adding a subtree

Let's say you already have a git repository with at least one commit. You can add another repository into this respository like this:

varunagrawal /
Created March 28, 2020 20:38 — forked from elentok/
Current script directory (works in bash and zsh)
SCRIPT_DIR=`dirname ${BASH_SOURCE[0]-$0}`
import gc
import numpy as np
import sys
import time
import torch
from torch.autograd import Variable
import torchvision.models as models
import torch.backends.cudnn as cudnn
import numpy as np
def average_precision(recall, precision):
mrec = np.hstack((0, recall, 1))
mpre = np.hstack((0, precision, 0))
for i in range(mpre.size-2, -1, -1):
mpre[i] = max(mpre[i], mpre[i+1])
varunagrawal / Dockerfile
Last active June 18, 2020 12:05
Docker for ROS
FROM osrf/ros:indigo-desktop-full
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && \
apt-get install -y aptitude
RUN printf 'n\nY\nY\n' | aptitude install ros-indigo-fetch-gazebo-demo
SHELL ["/bin/bash", "-c"]
varunagrawal /
Last active October 22, 2021 17:35
Compiling OpenCV 3+

Also works for OpenCV 4


NOTE: We need to use cmake with HTTPS support to download the files when cmake runs. Any version of CMake >= 3.9 should do.

wget --no-check-certificate
tar -zxvf cmake-3.9.0.tar.gz
cd cmake-3.9.0
varunagrawal /
Last active May 31, 2024 02:55
ArchLinux Installation Guide

Arch Install Guide


  • Partition a drive on Windows and delete it so that it's free space. Note the size since we'll need it later.
  • Boot into Arch
  • Run fdisk -l to see the partitions.

Disk Partitioning