What pure server side technologies allow html website capture on shared hosting - web

As far as I know, only PHP can't be used for this.
But since not many providers allow installation of Perl/Python/... scripts on shared, I'm wondering whether there is free solution for either
creation of thumbnails or full-size capturing on the fly / on demand and save it to server (since snapshot lets you only to show thumbnails on hover) - service
or
Flex/Flash solution to capture website and PHP to save it (or save it right with flex/flash) - code to run on server
Is it possible?

To capture how a website looks like, you first need somebody to render it.
Because you are usually optimizing a web site to run on the major browsers, you will want one of them to handle the rendering.
This (opening a browser instance, opening a certain web page, rendering it and dumping a screen shot of the results) is possible - it's how services like browsershots.org work.
It's just not trivial to set up, and requires total freedom in setting up the server (i.e. administrator privileges to install programs, set rights, etc.). It definitely is not possible to do with pure PHP, Perl, Python, or any other scripting language, on a restricted shared hosting environment.
If you're on Windows, the answer to this question may be of help.
For a list of snap shot services, see this question.

Related

Is it possible to move a simple .exe based calculator tool to cloud for multi-users?

A few years back, we had a programmer create a type of calculator for use in the audio industry. It was created/compiled in C - and is an .exe we offer for free download. once a user downloads it, they can run it locally.
Our goal is to move that application/calculator to the "cloud" where any user can hypothetically visit a URL, and the calculator is there, running, and ready for user interaction by multiple users.
Is what I describe possible?
Will I need Azure?
What exactly in Azure will I need (i.e. which products/resources)?
Do I need to use the compiled/decompiled version?
Will we need to change any code in the .exe to make this work?
What do I not know that I should know?
I sincerely appreciate any and all input from those that are probably reading this and fully understanding the simplicity of it while I struggle to wrap my head around it.
Thank you!
#Alex, Thank you so much for the response. I apologize I was late getting back to you - have 4 kiddos home - I am actually not sure how to answer that fully. Here is a link to the freely downloadable file we offer to anyone and everyone - it does require an email, but that is just for notifications when the version is updated. https://caf.prosoundtraining.com/verify/ and here is the home page of the site: https://caf.prosoundtraining.com - It works by the user downloading the program (which is what we would like to move to the cloud), and then inputing various values for determining what watt amplifier to use based on speaker selection, length of cables, distance of audience from speakers, etc. basically several calculation tools like that, and then the main program that allows users to visualize amplifier performance via running signal tests through the amplifier. Once a user downloads the program, the calculators (which are separate in the decompiled version I have), they can choose to just use the calculators, or the complete program.
Is what I describe possible?
Well, If you are talking about a pure command-line application: yes.
But, If you are talking about a GUI application: If your application not fully usable from the command line, Go back to the source code and strip down all windows, buttons, UI stuff, etc.. AND make it usable from the command line.
Will I need Azure?
Any cloud provider will do just fine. Depending on the traffic, an old laptop with an internet connection might be enough for your case.
What exactly in Azure will I need (i.e. which products/resources)?
Azure virtual machine with a publicly accessible IP.
Do I need to use the compiled/decompiled version?
Will we need to change any code in the .exe to make this work?
What do I not know that I should know?
Using decompiled version (Source code):
WebAssembly
WebAssembly is a new type of code that can be run in modern web browsers — it is a low-level assembly-like language with a compact binary format that runs with near-native performance and provides languages such as C/C++, C# and Rust with a compilation target so that they can run on the web. It is also designed to run alongside JavaScript, allowing both to work together.
Emscripten
Compile C and C++ code, or any other language that uses LLVM, into WebAssembly, and run it on the Web, Node.js, or other wasm runtimes.
Using compiled verison (executable):
Common Gateway Interface-ish approach
Common Gateway Interface (CGI) is an interface specification for web servers to execute programs like console applications (also called command-line interface programs) running on a server that generates web pages dynamically. Such programs are known as CGI scripts or simply as CGIs. The specifics of how the script is executed by the server are determined by the server. In the common case, a CGI script executes at the time a request is made and generates HTML.
My suggestion would be to use python, PHP or any scripting language you are familiar with to spin up a webserver and execute command based on incoming requests.
Python example:
import subprocess
from flask import Flask
app = Flask(__name__)
#app.route('/calculator') # Accessible from http://[ipaddress]:[port]/calculator
def hello_RedPanda():
command = "..." # as if you are running your program from cmd.
result = subprocess.check_output(command) # execute given command
return result # to your web browser
Once you are done with all the back-end pluming, you can add your buttons and tabs back by rebuilding your UI on the client-side using HTML, CSS and Javascript.
Building the UI in client-side is actually the easy part. The really tricky part in your case is (as I mentioned above) making your application usable from the command line.
See more:
WebAssembly
Emscripten
CGI
A case similar to yours

