Skip to content

Instantly share code, notes, and snippets.

View arulrajnet's full-sized avatar

Arul arulrajnet

View GitHub Profile
@arulrajnet
arulrajnet / colors.py
Last active January 2, 2023 04:45 — forked from jossef/colors.py
python coloring for linux, based on this answer http://stackoverflow.com/a/26445590/3191896 and modified to make it more usable in a pythonic way.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
class Color(object):
"""
reference from https://gist.github.com/Jossef/0ee20314577925b4027f and modified bit.
"""
def __init__(self, text, **user_styles):
@arulrajnet
arulrajnet / download_java.py
Last active June 18, 2019 19:23 — forked from LordH3lmchen/download_latest_java.py
Download Oracle Java JDK / JRE from the terminal in an interactive manner. Useful when you want to download java in non-gui environment.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from urllib.request import Request, urlopen
except ImportError: # python 2
from urllib2 import Request, urlopen
import re
import os
@arulrajnet
arulrajnet / tor_ip_renew.py
Created May 3, 2015 10:32
TOR ip renew script using pytorctl https://github.com/aaronsw/pytorctl which is a python based module to interact with the Tor Controller.
from TorCtl import TorCtl
import urllib2
user_agent = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.7) Gecko/2009021910 Firefox/3.0.7'
headers={'User-Agent':user_agent}
def request(url):
def _set_urlproxy():
proxy_support = urllib2.ProxyHandler({"http" : "127.0.0.1:8118"})
opener = urllib2.build_opener(proxy_support)
@arulrajnet
arulrajnet / stockmarketindia.py
Last active December 29, 2022 17:56
Get the latest Index from BSE and NSE stock market. Python script using google finance open API http://finance.google.com/finance/info?client=ig&q=INDEXBOM:SENSEX
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from collections import namedtuple
import json
try:
from urllib.request import Request, urlopen
except ImportError: # python 2
from urllib2 import Request, urlopen
@arulrajnet
arulrajnet / WhoHasLatestNav.py
Created May 1, 2015 10:22
Have curiosity to know how www.valueresearchonline.com updated their NAV value of a fund once the Market closed on 4:10PM every day. So I wrote a script to check the NAV value in Value Research, AMFI and Morningstar for a particular fund. Here that script...
# -*- coding: utf-8 -*-
__author__ = 'arul'
import requests, sys
from lxml import html
from bs4 import BeautifulSoup
vrs_value = "NA"
amfi_value = "NA"
@arulrajnet
arulrajnet / livecricketscore.sh
Last active January 29, 2020 04:32
Shell script to get a Live cricket score from www.espncricinfo.com. Just run this shellscript then select your match. when ever you want to know score open that terminal and see. Just simple as Dhoni's helicopter shot :D
#/bin/bash
# Shell script to get a Live cricket score from www.espncricinfo.com
# To help Cricket fan DevOPS see the score on his Terminal.
# Thanks to ESPN SPORTS MEDIA LTD for their RSS feed.
#
# Author : Arul <mailto:me@arulraj.net>
function get_html() {
local html=$(curl -k -L -s $1)
echo "$html"
@arulrajnet
arulrajnet / tweets_dumper.py
Created January 4, 2015 18:08
Dump all tweets as CSV of given twitter handle using #Tweepy https://github.com/tweepy/tweepy
# -*- coding: utf-8 -*-
import tweepy # https://github.com/tweepy/tweepy
import json
import csv
import sys
# Twitter API credentials
consumer_key = "your_consumer_key"
consumer_secret = "your_consumer_secret"
@arulrajnet
arulrajnet / MXEmailVerifier.py
Last active May 25, 2023 14:23
Verify the given mail id is valid or not, without sending mail. Verifying the email id directly from mail exchange server.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Verify the given mail id is valid or not without sending mail. Verifying the email id directly from mail exchange server.
"""
import argparse
import smtplib
import dns.resolver
@arulrajnet
arulrajnet / ChromeAppDownloader.py
Last active February 15, 2024 01:06
Python Script to download the Chrome Extensions (CRX) file directly from the google chrome web store.
# -*- coding: utf-8 -*-
"""
Python Script to download the Chrome Extensions (CRX) file directly from the google chrome web store.
Referred from http://chrome-extension-downloader.com/how-does-it-work.php
"""
from __future__ import division
import argparse
import requests
@arulrajnet
arulrajnet / EmailVerifier.py
Last active October 2, 2018 02:28
Its to verify email address whether is real or not. Getting the information from http://verify-email.org/. They allow you 5 search per hour based on your IP. So Use proxy network or rotating your IP using TOR.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'arul'
"""
program to verify email address from http://verify-email.org/
"""
import requests