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.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
[Source] PHP LookingGlass
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
Comments
Thanks for sauce
Hot Sauce ... Clean look - Thanks!
I...AM...TELEPHONE!
Nicely done. Going to be using this
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.
You can thank the 99cent promo for that
And yours looks "very very similar" to @William's
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)
Would install, but I don't own a dedi so I don't see a purpose. :P
@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.
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.
http://beryllium.node.simpleno.de/lg/
Host works now, also new size test files. Thanks to @telephone
(except MTR is still borked)
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?
@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.
@telephone Everything works now
Now, back to bugging Incero for IPv6
Nice script, i think we replace this with our old script.
Thanks!
ready: http://lg.filemedia.net/
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.
Telephony, any chance of building a 'network,' where we could perhaps include multiple servers (from different locations, of course)?
That would be awesome.
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.
Simple solution would be not to use backspace Or in your case use Shift+Backspace instead.
What OS and terminal app are you using?
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.
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 :
If networking, I might join. I have a VPS with TheCheapestVPS/YDGH in Dallas. :P
@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.
@MikHo http://forums.vandyke.com/archive/index.php/t-1924.html
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
Someone didn't read the license...