Skip to content

Instantly share code, notes, and snippets.

View saravanabalagi's full-sized avatar

Saravanabalagi Ramachandran saravanabalagi

  • Ireland
View GitHub Profile
@saravanabalagi
saravanabalagi / install_singularity_module.md
Last active October 20, 2022 17:23
Singularity Module

Singualarity Module

A convenience python script that helps create shortcuts in host machine to programs inside of singularity containers.

  • Place this inside ~/.local/bin and make sure you have export PATH="$HOME/.local/bin:$PATH" in .bashrc or .zshrc
  • Make module executable by running chmod +x ~/.local/bin/module
  • To load a shortcut to node from dev singularity instance into ~/.local/bin:
module load node dev
@saravanabalagi
saravanabalagi / wsl2_setup.md
Last active March 25, 2022 17:28
Install WSL2 in another drive and Create multiple instances

Install Windows Subsystem for Linux on a Non-System Drive

  1. Download ubuntu2004.appx from https://aka.ms/wsl-ubuntu-2004
  2. Open with WinZip or WinRAR and then open Ubuntu_2004.2021.825.0_x64.appx again as archive
  3. Extract contents of Ubuntu_2004.2021.825.0_x64.appx into a new folder e.g. V:/ubuntu_new
  4. To install, simply run ubuntu.exe

Installing multiple instances of Ubuntu in WSL2

Skip installing ubuntu.exe and follow the instructions below, the instructions will create a the new wsl instance Ubuntu2

@saravanabalagi
saravanabalagi / runafter
Last active September 25, 2023 19:36
Executes command after a process completes
#!/bin/bash
if [ $1 == '--help' ] || [ $1 == 'help' ] || [ $1 == '-h' ] ; then
echo "usage: runafter <pid> [-f] <command>"
exit 0
fi
re='^[0-9]+$'
if ! [[ $1 =~ $re ]] ; then
echo "error: first arg must be a pid of a running process" >&2
exit 1
@saravanabalagi
saravanabalagi / MongoDB_cheatsheet.md
Created April 13, 2021 17:13
MongoDB Cheatsheet

MongoDB Cheat Sheet

Show All Databases

show dbs

Show Current Database

@saravanabalagi
saravanabalagi / install_vlfeat_matconvnet_gpu.md
Last active June 1, 2022 12:20
vlfeat Matconvnet GPU Compilation Guide

Install vlfeat Matconvnet

Tested on

  • Ubuntu 18.04
  • Matlab 2019a
  • gcc 5.5.0
  • CUDA 10.1
  • CuDNN 7.6.5

Hardware used:

@saravanabalagi
saravanabalagi / Labels_2_Conf_Matrix_Formula_and_vice_versa.md
Last active March 1, 2021 21:10
Labels to Confusion Matrix and Vice Versa

Formula to get Label (in column S) from TP FP TN FN (starting from column M)

=IF(M2=1, 1, IF(N2=1, 0, IF(O2=1, 0, IF(P2=1, 1, "INVALID"))))

Formulas to get TP FP TN FN (in order)

  • M Column: =IF(AND(J2=TRUE,S2=1),1,"")
  • N Column: =IF(AND(J2=TRUE,S2=0),1,"")
  • O Column: =IF(AND(J2=FALSE,S2=0),1,"")
  • P Column: =IF(AND(J2=FALSE,S2=1),1,"")
@saravanabalagi
saravanabalagi / get_pip.sh
Created February 15, 2021 13:32
Get pip on py38 on a fresh Ubuntu 20.04 installation
ln -s python3 /usr/bin/python
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py
rm get-pip.py
@saravanabalagi
saravanabalagi / change_colors_gnome_terminal.md
Created April 26, 2020 13:39
How to change display colors for terminal

Changing base colors for terminal

  1. Open Terminal, Right click and Go to Preferences.
  2. Create a new profile named Default and set it as default.
  3. Pick a color theme from Gogh, install it using bash -c "$(wget -qO- https://git.io/vQgMr)" and pick the number corresponding to your favorite theme.
  4. This should add a new profile with the theme name.
  5. To verify, try spectrum_ls and change the profile to see the change.

For more details refer to, see fix for ubuntu 20.04, and also gogh's ubuntu issue

@saravanabalagi
saravanabalagi / tf_summary_v1_v2.md
Last active April 15, 2020 16:18
Tensorflow Summary API v1 vs v2

Tensorflow v1 Summary

import tensorflow as tf
from tensorflow_core.python.summary import summary
tf.compat.v1.disable_eager_execution()

summary_writer = tf.compat.v1.summary.FileWriter(params.model_dir)
for i in range(10):
 summary.scalar("test_scalar_v1", float(i))
@saravanabalagi
saravanabalagi / ad_removal_jdownloader.md
Created April 14, 2020 14:33
Removing Ads in Jdownloader

Remove ads in JDownloader

Search for the following keywords in "advanced settings" and disable (uncheck) the options which appear.

premium alert
oboom
Special Deals
Donate
Banner