- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Help me with this shell script pls..
Operating System - Linux
1753831
Members
9468
Online
108806
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-27-2007 11:22 PM
тАО08-27-2007 11:22 PM
Re: Help me with this shell script pls..
Stuart wrote> Putting into memory is the mistake you're making. You're just after output.
No and No. The per script does not put it into memory either. I was just after proving that it can not be done with reasonable resources.
>> I've got one here that's about 40 lines long that (just mucking around) is brute-forcing a 32 character password.
Why would you try that if you know there does not exist storage in the world to hold the results (5e49 bytes... a 5 with 49 zeroes behind it)?
Karthik> Its just that sum 1 had told we can do this via shell script or perl script .
NOT with the specification you provided.
>> Can u guys post the code of what u tried.
Perl script above
Just change
>> for (' ', 'a'..'c', '0'..'2') {
:
>> if (($j && $x++ < $count) || $x++ < 3 ) {
To
>>>> for (' ', 'a'..'z', '0'..'9') {
:
>>>> if (($j && $x++ < $count) || $x++ < 26 ) {
If you want to go to 9999...9 the change last to:
>>>> if ($x++ < $count) {
Bash script was already posted below your reply above this one.
> I had been tryin this since days.
Ouch!
> Is there any logic for this Problem-
I just use a simple counting technique for a radix-N number.
You know 1 + 1 = 2...
9 + 1 = 0 and increment the next cell.
'a' + 1 = 'b'
'z' + 1 = ' ' and increment the next cell.
Instead of outputting each cell directly, i look up the 'picture' in a table.
One could also count in pictures of course.
On an HP BL860c, with just 7 output chars, the perl script generates the 960801 words in 9.3 seconds.
I killed the shell script after 11:31.6 minutes ( user 7:07.3, sys 1:50.2) just before it was done :-(.
I should have trusted my ball park duration guestimate of 10 minutes better, allowing for a little more.
$ wc -lc *.tmp
931315 7290395 bash.tmp
960801 8647214 perl.tmp
Hope this helps some,
Hein van den Heuvel (at gmail dot com)
HvdH Performance Consulting
No and No. The per script does not put it into memory either. I was just after proving that it can not be done with reasonable resources.
>> I've got one here that's about 40 lines long that (just mucking around) is brute-forcing a 32 character password.
Why would you try that if you know there does not exist storage in the world to hold the results (5e49 bytes... a 5 with 49 zeroes behind it)?
Karthik> Its just that sum 1 had told we can do this via shell script or perl script .
NOT with the specification you provided.
>> Can u guys post the code of what u tried.
Perl script above
Just change
>> for (' ', 'a'..'c', '0'..'2') {
:
>> if (($j && $x++ < $count) || $x++ < 3 ) {
To
>>>> for (' ', 'a'..'z', '0'..'9') {
:
>>>> if (($j && $x++ < $count) || $x++ < 26 ) {
If you want to go to 9999...9 the change last to:
>>>> if ($x++ < $count) {
Bash script was already posted below your reply above this one.
> I had been tryin this since days.
Ouch!
> Is there any logic for this Problem-
I just use a simple counting technique for a radix-N number.
You know 1 + 1 = 2...
9 + 1 = 0 and increment the next cell.
'a' + 1 = 'b'
'z' + 1 = ' ' and increment the next cell.
Instead of outputting each cell directly, i look up the 'picture' in a table.
One could also count in pictures of course.
On an HP BL860c, with just 7 output chars, the perl script generates the 960801 words in 9.3 seconds.
I killed the shell script after 11:31.6 minutes ( user 7:07.3, sys 1:50.2) just before it was done :-(.
I should have trusted my ball park duration guestimate of 10 minutes better, allowing for a little more.
$ wc -lc *.tmp
931315 7290395 bash.tmp
960801 8647214 perl.tmp
Hope this helps some,
Hein van den Heuvel (at gmail dot com)
HvdH Performance Consulting
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-28-2007 02:08 AM
тАО08-28-2007 02:08 AM
Re: Help me with this shell script pls..
The perl script there is refusing to start with the numbered values.. was that intentional?
One long-haired git at your service...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-28-2007 02:47 AM
тАО08-28-2007 02:47 AM
Re: Help me with this shell script pls..
Surprised at the runtime difference?
I wasn't. Mind you, I tried under HPUX un Itanium, not Linux where bash might be more optimized.
>> The perl script there is refusing to start with the numbered values.. was that intentional?
Yes,
following the 'suggestion' in the original question:
".......till a9999999........9........9 "
In an earlier reply I questioned whether that leading 'a' was intentional (symbol or password requirement) or just careless.
It was implemented with the line
>> if (($j && $x++ < $count) || $x++ < 3 ) {
So is $j, the column counter is not zero = true then go through all sample characters. If it is not true then use a different stopper, here hardcoded at 3 = 'c'.
To generate all, simplify that line to:
>> if ($x++ < $count) {
Didn't i write that already above?
I maintain that if this was to be part of a serious application, then a 'real' compiled langues is in order, not perl and certainly not a shell. The generated data should not be stored/listed, but consumed there and then.
If it was a brute-force password cracker, then uppercase would probably need to be part of the character set:
>> for (' ', 'A'..'Z', 'a'..'f', '0'..'9') {
And you could restrict yourself to say 12 chars giving 'only' (26+26+10)**12 words.
Cheers,
Hein.
I wasn't. Mind you, I tried under HPUX un Itanium, not Linux where bash might be more optimized.
>> The perl script there is refusing to start with the numbered values.. was that intentional?
Yes,
following the 'suggestion' in the original question:
".......till a9999999........9........9 "
In an earlier reply I questioned whether that leading 'a' was intentional (symbol or password requirement) or just careless.
It was implemented with the line
>> if (($j && $x++ < $count) || $x++ < 3 ) {
So is $j, the column counter is not zero = true then go through all sample characters. If it is not true then use a different stopper, here hardcoded at 3 = 'c'.
To generate all, simplify that line to:
>> if ($x++ < $count) {
Didn't i write that already above?
I maintain that if this was to be part of a serious application, then a 'real' compiled langues is in order, not perl and certainly not a shell. The generated data should not be stored/listed, but consumed there and then.
If it was a brute-force password cracker, then uppercase would probably need to be part of the character set:
>> for (' ', 'A'..'Z', 'a'..'f', '0'..'9') {
And you could restrict yourself to say 12 chars giving 'only' (26+26+10)**12 words.
Cheers,
Hein.
- « Previous
-
- 1
- 2
- Next »
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP