Howdy, Stranger!

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

Sign In with OpenID
Advertise on LowEndTalk.com

In this Discussion

[Source] PHP LookingGlass

[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 ;)

«1

Comments

  • Thanks for sauce

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

    HostCheetah.com - Shared and VPS : Coming Soon

  • I...AM...TELEPHONE!

    SimpleNode | Minecraft and VPS Hosting | KVM and OpenVZ | Dallas, TX and Phoenix, AZ | PayPal and BitCoins accepted

  • JarJar Member, Provider

    Nicely done. Going to be using this :)

  • 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.

    SonicGlass 11 Locations- Amsterdam, Atlanta, Denver, Los Angeles, , Milan,
    SonicBoxes.com - VPS Tips, Tricks & Tutorials

  • @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?

  • 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 | Minecraft and VPS Hosting | KVM and OpenVZ | Dallas, TX and Phoenix, AZ | PayPal and BitCoins 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)

  • @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 | Minecraft and VPS Hosting | KVM and OpenVZ | Dallas, TX and Phoenix, AZ | PayPal and BitCoins accepted

  • SimpleNodeSimpleNode Member
    edited September 2012

    [root@beryllium ~]# 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 | Minecraft and VPS Hosting | KVM and OpenVZ | Dallas, TX and Phoenix, AZ | PayPal and BitCoins accepted

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

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

    SimpleNode | Minecraft and VPS Hosting | KVM and OpenVZ | Dallas, TX and Phoenix, AZ | PayPal and BitCoins 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
  • @telephone Everything works now :D

    Now, back to bugging Incero for IPv6 ;)

    SimpleNode | Minecraft and VPS Hosting | KVM and OpenVZ | Dallas, TX and Phoenix, AZ | PayPal and BitCoins accepted

    Thanked by 1jimpop
  • 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.

    SonicGlass 11 Locations- Amsterdam, Atlanta, Denver, Los Angeles, , Milan,
    SonicBoxes.com - VPS Tips, Tricks & Tutorials

  • 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 Moderator

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

    http://www.lowendguide.com/ - the guides to administer your lowend vps | Hosted Piwik from $3/year
    FreecPanelSharedHosting Locations: Miami (US) | Rotterdam (NL)
  • @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/
    My blog | Server Uptime | I'm not working for any providers in here, all my comments just my own opinion.
  • If networking, I might join. I have a VPS with TheCheapestVPS/YDGH in Dallas. :P

    Shane Elmore | Programmer In Progress

  • mikhomikho Moderator

    @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.

    http://www.lowendguide.com/ - the guides to administer your lowend vps | Hosted Piwik from $3/year
    FreecPanelSharedHosting Locations: Miami (US) | Rotterdam (NL)
  • 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

    :)

    Available for Consulting | Currently UNEMPLOYED | Proudly financed by Austrian government | [email protected] | https://william.si
    Unlike others i do not need shitty affiliate links in my signature.

    Thanked by 1TheHackBox
  • @William said: :)

    Someone didn't read the license...

  • WilliamWilliam Member, Provider

    I have permission for my modifications from the coder :)

    Available for Consulting | Currently UNEMPLOYED | Proudly financed by Austrian government | [email protected] | https://william.si
    Unlike others i do not need shitty affiliate links in my signature.

  • @FTN_Nick said: Someone didn't read the license...

    The code is under MIT License. You can do whatever you want with it, just include the copyright in the source code (Don't distribute and claim as your own)... I'll clarify that better in the next release.

    From the README: "Please keep the "Powered by LookingGlass" link intact to promote this script."

    It pretty much boils down to: If you want to support my efforts, then keep the link, but no one is holding a gun to your head.

  • mikhomikho Moderator

    @telephone I was right about the terminal emulation then :) Never seen it before ... theres a first for everything

    http://www.lowendguide.com/ - the guides to administer your lowend vps | Hosted Piwik from $3/year
    FreecPanelSharedHosting Locations: Miami (US) | Rotterdam (NL)
  • @William, What happened to Transit LG?

    FiberVolt | Quality Los Angeles & Chicago Virtual Servers - http://fibervolt.com

  • @MikHo said: @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.

    For secureCRT, in session options under mapped keys, check backspace sends [...] to fix the ^H issues.

    Quis custodiet ipsos custodes?
    https://raymii.org - https://cipherli.st
  • And I always like this:

    raymii.org has address 69.197.183.203
    raymii.org has address 84.200.77.169
    raymii.org has address 84.200.77.168
    raymii.org has address 192.71.245.64
    raymii.org has address 209.141.58.74
    raymii.org has address 205.185.124.11
    raymii.org has address 209.141.58.75
    raymii.org has address 205.185.117.74
    raymii.org has IPv6 address 2001:1608:10:38::f57a:8696
    raymii.org has IPv6 address 2a00:dcc0:eda:88:245:71:6b8:eae1
    raymii.org has IPv6 address 2607:f358:1:fed5:22:0:beb8:953a
    raymii.org has IPv6 address 2607:f358:1:fed5:22:0:8dc7:4fb5
    raymii.org has IPv6 address 2607:f358:1:fed5:22:0:4fd9:ca83
    raymii.org has IPv6 address 2a00:dcc0:eda:88:245:71:5a7a:4ec6
    raymii.org has IPv6 address 2607:f358:1:fed5:22:0:d274:c869
    raymii.org has IPv6 address 2607:f358:1:fed5:22:0:6b58:59f3
    raymii.org has IPv6 address 2607:f358:1:fed5:22:0:3432:4274
    raymii.org has IPv6 address 2607:f358:1:fed5:11:0:1071:3
    raymii.org has IPv6 address 2607:f358:1:fed5:22:0:d562:72e8
    raymii.org has IPv6 address 2607:f358:1:fed5:22:0:7454:5742
    
    Quis custodiet ipsos custodes?
    https://raymii.org - https://cipherli.st
  • @telephone, I love it when programmers use ASCII Art in their code. It should be a standard! :) Have you got your own script or a frequent visitor of a good online one?

    -

  • This is great!

    I threw up a few of my own:

    http://actually.streamlively.com/lg/ - BuyVM SJ http://fundamental.streamlively.com/lg/ - DataShack http://results.streamlively.com/lg/ - NodeDeploy Phoenix

    "We are in a prison drama. This is like The Shawshank Redemption, only with more tunneling through shit and no fucking redemption."
  • Mark here thanks

  • New Release Version: 1.2.0

    New features: * Rate limiting * Multiple themes

    Download: LookingGlass v1.2.0

    How do I upgrade? * Replace the old install with the files in 1.2.0 (unzip -o LookingGlass-1.2.0.zip), then run configure.sh again.

    Themes can be viewed: LookingGlass themes


    @bnmkl I just use Google to find some good ol' ASCII art :)

    Thanked by 1George_Fusioned
  • updated ;)

    SimpleNode | Minecraft and VPS Hosting | KVM and OpenVZ | Dallas, TX and Phoenix, AZ | PayPal and BitCoins accepted

  • Skinned ;)

    SimpleNode | Minecraft and VPS Hosting | KVM and OpenVZ | Dallas, TX and Phoenix, AZ | PayPal and BitCoins accepted

    Thanked by 1telephone
  • Can someone explain me the funcionality of this project?

    Referral links: DigitalOcean referral link | Get 500MB free with Dropbox
    New worker @ GVHv4 - New plans with 4GB RAM 100GB Unmetered HERE!
  • edited October 2012

    Love it! :)

    Just updated to v1.2.0, have it running on a 64MB RAM KVM VPS (NL) and a 128MB RAM Xen VPS (DE)

    Following fellow Austrian's (@William) pattern:

    nl.fusioned.net :: Alblasserdam, Netherlands de.fusioned.net :: Falkenstein, Germany

    Fusioned | KVM SSD VPS | LSI RAID10 | Netherlands 1Gbps | R1Soft | IPv4 & IPv6 | SolusVM
  • Just remember to install php-pdo for this to work and then restart apache/httpd. By default we don't have pdo installed on our servers and this was causing an issue.

    ChicagoVPS.net - OpenVZ/Xen Based - SolusVM Control Panel - TUN/PPP/FUSE/SIT/GRE - cPanel/DirectAdmin/Parallels - Chicago/Buffalo/LA Coming Soon! - Great Support!

    Thanked by 1ErawanArifNugroho
  • @netomx said: Can someone explain me the funcionality of this project?

    It allows you to run a traceroute or ping to basically any IP, from a remote server. It's useful for testing network connectivity to various other locations in the world, for a specific geographic location, datacenter or host.

    Currently offering Node.js code review, tutoring and advice! http://cryto.net/~joepie91/code-review.html
    Appreciate my posts/software/guides? Donate (PayPal/Bitcoin): http://cryto.net/~joepie91/donate.html | irc.freenode.net #lowendbox

  • @telephone Everything works but Ping, What do I miss?

  • The ping binary itself, I suspect, @LAKid.

    -- BOFH

  • @Wintereise I thnik my php is wroing, on other vps, it works fine, but this crap one, Ping doesn't work.

Sign In or Register to comment.