Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Neeraj Vashistha neerajvashistha

🏠
Working from home
View GitHub Profile
View Emoji Python
# Taken from https://github.com/leandrotoledo/python-telegram-bot/blob/master/telegram/emoji.py
"""This module contains a object that represents an Emoji"""
class Emoji(object):
"""This object represents an Emoji."""
GRINNING_FACE_WITH_SMILING_EYES = b'\xF0\x9F\x98\x81'
FACE_WITH_TEARS_OF_JOY = b'\xF0\x9F\x98\x82'
@neerajvashistha
neerajvashistha / gupload.sh
Created May 6, 2020
Google Drive upload facility
View gupload.sh
#!/bin/bash
# https://github.com/mbrother2/butgg
# curl -o butgg.bash https://raw.githubusercontent.com/mbrother2/butgg/master/butgg.bash
# bash butgg.bash --setup
# Google API client_id: 10xxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com
# Google API client_secret: rxxxxxxxxxxxxxxxxxxxxxxxxl
DatasetsID='1CIsxxxxxxxxxxxxxxxxeswHISm'
DocumentsID='1pA2kxxxxxxxxxxxxxxxxxesjYfXzv7YK'
ModelsID='1E7nJkmxxxxxxxxxxxxxxxxxxxxxxxSo8F3vsqc-'
@neerajvashistha
neerajvashistha / motion.md
Last active Apr 25, 2020 — forked from endolith/readme.md
How to stream a webcam to a web browser in Ubuntu
View motion.md

Grr this took hours to figure out. I was trying to install MJPG-streamer and running VLC command lines and all this crap but nothing worked.

First install motion:

~> sudo apt-get install motion

Then create a config file:

~> mkdir ~/.motion
~> nano ~/.motion/motion.conf
@neerajvashistha
neerajvashistha / custom-juno.sh
Created Mar 28, 2020 — forked from evertontrindade/custom-juno.sh
Things to do after install Elementary OS 5.0 Juno
View custom-juno.sh
cd ~/Downloads
sudo apt-get update && sudo apt-get upgrade
#####################################################################
# Clean-up System
#####################################################################
sudo apt-get purge epiphany-browser epiphany-browser-data
sudo apt-get purge noise
sudo apt-get purge scratch-text-editor
View Module Creation.txt
#https://www.osc.edu/resources/getting_started/howto/howto_locally_installing_software
mkdir -p $HOME/local/src $HOME/local/share/lmodfiles
cd $HOME/local/src
wget https://github.com/git/git/archive/v2.9.0.tar.gz
tar zxvf v2.9.0.tar.gz
cd git-2.9.0
View openpose_installation.txt
git clone https://github.com/CMU-Perceptual-Computing-Lab/openpose
sudo apt purge cmake-qt-gui
sudo apt-get install qtbase5-dev libssl-dev
tar xvzf Downloads/cmake-3.17.0-rc2.tar.gz
cd cmake-3.17.0-rc2.tar.gz
./configure --qt-gui
./bootstrap && make -j`nproc` && sudo make install -j`nproc`
View overcharging-notify.sh
#!/bin/sh
max=90
while true
do
battery_percentage=`acpi -b | egrep 'Charging|Full'|grep -v 'Discharging' | grep -P -o '[0-9]+(?=%)'`;
if [ "$battery_percentage" -gt "$max" ]
then
echo $battery_percentage
notify-send 'Laptop Battery Charged' "Please Disconnect Laptop Battery is charged"
View Installation.md

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

@neerajvashistha
neerajvashistha / temp-indicator.py
Created Nov 22, 2019 — forked from atilberk/temp-indicator.py
An CPU/GPU temperature indicator in for Ubuntu
View temp-indicator.py
#!/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 Nov 4, 2019 — forked from caiosba/dollar-reais-indicator.py
Ubuntu Unity Indicator to show current gbp value in indian rupee (auto-updates every minute)
View gbp-inr-indicator.py
#!/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
You can’t perform that action at this time.