arrow_upward

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Hidden Refuge's Benchmark 2.0 script
#1
So this last weekend I was struggling to find the right command for using Hidden's Benchmark script. That was quite an eventful experience as when I searched for it, freevps.us was offline. I was unable to get a command at his Github page for Benchmark 2.0 - maybe it was there but I missed it? So Rudra finally helped me with the following command that can also be found in Hidden's freevps.us thread about Benchmark 2.0:

wget --no-check-certificate https://raw.githubusercontent.com/hidden-refuge/bench-sh-2/master/bench.sh -O - -o /dev/null | bash


I now have a question. If you check his thread he has abbreviated codes such as this one:

./bench.sh -b

How do I add that code into the main command line?
Terminal
Thank you to Post4VPS and VirMach for my awesome VPS 9!  
#2
The commands are at the frontpage of the Github repo: https://github.com/hidden-refuge/bench-sh-2
Or simply in the README file: https://github.com/hidden-refuge/bench-s.../README.md

Passing the option to the script when running it directly after downloading it into memory doesn't seem to be really possible. You have to download the sh file to the disk and after that run it with the options passed to it (at least I haven't found a easy way while doing a little research).

So basically:
wget --no-check-certificate https://raw.githubusercontent.com/hidden-refuge/bench-sh-2/master/bench.sh && bash bench.sh -b && rm bench.sh

^ That'll download the file, run the script with the passed option and delete the script file afterwards. The bench.log logfile is retained on the disk and stores the clean output of the benchmark (no output from the wget and etc).


Edit: I welcome people very much to contribute new features, fixes and etc to the script. I will happily merge them into the repository and add you as a contributor (well, Github does that automatically).
[Image: zHHqO5Q.png]
#3
(12-10-2018, 01:55 PM)Hidden Refuge Wrote: The commands are at the frontpage of the Github repo: https://github.com/hidden-refuge/bench-sh-2
Or simply in the README file: https://github.com/hidden-refuge/bench-s.../README.md

Passing the option to the script when running it directly after downloading it into memory doesn't seem to be really possible. You have to download the sh file to the disk and after that run it with the options passed to it (at least I haven't found a easy way while doing a little research).

So basically:
wget --no-check-certificate https://raw.githubusercontent.com/hidden-refuge/bench-sh-2/master/bench.sh && bash bench.sh -b && rm bench.sh

^ That'll download the file, run the script with the passed option and delete the script file afterwards. The bench.log logfile is retained on the disk and stores the clean output of the benchmark (no output from the wget and etc).


Edit: I welcome people very much to contribute new features, fixes and etc to the script. I will happily merge them into the repository and add you as a contributor (well, Github does that automatically).

Awesome! Thanks very much @"Hidden Resources". I tried the command and it worked perfect. I liked it that it gave you the option to delete the script file afterwards. Think I'll do a review of my HostUS VPS soon. Now that I've learned some new commands for getting additional info of the CPU. Am having fun with it. Cool
Terminal
Thank you to Post4VPS and VirMach for my awesome VPS 9!  
#4
Autocorrect is a funny thing. Thank god I never use it. Big Grin

My command just imitated the command from freevps.us. The freevps.us command downloads the script into stdin (standard data in stream - basically RAM while the file is being written to the disk) and runs it from there. After that the script is gone because it was never written to disk. So I just made the chain of commands I posted above that does almost the same with the difference that the file is written to the disk in order to run it via bash with options and then it is deleted at the end.

The | pipe in the freevps.us command simply passes the stdin to bash and bash runs it.
[Image: zHHqO5Q.png]
#5
actually you can pass argument to the bash when you are using pipe to direct the downloaded file through stdin to the bash (which by the way is a child process with another pid. if you are already using bash shell then it will be a child. another bash shell. ps -AF --forest shows it all very nicely). you need -s

therefore it becomes

wget --no-check-certificate https://raw.githubusercontent.com/hidden...r/bench.sh -O - -o /dev/null | bash -s -- -b

or use /dev/stdin if available in system.

but direct piping like that is bad from security standpoint. you dont get to see things. only do when you know what you are doing and know the script thoroughly.

also not all script will work through piping. cause stdin is engaged (the script is not on disk but in RAM and being executed step by step. through stdin) and not available for user interaction or intervention in that child bash process.

the following three are the ones we should use...

1] . ./script.sh (. is source command. the one we use to set up environment. in profile or .bashrc etc)

2] bash ./script.sh

3] ./script.sh after using shebang and doing chmod

so the command using && as given by HR is one of the best oneliners.
Sincere Thanks to VirMach for my VPS9. Also many thanks to Shadow Hosting and cubedata for the experiences I had with their VPSs.
#6
It's just getting better and better for me.  A few days ago I was battling to get the command sorted out.  I'd used the one Rudra suggested to me, which was the same one that had been posted at freevps.us.  I then added /.bench.sh -b at the end and that didn't work.    Now finally when I got the command from @"Hidden Refuge" things are falling into place.  Didn't think that it could be so involved.
Terminal
Thank you to Post4VPS and VirMach for my awesome VPS 9!  
#7
Funny how hard it sometimes can be to find something simple like that on the worlds largest and #1 search engine @rudra. I agree it isn't very safe but it is in general very dangerous to run scripts without knowing or looking into what they actually do.

If you however have the script from a safe and trusted source and know what it does you can use any of the both commands. The bench script doesn't need user input and should work therefore even with the bash option passthrough.
[Image: zHHqO5Q.png]


Possibly Related Threads…
Thread
Author
Replies
Views
Last Post
2,921
08-22-2019, 05:41 PM
Last Post: Mashiro
119,998
02-20-2019, 04:49 PM
Last Post: deanhills

person_pin_circle Users browsing this thread: 1 Guest(s)
Sponsors: VirMach - Host4Fun - CubeData - Evolution-Host - HostDare - Hyper Expert - Shadow Hosting - Bladenode - Hostlease - RackNerd - ReadyDedis - Limitless Hosting