mersenneforum.org  

Go Back   mersenneforum.org > New To GIMPS? Start Here! > Information & Answers

Reply
 
Thread Tools
Old 2011-12-13, 02:47   #1
Dubslow
Basketry That Evening!
 
Dubslow's Avatar
 
"Bunslow the Bold"
Jun 2011
40<A<43 -89<O<-88

160658 Posts
Default bash and HTTP?

Hey guys,
I know Christenson's working on automating mfaktc, but I was wondering, is it possible to incorporate sending HTTP stuff via bash? I'd like to crap together something just for me to report results.


Random other question to get maximum thread efficiency: Is there a way to pause just on worker in MPrime? All I can do is stop them all or start them all, without changing the prime.txt/local.txt settings every time I play Minecraft. I cannot use PauseWhileRunning because for whatever reason it always leaves a bunch of zombie processes that I can't seem to kill for the life of me, but that as far as I can tell take no system resources except lines in the process list. (That is to say, clicking end process or issuing killall Minecraft does nothing to affect the zombie processes, but MPrime still reads them.)

Last fiddled with by Dubslow on 2011-12-13 at 02:51
Dubslow is offline   Reply With Quote
Old 2011-12-13, 04:52   #2
Christenson
 
Christenson's Avatar
 
Dec 2010
Monticello

111000000112 Posts
Default

Dubslow:
There are certainly 9 ways to skin the mfaktc automation cat...and a bash (or perl, or Ruby, or...oh, pick your language!) script can certainly be used.

I seem to remember zombie processes as still having slots in the process table, but not doing execution or having remaining memory allocation. I don't think it would be hard under mprime to let you stop just one worker....you can certainly do it in the Windows GUI...
Christenson is offline   Reply With Quote
Old 2011-12-13, 06:42   #3
Dubslow
Basketry That Evening!
 
Dubslow's Avatar
 
"Bunslow the Bold"
Jun 2011
40<A<43 -89<O<-88

11100001101012 Posts
Default

Well yes, but MPrime doesn't have a GUI...

How would you do HTTP? This is about me learning something about it and being lazy than me automating mfaktc properly. That's beyond my ability and you already claimed it.
Dubslow is offline   Reply With Quote
Old 2011-12-13, 16:18   #4
Xyzzy
 
Xyzzy's Avatar
 
Aug 2002

2·7·13·47 Posts
Default

Quote:
Random other question to get maximum thread efficiency: Is there a way to pause just on worker in MPrime?
In the past we have run four instances of Mprime to be able to control each one individually. It is a bit of a hassle but it works.
Xyzzy is offline   Reply With Quote
Old 2011-12-13, 16:20   #5
Xyzzy
 
Xyzzy's Avatar
 
Aug 2002

855410 Posts
Default

Quote:
How would you do HTTP?
Start with learning to communicate with the server via Telnet.
Xyzzy is offline   Reply With Quote
Old 2011-12-13, 18:54   #6
chalsall
If I May
 
chalsall's Avatar
 
"Chris Halsall"
Sep 2002
Barbados

2·72·113 Posts
Default

Quote:
Originally Posted by Dubslow View Post
I know Christenson's working on automating mfaktc, but I was wondering, is it possible to incorporate sending HTTP stuff via bash? I'd like to crap together something just for me to report results.
I don't know how to do this with just Bash, but I do know how to with Perl. Please see the Automatic Submission Spider for Workers thread.

It should give you a good idea about just how easy it is to build spiders using Perl. Also, hopefully, it will be useful.
chalsall is offline   Reply With Quote
Old 2011-12-13, 23:48   #7
Christenson
 
Christenson's Avatar
 
Dec 2010
Monticello

70316 Posts
Default

I think he would need wget or something to do it with just bash...
Christenson is offline   Reply With Quote
Old 2011-12-14, 17:58   #8
Dubslow
Basketry That Evening!
 
Dubslow's Avatar
 
"Bunslow the Bold"
Jun 2011
40<A<43 -89<O<-88

11100001101012 Posts
Default

So I could construct my own HTTP requests with wget? That's what a quick google leads me to believe...
Dubslow is offline   Reply With Quote
Old 2011-12-14, 18:26   #9
chalsall
If I May
 
chalsall's Avatar
 
"Chris Halsall"
Sep 2002
Barbados

2×72×113 Posts
Default

Quote:
Originally Posted by Dubslow View Post
So I could construct my own HTTP requests with wget? That's what a quick google leads me to believe...
Sure. That's what wget does. But just to be pedantic, this isn't Bash doing the work -- it's wget being called from Bash (or whatever).

