MobaXTerm how to create your own plugin? - terminal

Problem
I see all these plugins from MobaXTerm, but I don't know how to make my own. I see no links to any tutorials or whatever. Is there even a way to do it?
What I really want (XY problem)
I want to create my own commands. I want these to be available on each server I go to and I don't want to add each of these to my bin and .bash_profile etc. I think plugin is the way to go.
Even more background
I am not that good in shell programming, but I can program java. I created a jar which handles my commands. So I have created my own linux script on my local environment to test all these things. They work, but I dont want to 'export' them to other servers. Seems like a bad idea to do.

MobaXterm plugins are just Windows or Cygwin executables packaged in a .mxt3 file which is just a standard ZIP archive with a specific structure.
Read this from the MobaXterm FAQ:
I would like to create a new plugin for MobaXterm. How can I do that?
Download an existing plugin file (for instance "Midnight commander")
Rename plugin extension from ".mxt3" to ".zip"
Open the ".zip" file You will notice that creating MobaXterm plugins only consists in putting the required commands (executables, libraries
and configuration files) into a ZIP file, keeping the same folders
tree than in MobaXterm ("/bin", "/lib", "/usr", "/etc").
If you want to add a simple Windows program (exe file), you will just have to copy the executable file into the "/bin" directory,
create the ZIP archive, rename it to ".mxt3" and put it in the same
directory than MobaXterm executable.
If you want to add a Linux program, you will have to get it from the Cygwin project or to recompile it using make, gcc, g++ or other
compilers that are available from the MobaXterm "Development" plugin.
Remember MobaXterm's terminal is just Cygwin, so you may be able to cross compile some packages within Moba by simply installing the necessary compiler tools.

Related

zipping on docker-remote-microsoft/dotnet/sdk6.0 bash

Somewhat new to docker so please bear with me. I'm working on a cicd pipeline, moving from building dotnet core 5.0 on a powershell image to building dotnet core 6.0 on an image with the bash shell microsoft-dotnet-sdk/dotnet/sdk:6.0 (https://hub.docker.com/_/microsoft-dotnet-sdk). I'd like to compress a the bin folder after the code is compiled.
Previously the contents of the compiled bin folder were zipped up using the powershell command Compress-Archive-Path. I'd like to do the same on the new build step, so the other existing steps in the deployment that are expecting a zipped file just work.
However, I'm unsure of the commands or other software I may need to put on the docker image. The "zip" utility I'd usually use on a unix box doesn't seem to be installed, or the path is something I don't expect.
The build service is isolated from the internet, but with minimal administrative steps I can put a package our local artifactory server. But I'm not sure of the commands (apt-get, yum, something else) to use or where to find a package I can setup and use (e.g. I'm pretty sure a zipped copy of the zip utility isn't going to help me).
Thanks!

How can I run Clozure CL in the Windows command line?

I'm trying to install Clozure CL using their guide, and it wants me to add the files ccl and ccl64 to my path, but they have no file extension and Windows doesn't know how to run them.
I eventually looked in the file and it was headed by #!/bin/sh. As far as I know, I would need external software to get these files to run.
I want to know if there is some other workaround for setting up Clozure CL more easily, and if there isn't, what would I need to be able to run these files directly from the command line?
It appears that all the scripts do is run the file wx86cl64.exe in the main ccl directory as long as you're on Windows. So, all one needs to do is add the ccl directory to their path to achieve success.

Copy python modules from one system to another

