Skip to content

Instantly share code, notes, and snippets.

View p3jitnath's full-sized avatar
:octocat:
Think Different.

Pritthijit Nath p3jitnath

:octocat:
Think Different.
View GitHub Profile
@p3jitnath
p3jitnath / remote_access.txt
Last active July 4, 2023 00:13
Remote Access Jupyter Lab from DoC Computer Lab at Huxley (Imperial College)
Step 0: SSH into SSH Gateway
$ ssh xyz123@shell3.doc.ic.ac.uk
======================================
Step 1: SSH into Remote Server
$ ssh xyz123@beech14.doc.ic.ac.uk
Step 2: Run Jupyter Lab in the remote environment
$ cd DIRECTORY
@p3jitnath
p3jitnath / find_big_unwanted_files.sh
Created September 15, 2022 04:15
Bash one-liner to indentify the big (unwanted) in a code-only repository
git rev-list --objects --all |
git cat-file --batch-check='%(objecttype) %(objectname) %(objectsize) %(rest)' |
sed -n 's/^blob //p' |
sort --numeric-sort --key=2 |
cut -c 1-12,41- |
$(command -v gnumfmt || echo numfmt) --field=2 --to=iec-i --suffix=B --padding=7 --round=nearest
@p3jitnath
p3jitnath / summer_internships.txt
Last active August 29, 2022 15:05
List of Summer Internships for UG Students
SUMMER INTERNSHIPS LIST
---
RESEARCH INTERNSHIPS FOR UNDERGRADUATE AND GRADUATE STUDENTS
INDIA:
1. SURGE, IIT Kanpur (http://surge.iitk.ac.in/)
2. SPARK, IIT Roorkee (http://spark.iitr.ac.in/)
3. IIT Bombay, Research Internship Program (http://www.iitb.ac.in/en/education/research-internship)(http://www.iitb.ac.in/newacadhome/toTraining.jsp)(https://www.it.iitb.ac.in/summerinternship2020/selectionlist.html)
4. IAS Bangalore, SRFP (https://www.ias.ac.in/)
5. JNCASR, Bangalore, SRFP (http://www.jncasr.ac.in/fe/srfp.php)
@p3jitnath
p3jitnath / taylor_diagram.py
Last active November 16, 2022 13:48
Python code to generate Taylor Diagrams
#!/usr/bin/env python
# Copyright: This document has been placed in the public domain.
"""
Taylor diagram (Taylor, 2001) implementation.
Based on Copin's implementation in Python.
Co-authors : "Yannick Copin <yannick.copin@laposte.net>" and "Pritthijit Nath <pritthijit.nath@icloud.com>"
"""
import numpy as NP
@p3jitnath
p3jitnath / parse_onnx_acasxu.py
Created August 24, 2021 06:47
ACAS-Xu ONNX Parser
# Loading ONNX Network and Creating resulting neural network expressions using Big M Encoding
import tensorflow as tf
import numpy as np
import pandas as pd
from tensorflow.compat.v1 import ConfigProto
from tensorflow.compat.v1 import InteractiveSession
config = ConfigProto()
@p3jitnath
p3jitnath / convert-ppt-to-pdf.sh
Created February 23, 2021 14:09
Convert PPT to PDF using headless LibreOffice Impress
libreoffice --headless --invisible --convert-to pdf *.ppt
@p3jitnath
p3jitnath / install-hdf4.sh
Last active December 5, 2020 20:01
Install HDF4
sudo apt-get install libhdf4-dev
pip install pyhdf
@p3jitnath
p3jitnath / extract_from_geojson.py
Last active July 13, 2020 14:44
Geocoding Setup using Selenium
import json
from shapely.geometry import shape, Point
with open('./Data/nyc-neighborhoods.geo.json') as f:
js = json.load(f)
def get_nbd(lng, lat):
point = Point(lng, lat)
for feature in js['features']:
polygon = shape(feature['geometry'])
@p3jitnath
p3jitnath / torch_seed.py
Created July 2, 2020 08:34
Seed PyTorch for Reproducibility
import torch
torch.manual_seed(42)
torch.backends.cudnn.deterministic = True
torch.backends.cudnn.benchmark = False
import numpy as np
np.random.seed(42)
@p3jitnath
p3jitnath / opencv-fonts.py
Created June 29, 2020 06:21
Custom OpenCV font
import cv2
import numpy as np
img = np.zeros((100, 300, 3), dtype=np.uint8)
ft = cv2.freetype.createFreeType2()
ft.loadFontData(fontFileName='Ubuntu-R.ttf',
id=0)
ft.putText(img=img,
text='Quick Fox',