This page is created in Python and gets data from my Gists

#!/usr/bin/python
import urllib

def get_page(url):
	if(url):
 	       return urllib.urlopen(url).read()
	else:
		return ''

def get_next_url(page):
	pre_link = page.find('<a href=')
	if pre_link == -1:
		return None,0
	pre_quote = page.find('"',pre_link)
	post_quote = page.find('"', pre_quote+1)
	url = page[pre_quote+1:post_quote]
	return url, post_quote

def print_all_pages(page):
	while True:
		url, endpos = get_next_url(page)
		if url:
			if url.find('http') == 0:
				print url
			page = page[endpos:]
		else:
			break
      
print_all_pages(get_page('http://xkcd.com/353')) #Dynamically pass a page here 
#! /usr/bin/python

import urllib, json

URL = "https://api.github.com/users/rathankalluri/gists" #https://api.github.com/users//gists
response = urllib.urlopen(URL)
data = json.loads(response.read())

for i in range(0,len(data)):
	filename = data[i]['files'].values()[0]['filename']
	
	gisturl = 'https://api.github.com/gists/'+data[i]['id']
	gistdata = json.loads(urllib.urlopen(gisturl).read())
	description =  gistdata['description']
	content =  gistdata['files'][filename]['content']
	print(description)
	print(content)
	print('\n')
#!/bin/sh
#function for my use
makedir()
{      echo -e "Listing all Directories and Files Present Under Home \n========================================"|cat >cr_file_for_test.txt  
	echo -e "\nDirectories\n--------------"|cat >>cr_file_for_test.txt     
	find /home -type d |cat >>cr_file_for_test.txt # I need only the directories in home so 'find @ home only of type d'
	echo -e "\nFiles\n--------"|cat >>cr_file_for_test.txt     
	find /home -type f |cat >>cr_file_for_test.txt 
      echo "File cr_file_for_test.txt created"
             }
# A program to find the directory and create a file in it
 #start
     clear
     echo "Enter the directory name "
     read dname
 #check for a directory
    if [ -d $dname ]
    then
 #if exist
      echo "Directory Found"
      cd $dname
      if [ -e cr_file_for_test.txt ] #if file exists I am removing it 
      then
      rm cr_file_for_test.txt  
      fi      
      echo -n "Creating File "cr_file_for_test.txt" "
      for i in 1 2 3 #for making the user feel that I am actually working !!! :P
      do 
      sleep 1
      echo -n "." 
      done
      makedir #calling function to create file
      exit 0  
   else  
 #if do not exist
      echo "Directory doesn't exist.Want to create one?(y/n)"
      read y
 #Creating a Directory
      if [ $y = 'y' ]
       then
       mkdir $dname
       cd $dname        
       makedir #calling function to create file
       fi
     fi
     exit 0
 #stop
 #! /bin/bash
# This is my very first program in IT industry :D
#This programme is for creating qr codes for the data in the database and storing those codes back into the database.
#Functions used are in the beggining
#
#====================START OF dirfun()..(creates directory)================
#
dirfun()
{ cd /home/rathankalluri/Rathan/
 if [ -d qrcodes ]
  then
  echo "Directory Exists"
  else
  mkdir qrcodes 
  chmod 777 qrcodes
  echo "Dir created "
 fi
}
#
#====================END OF dirfun()==================
#
#=================START OF name_qr_creator()..creates qr codes and its file names==========
#
name_qr_creator()
{
mysql < cat >tempfil
use mysql;
select eno,ename from employee;
EOF
no_ln=$(wc -l tempfil|awk '{ print $1 }')
#"echo The number of lines are $no_ln" This is for testing purpose
count=1
while [ "$count" -le "$no_ln" ] && read line 
do
if [ $count = 1 ]
then
#"echo count is $count"   This is for testing purpose
count=2
else 
#"echo The line is :: $line " This for testing purpose
rawdat=`sed -n "$count"p tempfil`
fnm=`echo $rawdat| sed -e 's/ /_/g'`
#"echo The fil name is $fnm" This is for testing purpose
touch "$fnm".png
chmod 777 $fnm.png
#"echo "The file is @ `pwd`"" For Testing
$(qrencode "$line" -o "$fnm".png)
stat=yes
paths=(`pwd`"/$fnm.png")
#"echo $paths" For Testing 
lp=1
for word in $rawdat
do
if [ $lp = 1 ]
then
e_no=$word
lp=2
fi
done
#"echo $e_no"  For Testing 
mysql -D mysql < cat >Details
use mysql ;
select * from employee ;
M
#"cat Details"  #For Testing the output from Database
echo -e "Initializing the Creation process \n" 
echo -e "Reading row by row details \n" #line to be removed later
echo "Trying to create a directory"
dirfun
cd /home/rathankalluri/Rathan/qrcodes
echo -e "Qr code generator started \n"
   name_qr_creator #Calling QR code creator
echo "Done"
echo -e "removing temporary files \n"
rm -rf /home/rathankalluri/Documents/cat
rm -rf /home/rathankalluri/Documents/Details
echo -e "Killing Connections... please wait \n"
 /etc/init.d/mysqld stop
echo -e "Program Termination Complete !!!!"
exit 0
#
#======================== END OF MAIN PROGRAM ===============================
#
import turtle
""" Draw a flower in Pyhton"""

def draw_square(square):
	for i in range(0,2):
		square.forward(100)
		square.right(30)
		square.forward(100)
		square.right(150)


def draw_flower():
	window = turtle.Screen()
	window.bgcolor("blue")

	pen = turtle.Turtle()
	pen.shape("triangle")
	pen.color("#99FF00")

	for i in range(0,36):
		draw_square(pen)
		pen.right(10)

	for i in range(0,4):
		pen.circle(50)
		pen.right(90)
	pen.right(90)
	pen.forward(300)
	pen.right(90)
	draw_square(pen)
	pen.left(180)
	draw_square(pen)
	pen.left(270)
	pen.forward(200)

	window.exitonclick()

draw_flower()
#!/usr/bin/python

""" The program prints when your age will be hundred """

from datetime import datetime

def year_when_hundred(current_year, age):
	year = current_year.year + (100 - age)
	return year

user_name = raw_input("Your Name: \n")
user_age = int(input("Your Age: \n"))

current_year = datetime.now()

year_at_hundered = year_when_hundred(current_year, user_age)
print(user_name + "!! You will be hundred in "+str(year_at_hundered))

RathanKalluri.com - Copyright 2016