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 / 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',
@p3jitnath
p3jitnath / CMakeLists.txt
Last active December 10, 2020 20:21
Install TensorRT on Ubuntu 20.04 LTS
#
# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@p3jitnath
p3jitnath / linux-kernel-panic-fix.sh
Created May 25, 2020 16:23
Fix Linux Kernel Panic
sudo apt full-upgrade
# Add processor.max_cstate=0 intel_idle.max_cstate=0 idle=poll to GRUB_CMDLINE_LINUX in /etc/default/grub
update-grub
@p3jitnath
p3jitnath / remove-python.sh
Last active May 21, 2020 23:09
Remove a version of python
prefix='/usr/local/'
pyver='3.6'
sudo rm -rf \
${prefix}bin/python${pyver} \
${prefix}bin/pip${pyver} \
${prefix}bin/include/python${pyver} \
${prefix}lib/libpython${pyver}.a \
${prefix}lib/python${pyver} \
${prefix}bin/python${pyver} \
@p3jitnath
p3jitnath / tmux.txt
Last active May 26, 2020 08:48
Tmux on Ubuntu 20.04 LTS
# Install
sudo apt install tmux
# Named Session
tmux new -s session_name
# Detach
[Ctrl-b] d
# List
@p3jitnath
p3jitnath / install-R.sh
Last active May 21, 2020 20:36
Install R on Ubuntu 20.04 LTS
sudo apt update
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DF>
sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu eoan->
sudo apt install r-base
R --version
# To use R:
# R
# Install RStudio Server
@p3jitnath
p3jitnath / build_python.sh
Last active July 24, 2020 19:16
Build python from source
sudo apt install build-essential checkinstall
sudo apt install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev
wget https://www.python.org/ftp/python/3.6.9/Python-3.6.9.tar.xz
tar xvf Python-3.6.9.tar.xz
cd Python-3.6.9/
./configure
sudo make altinstall
@p3jitnath
p3jitnath / install-docker.sh
Last active December 21, 2024 09:19
Docker and Nvidia Docker installation in Ubuntu 20.04 LTS
# WARNING : This gist in the current form is a collection of command examples. Please exercise caution where mentioned.
# Docker
sudo apt-get update
sudo apt-get remove docker docker-engine docker.io
sudo apt install docker.io
sudo systemctl start docker
sudo systemctl enable docker
docker --version
@p3jitnath
p3jitnath / configure-ssh.sh
Last active May 15, 2020 21:24
Configure SSH
ssh-keygen
ssh-copy-id username@host
# OR
cat ~/.ssh/id_rsa.pub | ssh username@host "mkdir -p ~/.ssh && touch ~/.ssh/authorized_keys && chmod -R go= ~/.ssh && cat >> ~/.ssh/authorized_keys"
# Check your GitHub SSH
ssh -T [email protected]
@p3jitnath
p3jitnath / install-vscode.sh
Created May 15, 2020 21:17
Install VSCode in Ubuntu 20.04 LTS
sudo apt update
sudo apt install software-properties-common apt-transport-https wget
wget -q https://packages.microsoft.com/keys/microsoft.asc -O- | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main"
sudo apt install code