Howdy, Stranger!

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


[Source] PHP LookingGlass
New on LowEndTalk? Please Register and read our Community Rules.

[Source] PHP LookingGlass

telephonetelephone Member
edited September 2012 in General

Hey guys!

I've just finished my "boredom" project for the week (spare time), and figured I'd give a shout out to LowEndTalk as I know a few people wanted the source for a PHP based looking glass.

So without further ado, I present LookingGlass:

  • PHP based looking glass
  • Setup takes less than a minute using the included Bash script
  • Long polling (Ajax) to simulate live output of given commands
  • Easily customizable

Installation instructions and more information can be found on GitHub:
Stable release: LookingGlass - Stable
Source: GitHub - LookingGlass
Demo: LookingGlass

The demo is currently hosted on a 50MB VPS (Prometeus). 502 errors may occur in events of high use.

Anyway, let me know what you think ;)

«13

Comments

  • Thanks for sauce

    D4jsp - Where virgins roam free
  • Hot Sauce ;) ... Clean look - Thanks!

    LiquidLayer.net - Shared ZFS SSD Cluster | US UK AU BG and Finland

    • [MailEdge] - [TheSpamBusters] | Spam Filtering
  • SimpleNodeSimpleNode Member, Provider

    I...AM...TELEPHONE!

    SimpleNode | VPS Hosting | KVM and OpenVZ | Dallas, TX | PayPal and Bitcoin accepted

  • jarjar Provider

    Nicely done. Going to be using this :)

    Britney is innocent

  • nunimnunim Member
    edited September 2012

    Looks very very similar to mine how the information is displayed, but I guess there's only so many ways to build a looking glass with php, the live results are neat though.

    SonicBoxes.com - VPS Tips, Tricks & Tutorials
    6UA.net Various tools, screenshots, password gen, looking glass, etc..

  • @SimpleNode said: I...AM...TELEPHONE!

    You can thank the 99cent promo for that :)

    @nunim said: Looks very very similar to mine how the information is displayed, but I guess there's only so many ways to build a looking glass with php, the live results are neat though.

    And yours looks "very very similar" to @William's :p
    I used a Bootstrap theme from an old project and went from there.

    Just to be knit-picky "...only so many ways to build a looking glass with php".
    There's actually quite a few ways: exec(), popen(), proc_open(), shell_exec(), and system(). (There's actually even more...)

    Anyway, feel free to use any of the code for your project.

  • Just a thought, maybe someone could toss all the Looking Glasses on the Wiki?

  • SimpleNodeSimpleNode Member, Provider

    Incero Dallas.
    http://beryllium.node.simpleno.de/lg/

    MTR and Host don't work (I know Host doesn't work as it isn't installed, but MTR is installed)

    SimpleNode | VPS Hosting | KVM and OpenVZ | Dallas, TX | PayPal and Bitcoin accepted

  • Would install, but I don't own a dedi so I don't see a purpose. :P

    Shane Elmore | Programmer In Progress

  • @SimpleNode

    Did you run configure.sh? configure.sh is setup to install the needed commands via apt-get or yum. (Unless you're on a distro that doesn't use those two).

    Can you run an mtr report via terminal? (mtr --report google.com)

  • SimpleNodeSimpleNode Member, Provider

    @telephone Yes, I did run it. It didn't install Host because the package was not found.

    I'll go do the mtr report now.

    SimpleNode | VPS Hosting | KVM and OpenVZ | Dallas, TX | PayPal and Bitcoin accepted

  • SimpleNodeSimpleNode Member, Provider
    edited September 2012

    [[email protected] ~]# mtr --report iamtelephone.com

    HOST: beryllium.node.simpleno.de Loss% Snt Last Avg Best Wrst StDev
    1. 23.29.124.225 0.0% 10 1.9 2.0 1.9 2.5 0.2
    2. 23.29.112.73 0.0% 10 3.8 2.1 0.7 4.7 1.5
    3. incero.corexchange.com 0.0% 10 0.3 0.3 0.3 0.4 0.0
    4. tengigabitethernet2-2.asr1.d 0.0% 10 0.5 17.9 0.5 132.4 41.1
    5. xe-8-1-1.dal33.ip4.tinet.net 0.0% 10 0.5 1.2 0.5 7.8 2.3
    6. xe-4-0-0.lon11.ip4.tinet.net 0.0% 10 107.7 109.3 107.6 117.8 3.6
    7. connect4london-gw.lon10.ip4. 0.0% 10 107.8 109.0 107.8 114.2 2.5
    8. kusanagi-ringo.c4l.co.uk 0.0% 10 107.9 108.4 107.8 112.2 1.4
    9. ringo-cg4.c4l.co.uk 0.0% 10 110.9 117.9 110.8 177.9 21.1
    10. 109.104.117.26 0.0% 10 110.9 111.1 110.9 112.3 0.4
    11. point.cloud.atechmedia.net 10.0% 10 111.2 111.2 111.1 111.3 0.1

    So... it works.

    SimpleNode | VPS Hosting | KVM and OpenVZ | Dallas, TX | PayPal and Bitcoin accepted

  • SimpleNodeSimpleNode Member, Provider

    http://beryllium.node.simpleno.de/lg/

    Host works now, also new size test files. Thanks to @telephone
    (except MTR is still borked)

    SimpleNode | VPS Hosting | KVM and OpenVZ | Dallas, TX | PayPal and Bitcoin accepted

  • telephonetelephone Member
    edited September 2012

    @SimpleNode said: Yes, I did run it. It didn't install Host because the package was not found.

    Fixed "Host" for CentOS.
    I'm unsure of the error regarding mtr, but I'll investigate into it more.

    EDIT: MTR seems to be bung on CentOS :/ It's returning NULL for some reason. As I mentioned above, I'll look into it more.

  • How is the security? How do you filter user input, can the shell script go rouge?

    Quis custodiet ipsos custodes?
    https://raymii.org - https://cipherli.st
  • @SimpleNode

    I fixed the MTR issue. Download the configure.sh script and run it again :)

    @Raymii

    Security is alright. IP's are validated, and hosts will only have their hostname passed through to the script. Furthermore, the user input is stripped of single quotes, and then run within a pair of single quotes. (Anything that the user inputs will be quoted)

    To all those who have downloaded or forked LookingGlass and are on a RHEL OS, you'll want to re-download/update your fork.

    Thanked by 1emilv
  • SimpleNodeSimpleNode Member, Provider

    @telephone Everything works now :D

    Now, back to bugging Incero for IPv6 ;)

    Thanked by 1jimpop

    SimpleNode | VPS Hosting | KVM and OpenVZ | Dallas, TX | PayPal and Bitcoin accepted

  • fileMEDIAfileMEDIA Member
    edited September 2012

    Nice script, i think we replace this with our old script.
    Thanks!

    ready: http://lg.filemedia.net/

    fileMEDIA - Dedify: German Private Cloud @ https://www.dedify.com - CloudStack+XenServer+SSD

  • nunimnunim Member
    edited September 2012

    @telephone said: Just to be knit-picky "...only so many ways to build a looking glass with php".

    There's actually quite a few ways: exec(), popen(), proc_open(), shell_exec(), and system(). (There's actually even more...)

    It was more the display then backend I was talking about, and yes mine does look similar to William's but not the same.

    SonicBoxes.com - VPS Tips, Tricks & Tutorials
    6UA.net Various tools, screenshots, password gen, looking glass, etc..

  • WintereiseWintereise Member
    edited September 2012

    Telephony, any chance of building a 'network,' where we could perhaps include multiple servers (from different locations, of course)?

    -- BOFH

  • That would be awesome.

  • mikhomikho Member, Provider

    I installed it to test out and found that when entering the sitename, backspace ain't working. It inserts some ^H characters instead.

    I can now be found at https://talk.lowendspirit.com
    or on twitter
    Come say HI! :)
  • @MikHo said: I installed it to test out and found that when entering the sitename, backspace ain't working. It inserts some ^H characters instead.

    Backspace works fine for me.

  • @MikHo said: I installed it to test out and found that when entering the sitename, backspace ain't working. It inserts some ^H characters instead.

    Simple solution would be not to use backspace ;) Or in your case use Shift+Backspace instead.
    What OS and terminal app are you using?

    @Nick said: Backspace works fine for me.

    Some terminals set backspace to "^H" instead of the normal "^?"... I know on Linux OS's you can simply run "stty erase ^H" to apply a temporary fix.

    @Wintereise said: Telephony, any chance of building a 'network,' where we could perhaps include multiple servers (from different locations, of course)?

    The HTML layout is just bootstrap, so it won't be hard for others to add in their "flavor", but I'll add it to the list.... There's a few other to-dos first.

  • Thank you. I'm using it on my blog now :

    http://www.erawanarifnugroho.com/lg/
  • If networking, I might join. I have a VPS with TheCheapestVPS/YDGH in Dallas. :P

    Shane Elmore | Programmer In Progress

  • mikhomikho Member, Provider

    @telephone
    Debian 6
    Securecrt (windows version)
    Could be the terminal emulation but never seen it before.
    Thought there was some "screening" of keys used/allowed.

    I can now be found at https://talk.lowendspirit.com
    or on twitter
    Come say HI! :)
  • WilliamWilliam Member, Provider
    edited September 2012

    http://at.edis.at/ :: Graz, Austria
    http://de.edis.at/ :: Frankfurt, Germany
    http://is.edis.at/ :: Hafnarfjordur, Iceland
    http://fr.edis.at/ :: Paris, France
    http://us.edis.at/ :: Chicago, USA
    http://pl.edis.at/ :: Warsaw, Poland
    http://it.edis.at/ :: Milano, Italy
    http://uk.edis.at/ :: London, UK
    http://ch.edis.at/ :: Zurich, Switzerland
    http://se.edis.at/ :: Stockholm, Sweden
    http://hk.edis.at/ :: Kowloon, Hong Kong
    http://es.edis.at/ :: Madrid, Spanien
    http://cl.edis.at/ :: Viña del Mar, Chile

    :)

    Thanked by 1TheHackBox
  • Someone didn't read the license...

Sign In or Register to comment.