Skip to content

Instantly share code, notes, and snippets.

View AnmolTomer's full-sized avatar
💻
Learning

Anmol Tomer AnmolTomer

💻
Learning
View GitHub Profile
@AnmolTomer
AnmolTomer / ubuntu_setup.md
Last active September 16, 2020 16:39
Ubuntu 18.04 LTS getting started, things to install guide - Updated April 2020
  1. Installing NVIDIA Drivers ❗❗
ubuntu-drivers devices
sudo ubuntu-drivers autoinstall
  1. From last command see nvidia-driver-number and use it in the command below and then reboot 📺 ✔️
@AnmolTomer
AnmolTomer / sync_fork_with_parent.md
Last active May 17, 2022 13:39
GIT : Syncing a Fork with Parent

Syncing a Fork with Parent

Configuring a remote for a fork

You must configure a remote that points to the upstream repository in Git to sync changes you make in a fork with the original repository. This also allows you to sync changes made in the original repository with the fork.

  1. List the current configured remote repository for your fork.

    $ git remote -v
    > origin  https://github.com/YOUR_USERNAME/YOUR_FORK.git (fetch)

How to Install Yarn on Ubuntu 18.04 - HOSTINGER

Yarn is a dependency manager for javascript that competes with NPM of Node.js.

What is Yarn?

Yarn is a Javascript dependency manager created by Facebook, Google, Exponent, and Tilde. The main features that make Yarn very popular are the speed with which it processes dependencies, its security, and flexibility.

Yarn’s speed is thanks to the efficient use of the cache that removed the need to download libraries repeatedly. Meanwhile, checksum verifies the integrity of the libraries to ensure Yarn is very secure, leading to reliability.

VSCode Extensions and Shortcuts

Ctrl+K+S = Open Shortcuts
Ctrl+K+F = Select text and use this to Prettify
Ctrl+K+T = Get theme selection prompt
Ctrl+, = User Settings
Shift+Alt+F = Format/ Prettier

#vid_2_frame
import cv2
import os
# <editor-fold defaultstate="collapsed" desc="function: break_into_frames">
def break_into_frames(src_path, dst_path, video_count):
vid = cv2.VideoCapture(src_path)
img_path = dst_path + "\\" + str(video_count) + "_"
count = 0
import os
path = "/home/cosmic/Desktop/Sem-3/Events/Technocrats/Rover/vid_2/video_wise_frames/Done/img_folder_1_annotated/"
files = os.listdir(path)
for file in files:
if('.jpg' in file[-4:]):
filename = file[:-4]
txtFile = filename + '.txt'
if not (txtFile in files):
# print()
import os
path = input("Enter source path:")
images = os.listdir(path)
print(images)
for f in images:
if(".jpg" in f[-4:]):
src = path
if(f[0]=="0"):
dst = src + '/8' + f[1:]
@AnmolTomer
AnmolTomer / speedtest_cli.md
Last active November 2, 2019 11:09
fast.com or Ookla speedtest on CLI - nice and easy :-)

Ubuntu

export INSTALL_KEY=379CE192D401AB61
# Ubuntu versions supported: xenial, bionic
# Debian versions supported: jessie, stretch, buster
export DEB_DISTRO=$(lsb_release -sc)
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys $INSTALL_KEY
echo "deb https://ookla.bintray.com/debian ${DEB_DISTRO} main" | sudo tee  /etc/apt/sources.list.d/speedtest.list
sudo apt-get update