Is it possibe to copy all of the python modules from one Windows computer to another computer? They are both running the same version of Python 2.7.12.
The reason for doing so is that I have internet access on one of them, and manual installing modules on the other requires to much time because of dependencies.
I suppose you mean "copy the python installation from one system to another" (else the answer is: put your modules on a USB key and copy them to the other system).
the best way
The best way of course would be to install Python properly on the other system using setup. But as you said, all dependencies/external libraries that you could easily get using pip for instance would have to be re-done. Nothing impossible with a small batch script, even if you don't have internet, but you would have to get hold of all the .whl files.
the full treatment, portable-style
But if you cannot you can create a "portable" version of python like this:
zip the contents of C:\python27 to an USB key
copy all python DLLS: copy C:\windows\system32\py*DLL K: (if K is your usb drive)
unzip the contents of the archive somewhere on the second machine
add the DLLs directly in the python27 directory.
(those DLLs were installed in the windows system in previous Python versions, now it's even simpler since they are natively installed in the python directory)
The advantage of this method is that it can be automated to be performed on several machines.
There are some disadvantages too:
python is not seen as "installed" in the registry, so no "uninstall" is proposed. It's a portable install
associations with .py and .pyw are not done. But you can do it manually by altering some registry keys.
another method, better
You can have best of both worlds like this:
perform a basic install of python on the second machine
overwrite the install with the zip file
=> you get the registered install + the associations + the PATH... I would recommend that last method.
Last partial method, maybe best matching your question
Try copying the Lib directory only. It's where the libraries are installed. I'm not 100% sure but it worked for me when I wanted to put wx on a python install lacking wx.
Of course you will copy over already existing files, but they are the same so no problem. I let other people comment if this is acceptable or not. I'm not sure of all the installation mechanism, maybe that will fail in some particular case.
In my case, copy-pasting python installation didn't do the job.
You need to check the "C:\Users\\AppData\Roaming\Python*" folder. You may find installed python modules there. Copy and paste these into your source folder will add these modules to your python.

Creation of Windows executable file (*.exe) with PyDev-Eclipse and CDT-Eclipse --- How?

Is it possible to create Windows executable files for Python and C/C++ code within the Eclipse workbench? If yes, then how can this be done?
This is how I create .exe files from eclipse, in windows. Is not within the eclipse workbench but it might help you. To avoid problems, I would recommend to download everything for 32 bit even if you use 64 bit computer.
Install python 2.6
Install Eclipse
Install py2exe
In eclipse go to Help > Install new software and install pydev plugin from http://pydev.org/updates/
In windows preferences point the python interpreter to the location of your python.exe in your computer (C:/Python26)
you might need to add py2exe to the libraries
create a python module called setup.py with a code similar to this one:
from distutils.core import setup
import py2exe
setup(windows=['H:/yourworkspace/YourPythonProject/src/yourprogram.py'])
open windows console and type
python H:/yourworkspace/YourPythonProject/src/setup.py py2exe
this will create a .exe located in C:/Python26/dist folder. It should work if you double click it but you cannot take it to a computer without python or any of the libraries that you´ve used. To do that, you can use Inno Setup.
It's very easy to use, basically it will ask for the location of the .exe, the dlls and folders that you want to add (I don't know about this so I add most of the things inside my C:/Python26/dist and it works). Inno setup will create an script and generate a .exe that you can install in any computer. You might need to edit the [Icons] part of the script, I had problems with that before to add an icon to the application.
That should hopefully work,
good luck.
Not sure I understand what you're asking as you're mixing Python/C++ in your question...
If you want to embed Python in some library, Google for 'embed python in c++'
If you just want to package Python to run Python code with extension modules, search for py2exe or cx-Freeze (personally, I like cx-Freeze better).
I don't think any of this is PyDev/Eclipse dependent (this should be IDE agnostic).
In addition to Fabio's answer:
In terms of C/C++, if you compile it on windows, eclipse does create yourprog.exe file automaticaly in order to be executed (in case if you have your main function written in C/C++). Look for your executable in bin folder of your project.
In terms of compiler: I use Cygwin. It simulates Linux environment. It contains (not by default though) g++ compiler, which, because of cygwin, compiles it in binary that can be launched in Windows (i.e. .exe file). I am not sure exactly about whether Linux binary is then converted to Windows binary or it is directly compiled for windows, but I know that this .exe file alone works if you run it.
Let me know if you need help installing Cygwin.

How can I test my vim plugin?

Hi guys : I recently (accidentally) removed all folders/files from my .vim folder in mac os x (home directory).
I am trying to add in the Clojure Vim plugin (VimClojure) - its simply a folder which you are supposed to "drop into .vim/plugins".
I have added it, but I don't see any changes to the syntax highlighting when I launch vim. I'm not sure wether vim "sees" the plugin or not.
I'm on OS X .
Any ideas on how to debug the plugin ? In particular
1) How does VIM look for plugins ?
2) Are there files which need to be in $HOME/.vim/ ?
3) Is it sufficient to simply dump the unzip a new plugin file into $HOME/.vim/plugins when installing a standard vim plugin ?
Thanks
About debugging: in order to see whether vim has loaded your plugin you can use :scriptnames and also breakadd file /path/to/your/plugin (or breakadd file *your_plugin_name.vim: I never used absolute paths so I do not know what breakadd will do in this case). Other questions:
Described in :h initialization, precisely :h load-plugins.
Vim does not need any files at all (except vim executable, used shared libraries, dynamic linker and the kernel of course).
Follow installation instructions. Normally plugins are either extracted to ~/.vim or distributed as a singe file that should go to either ~/.vim/plugin (no s!), ~/.vim/colors, ~/.vim/ftplugin or such. I guess you should try to extract it to ~/.vim/plugin, but if archive contains some special directories like plugin/, ftplugin/, colors/, after/ (see /usr/share/vim/vim73 for a list) it is likely that it should go to ~/.vim. Also consider using vim-addon-manager, if plugin was posted on vim.org VAM is likely to be able to install it.
A few points.
How does vim look for plugins? See :help startup so see where and when vim looks for files to load.
Not really. Anything there is just personal customization. Vim will run fine without a .vim folder.
That all depends on the plugin. It sounds to me like the VimClojure plugin may be a little misleading. Do you have a link to the source you are using?
In any case, the first step I always take when attempting to debug a script is check the output of :scriptnames. This command will show you what scripts vim has loaded for the current session. If you see none of the files shipped with VimClojure, you probably made a mistake during the installation.
Another tip is that you really should look in to using a plugin manager such as vundle or vim-addon-manager, or at least the runtimepath manager pathogen. This seems to be the way of the future for vim configuration these days and it makes installing and managing plugins much easier. They also help to keep your .vim folder clean and organized.
The VimClojure directory should either be extraction on top of your .vim folder, or in a bundle folder if your using something like pathogen (which you should!). If you're starting from scratch, consider starting with vimclojure-easy (not to toot my own horn) which is a basic, full install of VimClojure with instructions.

Resources