Skip to content

Instantly share code, notes, and snippets.

View neerajvashistha's full-sized avatar
🏠
Working from home

Neeraj Vashistha neerajvashistha

🏠
Working from home
View GitHub Profile

sudo apt-get update sudo apt-get upgrade ubuntu-drivers devices sudo ubuntu-drivers autoinstall

@neerajvashistha
neerajvashistha / temp-indicator.py
Created November 22, 2019 00:23 — forked from atilberk/temp-indicator.py
An CPU/GPU temperature indicator in for Ubuntu
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# I am using this to monitor my cpu's temperature in the top bar of my os
# I have tested the script on Ubuntu 15.10 with Python 2.7.10
# Update: I used to require acpi but then found a simpler way
import sys,time,re,commands,os
from gi.repository import Gtk, GLib
@neerajvashistha
neerajvashistha / gbp-inr-indicator.py
Last active November 4, 2019 05:14 — forked from caiosba/dollar-reais-indicator.py
Ubuntu Unity Indicator to show current gbp value in indian rupee (auto-updates every minute)
#!/usr/bin/env python
# Unity indicator for dolar/real currency
# Author: Caio Almeida <caiosba@gmail.com>
# 05 Jul 2016
import gobject
import gtk
import appindicator
import os, sys
import time
@neerajvashistha
neerajvashistha / sp
Last active November 21, 2019 15:47 — forked from duncan-bayne/sp
sp is a command-line client for Spotify's dbus interface. Play, pause, skip and search tracks from the comfort of your command line.
#!/bin/bash
#
# This is sp, the command-line Spotify controller. It talks to a running
# instance of the Spotify Linux client over dbus, providing an interface not
# unlike mpc.
#
# Put differently, it allows you to control Spotify without leaving the comfort
# of your command line, and without a custom client or Premium subscription.
#
@neerajvashistha
neerajvashistha / waya-dl-setup.sh
Created May 15, 2019 06:28 — forked from mjdietzx/waya-dl-setup.sh
Install CUDA Toolkit v8.0 and cuDNN v6.0 on Ubuntu 16.04
#!/bin/bash
# install CUDA Toolkit v8.0
# instructions from https://developer.nvidia.com/cuda-downloads (linux -> x86_64 -> Ubuntu -> 16.04 -> deb (network))
CUDA_REPO_PKG="cuda-repo-ubuntu1604_8.0.61-1_amd64.deb"
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/${CUDA_REPO_PKG}
sudo dpkg -i ${CUDA_REPO_PKG}
sudo apt-get update
sudo apt-get -y install cuda
# Requirements
# certifi==2018.11.29
# chardet==3.0.4
# datefinder==0.6.1
# EasyProcess==0.2.5
# emoji==0.5.1
# idna==2.8
# nltk==3.4
# pendulum==2.0.4
# PySocks==1.6.8
import re
import datetime
import pendulum
import datefinder
def review_date_cal(sentence):
date_value = "NAN"
now = pendulum.now()
if 'ago' in sentence:
if 'day' in sentence:
value = " ".join(re.findall("[0-9]+", sentence))
import cv2
#reading the image
image = cv2.imread("000001.jpg")
edged = cv2.Canny(image, 10, 250)
#cv2.imshow("Edges", edged)
#cv2.waitKey(0)
#applying closing function
kernel = cv2.getStructuringElement(cv2.MORPH_RECT, (30, 30))
closed = cv2.morphologyEx(edged, cv2.MORPH_CLOSE, kernel)
import random
random.seed(1000)
keys = 'KUL_EAT'
old_list =['KUL_EAT_0','KUL_EAT_1','KUL_EAT_2','KUL_EAT_3','KUL_EAT_4','KUL_EAT_5','KUL_EAT_6','KUL_EAT_7','KUL_EAT_8','KUL_EAT_9','KUL_EAT_10','KUL_EAT_11','KUL_EAT_12','KUL_EAT_13','KUL_EAT_14','KUL_EAT_15', 'KUL_EAT_43']
pool = random.sample(range(50), 40)
def randomGenerator(keys,pool,old_list):
'''
entitiesWindows1252 = (
8364, # 0x80 0x20AC EURO SIGN
65533, # 0x81 UNDEFINED
8218, # 0x82 0x201A SINGLE LOW-9 QUOTATION MARK
402, # 0x83 0x0192 LATIN SMALL LETTER F WITH HOOK
8222, # 0x84 0x201E DOUBLE LOW-9 QUOTATION MARK
8230, # 0x85 0x2026 HORIZONTAL ELLIPSIS
8224, # 0x86 0x2020 DAGGER
8225, # 0x87 0x2021 DOUBLE DAGGER
710, # 0x88 0x02C6 MODIFIER LETTER CIRCUMFLEX ACCENT