Standalone program for accessing and developing in Linux in web browser - linux

Is there any software working like this?
Runs as a standalone program. No install is needed. Thus, can be used as an Ansible module.
After running the program in a remote Linux machine, I can open up a web browser, then open a web page provided by the program. The program provides features similar to file explorer, IDE-level code editor, debugger, etc. In terms of debugger, there is already similar one; gdbgui.
There is another way such as Gnome, KDE or X11. However, these requires much packages to be installed. I don't want they be installed, because my Linux machines are kept to be small and secure.

You might consider having some terminal emulator running inside a browser. Such things exist, e.g. libonion has oterm as an example application. Then you can do all the things that a command line interface thru a unix shell provides (of course, you won't be able to run GUI applications, e.g. X11 clients such as GTK or Qt applications).
You could also consider some webmin like stuff.
Notice that you don't need to have a desktop environment on a remote Linux machine. Most of them (e.g. internet servers) have only command line interface.
Learn more about X11: you could have an X11 server on your laptop (e.g. under Windows if so needed) and run remotely X11 clients (that is GUI applications) with ssh -X on your remote Linux system.
However, these requires much packages to be installed. I don't want they be installed, because my Linux machines are kept to be small and secure.
I don't understand that requirement. On my VPS, running in some OVH datacenter, I do have X11 client applications (notably emacs). I don't believe that lowers the security of my system, and the disk space consumption for X11 applications and libraries is small enough these days. And of course I use standard commands (like cp(1), mv(1), rm(1), grep(1), find(1), less(1), file(1), sed(1) ....) to manage files. Any graphical file manager is useless (and I never use them, while using Unix since 1986)
You really should learn how to use the command line on Linux. It is incredibly powerful.

Related

How do I use the "nwjc" versions for Mac and Linux, on Windows?

NW.js has this feature it calls "Protect JavaScript Source Code": https://nwjs.readthedocs.io/en/latest/For%20Users/Advanced/Protect%20JavaScript%20Source%20Code/
The JavaScript source code of your application can be protected by compiling to native code and loaded by NW.js. You only have to distribute the compiled code with your app for production.
JS source code is compiled to native code with the tool nwjc , which is provided in the SDK build.
The compiled code is not cross-platform nor compatible between versions of NW.js. So you’ll need to run nwjc for each of the platforms when you package your application.
I downloaded the SDK distributions for Windows, Mac and Linux, and looked into the files inside them.
The Windows one has a "nwjc.exe" file, ready to be used and works. Good.
But the Mac and Linux ones have no .exe, but instead just a "nwjc" executable. This is obviously for running on macOS and Linux, respectively. Huh?
My used OS is Windows. I am developing my NW.js application on Windows, to be distributed on Windows, Mac and Linux. And I cannot run those Linux/macOS executables on a Windows system. But I have to do so, since they are for some reason not cross-platform.
This seems like a dead end to me. I either have to not "protect" my application (and thus have it stolen/copied/broken/hacked), or buy two separate computers (one expensive Mac and one PC for Linux) and do this step on those. Which of course defeats the whole point of "simple" cross-platform development.
Before you say so, I have tried running Linux in a VM and it's terrible. And Macs cannot even be legally emulated AFAIK.
Most likely, this is going to cause my application to be Windows-only, which is really sad since a major reason for going this route was to have "simple" cross-platformness which "just works".
Is there something I'm missing about this?
PS: I already do "crush" my code with Uglify-JS, before the "protection" stage.
The source protection works by saving a copy of the application as it is currently running in the OS's memory. This means you must run the command on the actual operating system, so it can load the app into memory and then save it as a V8 snapshot (V8 is the JS engine used by Chromium/Node/NW.js).
You can use tools like VirtualBox or VMWare to emulate other OS's on Windows. Getting OSX to run in an emulator is a pain, but there are youtube tutorials to explain how. Linux is very easy though, I'd start there if you are unfamiliar. Though running your application on actual hardware and manually testing in each OS is always best.
If this is too cumbersome, then you may consider not worrying about source protection until later. You can still set up your app for distribution on the other OS's without needing to emulate them if you don't use this feature. Though again, always best to manually test on each OS.

Any way to run a Linux inside a virtual machine, inside my application?

I want to be able to distribute a Linux running inside my application. The reason is that I need to add software functionality which is most easily added inside a Linux container and distributed with the application.
Is there any way to run a VM inside a C/C++ application on Windows, OSX, Linux?
VirtualBox has an API for creating/running VMs. The program Vagrant uses this to give developers a simple cross-platform way to develop. You can run vagrant up from Windows, Linux or Windows, and it does the same thing.
You can also script adding ports to your VM, so your C++ program could say "VirtualBox, boot me this image", then just connect to a TCP port to talk to the "Linux program". But debugging problems will be hard.
But if your goal is to sell a Linux program to non-Linux desktop people, it's probably best for you and your sanity to bite the bullet and port it to Windows/Mac. (Or go Cloud and sell it as a service.)
Two frameworks come to mind:
User mode Linux runs the Linux kernel as an application. This give you ultimate control over launching and managing the virtual machine from within a Linux application.
libvirt provides a toolkit for programmatically managing all manner of virtual machines.
These may both requires a Linux host. For other host operating systems, it may be necessary to manage the virtual machine manually -- or using ad hoc scripting.
QEMU can run a VM and it can be compiled on Windows and Linux and OSX. http://wiki.qemu.org/Main_Page
QEMU can be compiled as it is written in C++.
So in theory, QEMU could be embedded in a C++ program and used to run a Linux VM.
An example QEMU running Puppy Linux http://www.erikveen.dds.nl/qemupuppy/

Remote commands execution and file acces in Linux and Windows

Suppose I have a server application installed in a few Linux and Windows machines. Now I would like to control it remotely. That is, I would like to start and stop the application, update the application configuration files, reads the logs remotely.
It looks to be easy in the Linux worlds. I can use ssh, scp, and probably nfs to execute commands in remote Linux machines and access files there. The problem is that I would like to execute commands and access files in remote Linux and Windows machines uniformly from a Windows machine. I need also some scripting capabilities too.
What is the best way to do that?
You can try to use cygwin http://www.cygwin.com/ on your windows machines and install a ssh server with it.
If you need graphical tools, use VNC
there is an OpenSS implementation targeting Windows at http://sshwindows.sourceforge.net/download/
since there is (besides Cygwin/MinGW) no possibility to run bash code (ksh/csh/tcsh code as well) you should make yourself familiar with the windows scripting host.

Launching a program straight from OS

I am developing a program similar to xbmc but only for movies. I was wondering if there is any very simple operating system that will basically just boot and run the program I am developing? Similar to what openelec does for XBMC. I can run it on windows but I want to be able to put it on a machine like raspberry pi without having to have a whole windows or linux OS.
I hope that makes sense.
Take a look at the rather slim linux distributions specialized in embedded systems, like firewalling distros and so on.
Then, if it is a graphical application you have to make sure you boot into runlevel 5 (graphics) and configure your application as login shell for the default user.
You might also be interested in two services the openSUSE project offers: the Open Build Service (OBS) and SUSE Studio:
OBS allows you to automatically get packages of your application built and packaged, ready for use in a number of wide spread distributions.
Studio allows you to go a step further and create a custom distribution for your own purpose: you can call it 'your' operating system, completely preconfigured for your purpose, with all requried software and your own application installed. You just have to download a CD image afterwards!

Develop on Windows and running on linux machines

I need to develop applications for Linux but I don't want to either program on Linux (I already have all my "precious" tools setted up) or test it on Windows using some kind of POSIX for Windows and hoping that if runs well on that runs well on real Linux.
What's the better choice? Preferentially I want to use Eclipse IDE for compile/run/debug and run my programs on a Linux distribution that is running on a local VM or remote.
Right now I'm using a similar approach, but for Java Web Service testing on a remote server. Perhaps that's the way to go?
Edit:
In order to beter explain what I want, here is the steps that I want to follow:
Program in C, for POSIX compliant systems, using Eclipse on Windows
Make small tests on Windows, perhaps using Cygwin (this is not mandatory it's just to be quicker)
From my Windows Eclipse, I want to run/debug my application on a real Linux environment (could be a VM or a remote machine) and, preferentially, redirect the application stdout to my computer. The Linux machine only exists in order to garantee that everything runs ok, no need of even open it.
One thing that I didn't mentioned: all of the applications are command line, no need for GUI, just input from a shell and read the output.
First, install Linux in a virtual PC like VirtualBox or VirtualPC or something from vmware.
Then configure Eclipse for remote development. That allows you to run tools (like the debugger, the compiler suite, etc) on Linux from your Windows desktop inside of Eclipse. You edit the files just like you're used to, you debug as if the app was running local on Windows, etc. Eclipse will do the plumbing.
Remote server is the way to go. But most people have a powerful enough machine to run a 32-bit Linux distro in Virtualbox which is better than a real remote server because you have full control of setup and config.
But install cygwin including GCC and use that to run initial compile (and maybe unit tests) locally. Also, do use Valgrind on your Linux VM to help you produce cleaner code.

Resources