Skip to content

Instantly share code, notes, and snippets.

View mshub's full-sized avatar

Mohit Sharma mshub

View GitHub Profile
@mshub
mshub / dashboard.py
Created June 6, 2014 15:50
Android M-Dashboard
from Tkinter import *
import os, time, tkMessageBox, os
import getpass, thread, threading #import subprocess #ttk #from multiprocessing import Process
root = Tk()
root.title("Android M-Dashboard")
frame = Frame(root)
frame.pack()
#!/bin/bash
# Revision History:
# AUTHOR: Mail_ID Date Comment
# MOHIT SHARMA <mohits@nvidia.com> 25th Jan 2014 <Santiy window operations stressed out>
#
# FILE:
# (C) NVIDIA Corp
#
# Target use:
## Acer
SUBSYSTEM=="usb", ATTR{idVendor}=="0502", MODE="0600", OWNER="<username>"
## ASUS
SUBSYSTEM=="usb", ATTR{idVendor}=="0b05", MODE="0600", OWNER="<username>"
## Dell
SUBSYSTEM=="usb", ATTR{idVendor}=="413c", MODE="0600", OWNER="<username>"
## Foxconn
#!/bin/bash
GNOME_USER=$(ps -ef | grep "gnome-session --session=" | head -1 | cut -d " " -f 1)
read W1 W2 T <<< `curl -s http://www.accuweather.com/en/in/pune/204848/weather-forecast/204848 | html2text \
| grep -ie "currently" -A 1 | tail -1 | awk '{gsub(/^ +| +$|[[:cntrl:]]/,"" )}1' | cut -d " " --fields=1,2,3`
AMPMTIME=$(date +"%p"); HOURTIME=$(date +"%H")
# if [ $AMPMTIME = "PM" -a $HOURTIME -gt "8" -o $AMPMTIME = "AM" -a $HOURTIME -lt "5" ]; then
# ICONFOLDER='/usr/share/pixmaps/WeatherIcons/Night'
@mshub
mshub / mindicator
Last active December 28, 2015 21:49
#!/bin/python
# Author: Mohit Sharma <mohiter4@gmail.com>
# "mindicator" - application indicator for Ubuntu desktop
from gi.repository import AppIndicator3 as appindicator, Gtk, GObject
import os
# VTC and ARB link setup
userFullName = os.popen("cat /etc/passwd | grep -ie `ps -ef | grep gnome-session | head -1 | cut -d \" \" -f 1` | cut -d: -f5 | sed -e 's/,//g'").read().strip()
FIRST, SECOND = userFullName.split()
#!/bin/bash
GNOME_USER=$(ps -ef | grep "gnome-session --session=" | head -1 | cut -d " " -f 1)
ping -c 1 -q google.com > /dev/null 2>&1
if [ "$(echo $?)" -ne "0" ]; then
exit 0
fi
MYCRICKETTEAM="IND"
@mshub
mshub / mupdates
Created November 20, 2013 17:09
Mupdates
#!/bin/bash
# AUTHOR: Mohit Sharma <mohiter4@gmail.com>
# File: Display custom updates easily
# (C) Copyleft: Modify and spread
# Commented out set -e, enabling script to execute even if one of the data fetching fails
#set -e
ping -c 1 -q google.com > /dev/null 2>&1
@mshub
mshub / ubuntu_ready
Last active December 28, 2015 21:49
Setup for new Ubuntu installation
#!/bin/bash
export YELL_COLOR='\E[33m' # Yellow text
export FINE_COLOR='\E[32m' # Green text
export NORM_COLOR='\E[0m' # Normalize text
export BLUE_BACK='\E[44m' # Blue back
export CYAN_BACK='\E[45m' # Cyan back
[ `whoami` != root ] && echo Error: Run this script $0 as a root user && exit 1