This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
from datetime import datetime, timedelta | |
import re | |
from io import BytesIO | |
import subprocess | |
import base64 | |
import imaplib | |
import email |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
from openpyxl import load_workbook | |
index = ['Name', 'Given Name', 'Additional Name', 'Family Name', 'Yomi Name', 'Given Name Yomi', 'Additional Name Yomi', 'Family Name Yomi', 'Name Prefix', 'Name Suffix', 'Initials', 'Nickname', 'Short Name', 'Maiden Name', 'Birthday', 'Gender', 'Location', 'Billing Information', 'Directory Server', 'Mileage', 'Occupation', 'Hobby', 'Sensitivity', 'Priority', 'Subject', 'Notes', 'Group Membership', 'E-mail 1 - Type', 'E-mail 1 - Value', 'E-mail 2 - Type', 'E-mail 2 - Value', 'Phone 1 - Type', 'Phone 1 - Value', 'Phone 2 - Type', 'Phone 2 - Value', 'Phone 3 - Type', 'Phone 3 - Value', 'Phone 4 - Type', 'Phone 4 - Value', 'Phone 5 - Type', 'Phone 5 - Value', 'Phone 6 - Type', 'Phone 6 - Value', 'Phone 7 - Type', 'Phone 7 - Value', 'Address 1 - Type', 'Address 1 - Formatted', 'Address 1 - Street', 'Address 1 - City', 'Address 1 - PO Box', 'Address 1 - Region', 'Address 1 - Postal Code', 'Address 1 - Country', 'Address 1 - Extended Address', 'Organization 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import datetime | |
import scrapy | |
from scrapy.spiders import CrawlSpider, Rule | |
from scrapy.linkextractors import LinkExtractor | |
class FBOSpider(scrapy.Spider): | |
name = "FBOSpider" | |
start_url = "https://www.fbo.gov/index?s=opportunity&mode=list&tab=list&pageID={page_no}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from googlefinance import getQuotes | |
import winsound | |
import time | |
import math | |
import argparse | |
parser = argparse.ArgumentParser() | |
parser.add_argument("stock", help="A google supported stock name. Example, NASDAQ:AAPL", type=str) | |
parser.add_argument("support", help="beep when below this price", type=float) | |
args = parser.parse_args() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#You'll still have to manually enter dates here, as the xlsx file from zerodha does not show dates(SIP of stocks causes multiple dates) | |
#EDIT: Usage python zerodha_to_moneycontrol.py <FILENAME> | |
import sys | |
from openpyxl import load_workbook | |
wb = load_workbook(sys.argv[1]) | |
ws = wb.active | |
csv_list = [["BSE/NSE/ISIN Code","Buy Date","Buy Quantity","Buy Price",]] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tweepy | |
auth = tweepy.auth.OAuthHandler( | |
consumer_key="key", | |
consumer_secret="secret") | |
auth.set_access_token( | |
'token', | |
'secret') | |
api=tweepy.API(auth_handler=auth) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
for /f "tokens=2,3 delims={,}" %%a in ('"WMIC NICConfig where IPEnabled="True" get DefaultIPGateway /value | find "I" "') do set gateway=%%~a | |
IF %gateway%==192.168.1.1 ( | |
netsh interface ip set address name="Wi-Fi" static 192.168.1.10 255.255.255.0 192.168.1.41 1 | |
) ELSE ( | |
netsh interface ip set address name="Wi-Fi" static 192.168.1.10 255.255.255.0 192.168.1.1 1 | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.*; | |
import javax.imageio.*; | |
import java.awt.image.*; | |
import java.util.*; | |
import java.awt.Color; | |
class Operator | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
repeat=10 | |
while [ $x -gt 0 ] | |
do | |
python "C:\\Python27\\lib\\timeit.py" -n 3 "f = open('file.txt', 'wb+'); f.write('chunk'); f.close()" >> results.txt | |
repeat=$((repeat-1)) | |
done | |
data="$(awk '{print $6}' results.txt)" | |
echo $data | |
python -c "results = map(float, \"\"\"$data\"\"\".split('\n')); from matplotlib import pyplot; pyplot.plot(range(1,11), results); pyplot.savefig('results.png')" | |
rm results.txt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#replace th0 with interface name and the 1st ip with nic ip and 2nd ip with proxy ip | |
ip="$(ifconfig eth0|grep 'inet addr'|awk -F':' '{print $2}'| awk -F' ' '{print $1}')" | |
if [[ $ip = "172.24.0.2" ]] | |
then | |
export http_proxy="http://172.24.0.1:3128" | |
fi |
NewerOlder