Prevent from screen recording

I am working on an educational e-commercial website .. In which the user need to authenticate and then the videos on particular topics will be available.. so how can I prevent my video to be screen-recorded...
Different OS's and applications support different mechanisms to try to tackle this - for example:
Microsoft Edge on Windows 10 uses integrated 'Protected Media Path' for encrypted content which will stop simple screenshots working
Website and web app developers may use a number of CCS 'tricks' to achieve a similar affect, although these can usually be workaround with standard web developer and debug tools.
Mobile video typically uses protected memory for encrypted content which will usually give a black screen on capture.
As mentioned in comments and other answers these are all 'barriers' but they don't make it impossible to copy the content - the best example being pointing a camera at the screen a copying that way.
The idea is generally to make it hard enough compared to the value of the content so that people are not prepared to invest the time to work around your barriers.
It is not possible, for a variety of reasons:
There is no Web API for that.
Even if there was, it would be possible to reverse engineer the browser/OS to allow for screen recording.
Even if, for some reason, you couldn't access and modify the software running on the computer, you could connect the computer to a capture card instead of your monitor.
And if you also couldn't do that, you could just point a camera at the screen and start recording.

Kiosk program (web browser), deployment struggles

Okay, here's a complicated one I've been breaking my head over all week.
I'm creating a self service system, which allows people to identify themselves by barcode or by smartcard, and then perform an arbitrary action. I run a Tomcat application container locally on each machine to serve up the pages and connect to external resources that are required. It also allows me to serve webpages which I then can use to display content on the screen.
I chose HTML as a display technology because it gives a lot of freedom as to how things could look. The program also involves a lot of Javascript to interact with the customer and hardware (through a RESTful API). I picked Javascript because it's a natural complement to HTML and is supported by all modern browsers.
Currently this system is being tested at a number of sites, and everything seems to work okay. I'm running it in Chrome's kiosk mode. Which serves me well, but there are a number of downsides. Here is where the problems start. ;-)
First of all I am petrified that Chrome's auto-update will eventually break my Javascript code. Secondly, I run a small Chrome plugin to read smartcard numbers, and every time the workstation is shutdown incorrectly Chrome's user profile becomes corrupted and the extension needs to be set up again. I could easily fix the first issue by turning off auto-update but it complicates my installation procedure.
Actually, having to install any browser complicates my installation procedure.
I did consider using internet explorer because it's basically everywhere, but with the three dominant versions out there I'm not sure if it's a good approach. My Javascript is quite complex and making it work on older versions will be a pain. Not even mentioning having to write an ActiveX component for my smartcards.
This is why I set out to make a small browser wrapper that runs in full screen, and can read smartcard numbers. This also has downsides. I use Qt: Qt's QtWebkit weighs a hefty 10MB, and it adds another number of dependencies to my application.
It really feels like I have to pick from three options that all have downsides. It really is something I should have investigated before I wrote the entire program. I guess it is a lesson learnt well.
On to the questions:
Is there a pain free way out of this situation? (probably not)
Is there a browser I can depend on without adding tens of megabytes to my project?
Is there another alternative you could suggest?
If you do not see another way out, which option would you pick?

