Skip to content

Instantly share code, notes, and snippets.

View varunagrawal's full-sized avatar
🎯
Focusing

Varun Agrawal varunagrawal

🎯
Focusing
View GitHub Profile
@varunagrawal
varunagrawal / jupyter_ngrok.md
Last active March 25, 2024 17:07 — forked from artificialsoph/jupyter_ngrok.md
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

CMake

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).

export CMAKE_PREFIX_PATH=~/borglab/libs:$CMAKE_PREFIX_PATH
@varunagrawal
varunagrawal / brew_ignition-math6_log.make
Created November 13, 2020 15:22
Ignition Math6 error log
2020-11-13 10:20:20 -0500
make
install
/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
varunagrawal / git_subtree_basics.md
Created August 27, 2020 17:15 — forked from SKempin/Git Subtree basics.md
Git Subtree Basics

Git Subtree Basics

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

Background

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
varunagrawal / script_dir.sh
Created March 28, 2020 20:38 — forked from elentok/script_dir.sh
Current script directory (works in bash and zsh)
SCRIPT_DIR=`dirname ${BASH_SOURCE[0]-$0}`
SCRIPT_DIR=`cd $SCRIPT_DIR && pwd`
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
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
varunagrawal / opencv3_cmake.md
Last active October 22, 2021 17:35
Compiling OpenCV 3+

Also works for OpenCV 4

Prerequisites

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 https://cmake.org/files/v3.9/cmake-3.9.0.tar.gz
tar -zxvf cmake-3.9.0.tar.gz
cd cmake-3.9.0
@varunagrawal
varunagrawal / archlinux_install_guide.md
Last active September 24, 2023 00:41
ArchLinux Installation Guide

Arch Install Guide

Foundation

  • 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