Join us at IRC!
Capitalism is an Island of wealth in a sea of poverty
Friday, May 25, 2012
Navigation
Members Online
Total Online: 38
Web Spiders: 14
Guests Online: 38
Members Online: 0

Registered Members: 70209
Newest Member: KalareShou
Latest Articles
View Thread

HellBound Hackers | Computer General | Programming

Author

Python?

Ragamuffin
Member



Posts: 46
Location: South Wales
Joined: 23.08.07
Rank:
Elite
Posted on 25-02-11 23:30
Hey, i've got a friend thats trying to do her uni assignment with a bit of pythoon and i don't have a clue myself.

she wants to get this code to work but can't

>>> for line in open ('auth.txt'):
if 'oracle' in line:
print "lines : ", lines



she said shes trying to find out how many times people attempted to log into the oracle account and create a log of it.

Could anyone shed some light on this please?
she needs this done by tuesday

Thanks




ryanredemption@hotmail.co.uk Not Finished‭‮
Author

RE: Python?

stealth-
Member



Posts: 999
Location: Eh?
Joined: 10.04.09
Rank:
God
Posted on 25-02-11 23:36
Um, you need to be more specific with what you want the output to be. Do you want it to output the number of lines that include the word "oracle", or print out the lines that include the word "oracle"?

That code is a mess, she really needs to pay attention in class o.0


The irony of man's condition is that the deepest need is to be free of the anxiety of death and annihilation; but it is life itself which awakens it, and so we must shrink from being fully alive.
http://www.stealth-x.com
http://www.stealth-x.com
Author

RE: Python?

Ragamuffin
Member



Posts: 46
Location: South Wales
Joined: 23.08.07
Rank:
Elite
Posted on 25-02-11 23:43
Output the lines the include oracal, i belive.

That code is a mess, she really needs to pay attention in class o.0


And i could agree more lol but shes struggling with it
ryanredemption@hotmail.co.uk Not Finished‭‮
Author

RE: Python?

spyware
Member



Posts: 4190
Location: The Netherlands
Joined: 14.04.07
Rank:
God
Warn Level: 90
Posted on 25-02-11 23:44
Didn't HBH have a stance on stupid homework questions?




"The chowner of property." - Zeph
Widespread intellectual and moral docility may be convenient for leaders in the short term,
but it is suicidal for nations in the long term.
- Carl Sagan
“Since the grid is inescapable, what were the earlier lasers about? Does the corridor have a sense of humor?” - Ebert
http://bitsofspy.net
Author

RE: Python?

stealth-
Member



Posts: 999
Location: Eh?
Joined: 10.04.09
Rank:
God
Posted on 25-02-11 23:52
Ragamuffin wrote:
>>> for line in open ('auth.txt'):
if 'oracle' in line:
print "lines : ", lines



Okay, tell her to look at the last line of her code.
"lines" is not a variable.....


The irony of man's condition is that the deepest need is to be free of the anxiety of death and annihilation; but it is life itself which awakens it, and so we must shrink from being fully alive.
http://www.stealth-x.com
http://www.stealth-x.com
Author

RE: Python?

Arabian
Member



Posts: 322
Location: inside you.
Joined: 22.09.10
Rank:
God
Posted on 26-02-11 02:43
>>> for line in open ('auth.txt' ):
if 'oracle' in line:
print "lines : ", lines


Is she retarded? If her aim is to print out a value every time a user signs into an Oracle account,

A ) there is no account provided to scan for input.
B ) She's attempting to scan and print out how many times 'oracle' occurs in 'auth.txt'.

Either you heard what she wanted to do wrong, or she's so far off that I don't even wanna help.


Hare Lambda!



Edited by Arabian on 26-02-11 02:44
Author

RE: Python?

ynori7
Future Emperor of Earth



Posts: 1481
Location: #valhalla
Joined: 08.10.07
Rank:
Diabolical
Posted on 26-02-11 05:02
Ragamuffin wrote:
she said shes trying to find out how many times people attempted to log into the oracle account and create a log of it.

You can do this from oracle:

select USER_NAME||’ - ‘||MESSAGE||’ - ‘||to_char(LOG_DATE,’dd.mm.yyyy hh24:mi:ss’)||’ - ‘||IP_ADDRESS “Login Failures”
from ORASSO.WWSSO_AUDIT_LOG_TABLE$
where log_date > (sysdate - 7)
and MESSAGE = ‘Login failed’
order by log_date;


You may have to tell the database to audit login attempts. Just google "oracle audit failed login attempts" and you'll find explanations.




ynori7 http://halls-of-valhalla.org
Guest
Username

Password

Remember Me


Bookmark This Page
Affiliates
Adverts

 

 

Links
By using, viewing or obtaining any information contained on this site, you agree to the disclaimer.

© HellBound Hackers 2008- 2009. Since 3rd December 2004.