What user-information is available to code running in browsers?

I recently had an argument with someone regarding the ability of a website to take screenshots on the user's machine. He argued that using a GUI-program to simulate clicking a mouse really fast to win a simple flash game could theoretically be detected (if the site cared enough) by logging abnormally high scores and taking a screenshot of those players' desktops for moderator review. I argued that since all website code runs within the browser, it cannot step outside the system to take such a screenshot.
This segued into a more general discussion of the capabilities of websites, through Javascript, Flash, or whatever other method (acceptable or nefarious), to make that step outside of the system. We agreed that at minimum some things were grabbable: the OS, the size of the user's full desktop. But we definitely couldn't agree on how sandboxed in-browser code was. All in all he gave website code way more credit than I did.
So, who's right? Can websites take desktop screenshots? Can they enumerate all your open windows? What else can (or can't) they do? Clearly any such code would have to be OS-specific, but imagine an ambitious site willing to write the code to target multiple OSes and systems.
Googling this led me to many red herrings with relatively little good information, so I decided to ask here
Generally speaking, the security model of browsers is supposed to keep javascript code completely contained within its sandbox. Anything about the local machine that isn't reflected in the properties of the window object and its children is inaccessible.
Plugins, on the other hand, have free reign. They're installed by the user, and can access anything the user can access. That's why they're able to access your webcam, upload files, do virus scans, etc. They're also able to expose APIs to javascript code, which pokes a hole in the javascript sandbox and gives javascript code some external access. That's how tools like Phonegap give javascript code in web apps access to phone hardware (gps, orientation, camera, etc.)

How to create a dynamic website without IIS

I want to create a dynamic website that does not support IIS. The area where I work does not allow anything to be installed in the server. The have a windows based server and I would like to create a dynamic website. IIS not allowed and server side languages like asp.net, php are not allowed. They did not say anything about client side. Is it possible to do?
In short, a general answer to your question Is it possible? would be No, it's not. And if you still find a way, it's not going to be worth the effort.
For one thing, even without programming languages like ASP.NET or PHP, you still need a web server such as IIS to serve static content. There are of course alternatives to IIS specifically, but no web server at all means no serving web sites at all.
If you would be given an opportunity to server static content, you could possibly produce a web site that is dynamic at least on a per visit basis using client side scripting and cookies, but the things you could make that site do would be very limited, and without anything other than serving static content there is no saving things between sessions, or in any way affecting the server side of the application.
You have to ask yourself why you need to serve this website. Is this something your company would benefit from? If so, could you convince the IT department to setup an environment to serve it? Are there any other alternatives? And, perhaps the most important one: there are lots of free or almost free web hosting solutions out there. Why not just use one of them?
There are many excellent reasons why you would want to create a dynamic website without using a web server. Here are a couple:
You are creating a website as a means of presenting a dataset with hyperlinks that you want to be able to archive on read-only media and ignore for 10 years or more (as you can do with books), and still be able to read (IIS is very poor at backwards compatibility).
You need to present your data to people who have no access to servers or the internet and have no idea how to turn their PC into a web server (there are many millions of such people in the developing world)
Yes, it's challenging, but if you want something to be readable by anyone, anywhere, anytime, and all you can count on are web browsers, there's no option.
By saying you want to do it without IIS, I'm assuming you're implying Apache as well (since you reference no server-side languages).
It depends what you mean by 'dynamic'. Essentially you'll be limited to
JavasScript, which means that you can manipulate information and elements already on the page.
iFrames - this would let you load external pages into elements and pages on the page. These could be dynamic, and if they were on the same server you could manipulate it as well. If it was from an external server, then you wouldn't have control over it from that page.
If you are able to set up an HTTP proxy, you can use JavaScript together with a service like CouchOne. You will need the proxy, since browsers restrict AJAX calls.

Resources