I have an old system which connects to my custom hardware that I will be delivering simple HTML out of.
If I wanted to waste electricity, I'd have two computers constantly running and then I can test my pages on the fly.
Instead, I want to do all my work on one computer my linux system.
Currently I can serve CGI pages through Apache in Linux and those are compiled C programs.
But because the target computer has Quick Basic and I compile EXE files through that language, I can do the same on my linux computer through DOSBOX.
The nice news is I can execute my Quick Basic program on a unix commandline via the linux WineConsole command and the output prints correctly despite the warning messages printed to stderr.
The sad news is I can't find a way to load my EXE as if it was part of a URL in a browser and have the same contents shown in the browser itself as what I saw on the commandline.
My only guess is to find a specialized apache module that can allow me to associate extensions with programs but I don't know of such a module.
Is there another way one can run an EXE file in linux apache and have the standard output contents dumped to the screen?
Have you tried using dosemu instead of dosbox?
If dosemu is able to output to stdout, you can wrap it inside a shell script that will be your CGI
If you aren't using DOS specific routines in your basic code, you might be better of compiling it as a linux executable using a basic compiler for linux.
You might want to look into this. I know there is a compiler called FreeBasic which should be able to compile QuickBasic code to a linux executable.
Related
I am writing a C# application (in Visual Studio on Windows) that will be run as a mono application on Unix (Raspbian aka Debian). I am a Unix noob, and though I have read (well, skimmed) the Linux Foundation Filesystem Hierarchy Standard I am still not completely clear on where I should put the files my application will need. I have:
The compiled C# application (app.exe). I thought I would put this in /usr/bin, except that the application is not run directly (it is invoked by "mono app.exe"), so maybe /usr/libexec is a better location?
Configuration files (there may be more than one) (app.1.conf, app.2.conf, etc.). If they are not user specific, I would think /etc/app (a directory, not a file) would be a good place for these. How about if they are user specific? /home/?
Log file (app.log). Seems that /var/log is the right place for this.
Thanks in advance for your input.
You should look at an already established Mono app for reference. For example let's take MonoDevelop:
The exe file goes to /usr/lib/{appnameinlowercase}/bin/ , but they place a launcher script in /usr/bin, named {appnameinlowercase}, for easy launch from the command line (this script just calls exec mono YourAppName.exe).
In .NET the config files need to be in the same directory as the executable file, so you could place them in /usr/lib/{appnameinlowercase}/bin, then later for convenience, put symlinks to them from /etc/{appnameinlowercase}/.
Correct, /var/log/{appnameinlowercase}/ should be fine.
For part of a large university project I have built a large java based application. To make "installation" cleaner I am aiming to write a script to copy the jar to a hidden file in the users home directory then add a menu &/Or desktop launcher.
Since I do not know what platform the markers shall be using it seems sensible to make this generic so I was going to build a shell script and a batch file.
The shell script starts off simple, check the directory doesnt already exist, make it and copy the file accross.
Then it comes to making a launcher of some kind. I presume each desktop environment shall do things differently.
After 10 minutes with google it seems everything suggested is autotools but since I have no knowledge of this it seems a bit overkill.
Is there an easy way to achieve what i need?
Thanks
These days, basically all of the desktop environments uses desktop files. For the specification for those files, see the Desktop Entry Specification.
Normally, they're put in /usr/share/applications on the system. Those files are then read and used to construct the menu.
If you have the ability to write to the system /usr/share/applications directory, that's obviously simplest, but if you had that, you would probably be putting the JAR file somewhere other than a hidden directory in the user's home directory.
If not, the path that's supposed to be honored is ~/.local/share/applications. If you drop a desktop file in there, it should show up for the user. (This is somewhat newer; I don't think GNOME 2 supports, it for example. Older desktop environments had various special places for these files.)
Then, the problem basically reduces to figuring out what to write for the Exec line in the desktop file. (See the desktop files on your system in /usr/share/applications for some examples.) If you're lucky, you can get away with just sticking a java command in there, but the details will depend on your application.
I have a project that i set up in eclipse . Everything works fine except that i have to keep going back to my terminal to use the proprietary versioning system we have here. Is there a way for me to use to issue linux shell commands from within eclipse ?
Is there like a generic plugin that executes linux commands or will i have to write my own plugin to do this ?
Thanks !
You can use Run>External Tools>External Tools Configurations to create launch configs that will execute commands (usually via System.exec(*)). You can use executables directly, or execute scripts via an appropriate interpreter (like /bin/bash /lib/myScript.sh)
PW
You can use the Remote System Explorer (RSE) framework provided under the Target Management project of Eclipse for accessing a remote or local machine from a shell.
Although the name might suggest that it might not be useful to run local commands, it is very well possible to do so. If you have to connect to remote systems from Eclipse, then it would be the suitable plug-in to use.
I wrote a Qt application that is going to run on Linux. It supposed to run at startup.
It's supposed to run on every Linux- Suse, RedHat etc.
What script should I write and Where to put it?
I don't know how to write scripts at all, so I would appreciate it if you will attach an example.
You need to create a desktop entry file for your application (see here) and to put it in user's $HOME/.config/autostart directory.
Any desktop entry file in that dir will get executed when a Window Manager starts up (see here).
To do this, usually you'll need to create your desktop entry file by hand (that's it, not via C++ code/script) and to just install in that directory via C++ code.
I want to open html files from a shell script. I know that Ubuntu has a command x-www-browser that will open the default browser on the system. I also found via some Googling that the command is part of the debian system. I was wondering if the command is available on non debian based distros. If it isn't is there a standard way of opening an html file in the default browser on a linux OS via command line? Note that I'm using Bash.
If you are wanting to open an HTML file that is local (and maybe even remote, I'd have to check), you can use xdg-open. This is the rough equivalent to "double-clicking" on a file to open it, so it's not limited to html files. Since you want to always open in the user's default browser, this would be the same as if they just opened it themselves.
Of course, if they have their system set up to have HTML files open in a text editor (like I did for awhile), this would backfire. But that's pretty rare.
Quick update
I just checked and xdg-open http://google.com brought up Google in Firefox (my default browser). So it does work for non-local files.
You could use xdg-open.