Skip to content

Instantly share code, notes, and snippets.

@Avinash-Raj
Avinash-Raj / tneb.py
Created January 17, 2017 04:20
Python selenium + phantomjs script to scrape tneb reading details
from selenium import webdriver
from selenium.webdriver.support.ui import Select
from PIL import Image
driver = webdriver.PhantomJS()
driver.set_window_size(1120, 550)
driver.get("http://tneb.tnebnet.org/newlt/menu3.html")
print '''\033[92m
1. Chennai North (Central & North EDC)
#!/usr/bin/env python
# Here is the python2 script to see StackOverflow 2015 election candidates who're going to the next phase along with their vote-counts.
# For this script to work, you must need to install Python's BeautifulSoup html parser.
# Created by Stack Overflow user Avinash Raj ( http://stackoverflow.com/users/3297613/avinash-raj )
from bs4 import BeautifulSoup
import urllib2
s = urllib2.urlopen('http://stackoverflow.com/election/6?tab=primary')
soup = BeautifulSoup(s)
@Avinash-Raj
Avinash-Raj / ndis-fix.sh
Last active September 12, 2016 05:20
Shell script to fix "Install NDIS driver failed" error while trying to install Huawei modem drivers on linux
#!/bin/bash
# Run the below script only after "Install NDIS driver failed" error while trying to install Huawei modem drivers on linux.
# I checked this script on Ubuntu.
# Detailed explanation of this script was given here(http://askubuntu.com/a/414401/202806).
path="/usr/local/Mobile_Partner/driver"
if [ "$(ls -A $path)" ]; then
tput setaf 6; echo "Huawei modem drivers for linux are already installed on your pc.Please wait for NDIS driver installation."; tput sgr0
perl -i -pe 's#^(\s*dbg \("can.t kmalloc dev"\);)#//$1#' /usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src/hw_cdc_driver.c
cd $path
@Avinash-Raj
Avinash-Raj / ppa-remove
Last active August 29, 2015 13:59
Shell script to remove all the 404 Not found PPA's automatically in Ubuntu
#!/bin/bash
#The below script will remove all the 404 Not Found PPA's automatically in Ubuntu
#Detailed execution of this script was posted here (http://askubuntu.com/a/432364/202806)
#This script takes some time according to your internet speed.
#Fell free to post the comments below.
if [ `whoami` != root ]; then
echo Please run this script using sudo
echo Just type “sudo !!”
exit