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
#!usr/bin/python | |
import urllib | |
from lxml import etree | |
import StringIO | |
url = "http://164.100.47.132/LssNew/Members/Alphabaticallist.aspx" | |
result = urllib.urlopen(url) | |
html = result.read() |
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
#!/usr/bin/python | |
# Copyright Sudheer Satyanarayana, http://techchorus.net | |
# All rights reserved. | |
# That anta heli problem | |
# a, b, c, d and r are given as input | |
# Solve the problem | |
# a x b y c z d = r | |
# find x, y and z where x, y and z is either +, -, * or / |
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
#!usr/bin/python | |
# Author - Sudheer Satyanarayana, http://techchorus.net | |
# Greatest common divisor using Euclid's algorithm | |
# Python 2.6 has Fractions module, see Fractions.gcd(a, b) | |
def gcd(m, n): | |
r = m % n | |
if r == 0: | |
return n |
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
#include <stdio.h> | |
#include <ctype.h> | |
/** | |
Author - Sudheer Satyanarayana, http://techchorus.net | |
All rights reserved | |
Solution for That Anta Heli problem | |
a, b, c, d and r are given as input |
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
#!/bin/bash | |
domains="aol\.com yahoo\.com gmail\.com hotmail\.com" | |
datepart=`date "+%b %d"` | |
for domain in $domains | |
do | |
echo $domain | |
egrep "${datepart}.*${domain}.*bounced" /var/log/maillog | wc -l | |
done |
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
#!/usr/bin/python | |
import urllib | |
import lxml | |
from lxml import etree | |
import StringIO | |
parser = etree.HTMLParser() | |
todays_paper_url = "http://www.indianexpress.com/supplement/" |
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
#!/usr/bin/evn python | |
from smtplib import SMTP | |
from email.MIMEText import MIMEText | |
try: | |
msg = MIMEText("body", "subject is this") | |
msg['Subject']= 'subject is this' | |
msg['From'] = '[email protected]' | |
conn = SMTP("mail.example.com") |
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
#!/usr/bin/awk -f | |
# Usage is | |
# ./apache-data-transfer-day-report.awk -v date=20/Oct/2011 /path/to/access/log | |
# Typically, you have an access log file for a domain | |
# This has been tested only on CentOS 6. | |
# Fork or ask for a feature or bug fix. | |
# | |
BEGIN { | |
datepart = date | |
printf ("\nData transfer for the domain for %s:\n", datepart); |
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
# Encrpyt the string 'abcdefghijklmnop' | |
from Crypto.Cipher import DES | |
from Crypto import Random | |
iv = Random.get_random_bytes(8) | |
des1 = DES.new('issecret', DES.MODE_CFB, iv) | |
text = 'abcdefghijklmnop' | |
cipher_text = des1.encrypt(text) | |
print cipher_text |
OlderNewer