At your console (or a web browser), "man wget".

But I would still argue Perl with the LWP::UserAgent and HTTP::Cookies (optionally et al) modules is a better solution space.
chalsall is offline   Reply With Quote
Old 2011-12-14, 18:37   #10
Dubslow
Basketry That Evening!
 
Dubslow's Avatar
 
"Bunslow the Bold"
Jun 2011
40<A<43 -89<O<-88

722110 Posts
Default

I'm sure it is, but again, this isn't about being practical. I just want a tool to mess with HTTP, and interacting with PrimeNet seems like a great way to get started (I promise I won't spam/overload it)
Also with bash I can do if [ $(wc -l results.txt) -ge 10 ]; then wget ....
and I'm sure Perl would be great too, but...

Last fiddled with by Dubslow on 2011-12-14 at 18:39
Dubslow is offline   Reply With Quote
Old 2011-12-14, 19:20   #11
chalsall
If I May
 
chalsall's Avatar
 
"Chris Halsall"
Sep 2002
Barbados

1107410 Posts
Default

Quote:
Originally Posted by Dubslow View Post
I'm sure it is, but again, this isn't about being practical. I just want a tool to mess with HTTP, and interacting with PrimeNet seems like a great way to get started (I promise I won't spam/overload it)
Also with bash I can do if [ $(wc -l results.txt) -ge 10 ]; then wget ....
and I'm sure Perl would be great too, but...
In Perl it's only a little more complicated:

Code:
@LC = split(" ", `wc -l results.txt`);
if ($LC[0] > 10) {
   ...
}
But I must warn you again, half of the work of spidering is dealing with unexpected results and errors.

Nearly the entire other half has to do with dealing with parcing the responses. How do you plan on handling the regular expressions? Sed? Or Awk?
chalsall is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Connecting to the bash shell in Windows 10 wombatman Software 10 2018-04-09 02:10
Bash on Ubuntu on Windows henryzz Software 11 2017-07-28 21:24
Fedora gedit for bash has become useless EdH Linux 11 2016-05-13 15:36
Escape sequences in bash scripts? CRGreathouse Software 16 2009-03-26 08:42
Could you help me change this into a bash script? jasong Programming 1 2007-11-29 05:59

All times are UTC. The time now is 06:36.


Tue Jan 31 06:36:02 UTC 2023 up 166 days, 4:04, 0 users, load averages: 1.24, 1.07, 0.93

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.

≠ ± ∓ ÷ × · − √ ‰ ⊗ ⊕ ⊖ ⊘ ⊙ ≤ ≥ ≦ ≧ ≨ ≩ ≺ ≻ ≼ ≽ ⊏ ⊐ ⊑ ⊒ ² ³ °
∠ ∟ ° ≅ ~ ‖ ⟂ ⫛
≡ ≜ ≈ ∝ ∞ ≪ ≫ ⌊⌋ ⌈⌉ ∘ ∏ ∐ ∑ ∧ ∨ ∩ ∪ ⨀ ⊕ ⊗ 𝖕 𝖖 𝖗 ⊲ ⊳
∅ ∖ ∁ ↦ ↣ ∩ ∪ ⊆ ⊂ ⊄ ⊊ ⊇ ⊃ ⊅ ⊋ ⊖ ∈ ∉ ∋ ∌ ℕ ℤ ℚ ℝ ℂ ℵ ℶ ℷ ℸ 𝓟
¬ ∨ ∧ ⊕ → ← ⇒ ⇐ ⇔ ∀ ∃ ∄ ∴ ∵ ⊤ ⊥ ⊢ ⊨ ⫤ ⊣ … ⋯ ⋮ ⋰ ⋱
∫ ∬ ∭ ∮ ∯ ∰ ∇ ∆ δ ∂ ℱ ℒ ℓ
𝛢𝛼 𝛣𝛽 𝛤𝛾 𝛥𝛿 𝛦𝜀𝜖 𝛧𝜁 𝛨𝜂 𝛩𝜃𝜗 𝛪𝜄 𝛫𝜅 𝛬𝜆 𝛭𝜇 𝛮𝜈 𝛯𝜉 𝛰𝜊 𝛱𝜋 𝛲𝜌 𝛴𝜎𝜍 𝛵𝜏 𝛶𝜐 𝛷𝜙𝜑 𝛸𝜒 𝛹𝜓 𝛺𝜔