Posts

Showing posts with the label python

Python Speech recognition for Mac OS X

Hi Folks, I have been been searching for the    Python Speech recognition package especially for Mac OS.  I am not happy with the search results. Finally I got  https://pypi.python.org/pypi/SpeechRecognition/ (SpeechRecognition works only for the Linux distributions and Windows.) But I made it working for the Mac OS X by using flac.  Following are the instructions to make it run and modified code,  Prerequisite: Install Xcode in Unix Development mode Install Xcode - Command Line tools (Type ' xcode-select —install' in the terminal ) Install Port or Brew ( port    [or]   Brew   ) sudo brew install portaudio  [or]  sudo port install portaudio (for loading mic drivers) sudo pip install pyaudio [or] sudo easy_install install pyaudio (Mic Sources) sudo pip install SpeechRecognition [or] sudo easy_install install SpeechRecognition sudo port install flac Once you have finished with install, these are  mdfind flac | grep -i 'bin&#

Simple Automation using Python - Atomac in Mac OS X

Image
The Product Automation in MAC OS X is quite easy if we have enough knowledge in the following languages and tools  Bash Scripts  Apple Scripts  Python especially ATOMac Knowledge in Accessibility. For more understanding of the LDTP: http://download.freedesktop.org/ldtp/doc/ldtp-tutorial.pdf LDTP - Tutorial is written by  Nagappan Alagappan. He has given the clear idea and architecture of the LDTP and its working. I have used the contents from the tutorial for knowledge sharing. Following are the few information and contents from  the LDTP - Tutorial. Few interesting key points, Linux Desktop Testing Project (LDTP) i s aimed at producing high quality test automation framework and cutting-edge tools that can be used to test GNU/Linux Desktop and improve it.  It uses the Accessibility libraries to poke through the application's user interface.  This idea has been extended to Microsoft Windows as Cobra , Mac OS X as ATOMac .  LDTP is now known to wo

Using text to speech using Terminal + Python in Mac OS X

This post helps you to use 'say' command in python using 'say' command in python __author__ = 'vijay' # Run in Mac OS X import os import time lyrics1 = " we were meant to be" \ "like a destiny" \ "can you fill it our baby baby " \ "When you next to me " \ "I can never see " \ "anyone else but you baby " lyrics2 = " coz gonna believe that" \ "you sat them next to me " \ "yesterday I was facebook talking you" \ "now u sitting face to face with me" \ "simple close i just dont what to do" lyrics3 = " if you if you come to me baby i swear am gonna make you happy no no dont" \ " you worry you know that am ready ready You are you are my ice cream lady " \ "chocolate venila strawberry baby " \ &quo

ip_classifier.py for ipv32

Written simple program to find the class for an ip address of 32bit version #!/usr/bin/python import sys, getopt def __help(): sys.stderr.write('\n Usage: \n ip_classifier.py -h \n ip_classifier.py --help \n ip_classifier.py -i 128.12.14.23 \n ip_classifier.py --ipv4=128.12.14.23 \n ') sys.exit() def __input_validator(check): if len(check) <> 0: check = list(check) c = 0; n = 0 for v in check: if v in ['.','1','2','3','4','5','6','7','8','9','0']: n += 1 test = True if v is '.': c += 1 else: test = False break if test and c < 4 and n > 6: return check else: sys.stderr.write('**** Enter correct ip address **** \n') __help() def __validator(ip): if ip in range(0,256): return True else: sys.stderr.write('**** Enter correct ip address **** \n') __help() def __class_finder(ip, class_ip, bin_

Nullcon HackIM 2014 - Programming 100 Writeup

''' Well I am a beginner. netcat 23.23.190.204 2002 Welcome Enter 20 spam words to authenticate yourself. 01/20: spam 02/20: maps 03/20: hot Authenticate failed. hot(125) is not a palprime. (Hint) Tried with different test cases and found the value for each alphabet. Since in the challenge only lower-case should be used (condition). so I written a big program ( Once again I am a beginner, to find the palprime words available in dictionary. For the words list I downloaded the dataset from infochimps.com Thank you !!! ''' #!/usr/bin/python import string import sys,math import random my_dict ={} a =1 s = 361 t = 762 - s - a n = 196 b = 405 - a -t c = 410 - a - t d =213 - a - n e = 426 - a -t f = 437 -a -t g = 306 - 1 -256 i = 442 - s h = 506 - i - s j = 525 - e -t k = 627 -i -t -e l = 738 -i -g -h -t p = 256 m = 169 o = 274 - g u = 833 - 2*n q = 1211 - u -i -t r = 918 -i -g -h -t v = 885 -a -t w = 651 -i -d -e x = 962 -e -s y = 1587 -e -s -x z = 103

Baby Step Giant Step Algorithm Python Code

#Baby Step Giant Step DLP problem y = a**x mod n #Example 70 = 2**x mod 131 y = 70 a = 2 n = 131 s = floor(sqrt(n)) A = [] B = [] for r in range(0,s): value = y*(a^r) % n A.append(value) for t in range(1,s+1): value = a^(t*s) % n B.append(value) print A print B x1,x2 =0,0 for r in A: for t in B: if r == t: x1 = A.index(r) x2 = B.index(t) print x1,x2 break print 'the value of x is ', ((x2+1)*s - x1) % n # Answer

rivest-shamir-adleman-250 writeup (Zeromutarts.de 2013)

## using SAGE RSA n = 80646413 p = floor(sqrt(80646413)) ### Finding Factor p*q = n while(true): if (n%p == 0): print p break p=p+1 q = n / p print q #### phi(n) n1 = (p-1) * (q-1) print n1 e =5 d = e^-1 % n1 print d ### got private key ###Fast Exponentiation Algorithms def expo(c,d,n): if (d==1): return c%n if (d==2): return c*c % n if (d%2==0): return expo(expo(c,d/2,n),2,n) else: return c*expo(expo(c,(d-1)/2,n),2,n) cipher = [72895864,15633602,38820479,60303684,7458706,60299530,20682371,54642689,26066811,32615038,35349196,76400140,38820479,56463813,80491201,76400140,35349196,69567074,26066811,76400140,74270178,76127647,76127647,15633602,76400140,60303684,38820479,56463813,60303684,76400140,72844764,76127647,69302434,15633602,80491201,76400140,6809712,26066811,76400140,42498798,60299530,76127647,69302434,80491201,33234011] flag = '' for c in cipher: flag = flag+ chr(ex