Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Joodle Monitor Released
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Joodle Monitor Released

BlazeMuisBlazeMuis Member
edited March 2012 in General

Joodle Monitor is now officially done
It had some delay because i was busy working for school

Anyway, you can download it here: http://173.208.240.138/download/JoodleMonitor.zip

Demo: http://173.208.240.138/demo/

Suggestions are welcome!

Thanked by 1Amfy

Comments

  • Is it open source or what license is it?

  • It's open source

  • @joodle said: It's open source

    It still needs some sort of license (just say GPL and everyone will be happy^^)

  • NickMNickM Member

    I prefer the WTFPL

  • Well

    You can do what u want with it, only no redistributing shit

  • AmfyAmfy Member

    @joodle looks really nice. Only one small thing is strange: The last line of every output is double?

  • Yeah, i don't know howto fix that problem
    But i'll look into this soon

  • yomeroyomero Member
    edited March 2012

    @joodle said: Yeah, i don't know howto fix that problem

    But i'll look into this soon

    http://php.net/manual/en/function.system.php

    The system() call also tries to automatically flush the web server's output buffer after each line of output if PHP is running as a server module.
    
    If you need to execute a command and have all the data from the command passed directly back without any interference, use the passthru() function.
    

    Maybe that helps?
    Just don't use echo.

    Btw why you do something like this

    {
        echo get_disk();
    }
    

    Also, I am not sure, but I recommend you to use echo just when you really need it, and not for outputting tags, like

    ?>
    <b>
    <?php echo $var; ?>
    </b>
    <?php
    

    or even if you like short tags

    ?>
    <b>
    <?=$var?>
    </b>
    <?php
    

    instead of

    //more code
    echo "<b>"; 
    echo $var;
    echo "</b>"; 
    //more code
    ?>
    
  • @Damian said: even if your function doesn't take user input.

    Why this?
    Well, I know it probably will cause a mess depending on how is the command, but nothing dangerous, is correct?

  • AmfyAmfy Member

    Installed it on my server in Germany.
    Will try to fix that small system() problem.

    Ah, and don't ping google.com instead of a real-usa-location. Getting 2-3ms, that can't be the usa :P

  • AmfyAmfy Member

    A small solution would be system("free -m > free.txt");
    echo file_get_contents("file.txt"); but that's a spagethi-way :P

  • @Amfy said: A small solution would be system("free -m > free.txt");

    echo file_get_contents("file.txt"); but that's a spagethi-way :P

    Too much, read my comment, just remove the echoes

  • AmfyAmfy Member

    @yomero: Oh, sorry, I haven't seen it. Will edit the .php's as you said, thanks.

  • netomxnetomx Moderator, Veteran
    exec("free -m", $output);
    echo $output[0];
  • LESLES Member

    Don't use functions if the code not called more than once!

    Thanked by 1yomero
  • AmfyAmfy Member

    @LES: Make sense, right. But are there more reasons, unless the expenditure?

  • netomxnetomx Moderator, Veteran

    @LES said: Don't use functions if the code not called more than once!

    Can you explain?

    Thanked by 1Amfy
  • @netomx said: Can you explain?

    It's unneeded and sloppy. It uses more cpu cycles for no reason at all. Most likely he just found a code snippet on some website and used it without really knowing how it worked.

  • DamianDamian Member
    edited March 2012

    @subigo said: It's unneeded and sloppy. It uses more cpu cycles for no reason at all.

    +1 on this. PHP is not robust enough to create it's own internal pointers, and therefore when referencing something that's not a variable, never realizes that you're asking for the same data.

    It's one of those "it'll be in the next major version" issues that was supposed to have been part of PHP 3, then PHP 4, then PHP 5... probably been put off til PHP 6 now.

  • netomxnetomx Moderator, Veteran

    Now I get it. Maybe he did it to make it cleaner?

  • LESLES Member
    edited March 2012

    Example of used code:

    <?php
    function get_kernel() {
        $kernel = shell_exec("cat /proc/version");
        echo "Kernel Info: $kernel"; 
    }
    {
        echo get_kernel();
    }
    ?>
    

    would be enough if it was:

    <?
    echo("Kernel Info: ".shell_exec("cat /proc/version"));
    ?>
    

    Just to save some bytes ;)

    Thanked by 2Amfy yomero
  • AmfyAmfy Member

    @Damian: Thought that there is no more developing at PHP6?

  • NanoG6NanoG6 Member
    edited March 2012

    It's nice Joodle. But don't know why it is unable to detect my CPU :D

    image

Sign In or Register to comment.