ruby - copy a jar from linux to windows server - ruby

We are having a linux build server and the build scripts are written in ruby. All the jars are deployed on linux servers only and are generally copied to the application servers using ssh.
There is a new service which needs to be deployed on a windows server. Is there a way to copy and configure the jar deployment from the linux machine to the windows server.
Using ruby / shell scripting?

If you are already using SSH in your build script I would think the easiest thing to do would be to install an SSH server on the Windows box. You can use sshd via Cygwin or opt for a commercial product like WinSSHD (I'm sure there are numerous other free or paid products out there).
Once you have that running you can more than likely reuse most of the existing script relating to moving files around and use a gem like Win32Utils to do any windows specific tasks.

Related

"Failed loading ClientOU certificate at ..." while running a Hyperledger Fabric sample "Building Your First Network"

I'm trying to test my development environment and keep getting this error while going through the "Building Your First Network". I've installed the prerequisites on a Windows 10 Home edition so I'm using Docker Toolbox. The error is described as follows and happens just after a execute the ./byfn.sh up -l node command:
2019-11-14 17:06:26.982 UTC [msp] loadCertificateAt -> INFO 002 Failed loading ClientOU certificate at [/var/hyperledger/orderer/msp/cacerts\ca.example.com-cert.pem]: [could not read file /var/hyperledger/orderer/msp/cacerts\ca.example.com-cert.pem: open /var/hyperledger/orderer/msp/cacerts\ca.example.com-cert.pem: no such file or directory]
As you can see there is a backslash just before the ca.example.com-cer.pem which I think is causing the problem. Anyone have an idea of how I might solve this issue?
Docker Toolbox for windows doesn't provide a great experience for users. It's limited in how it can share windows directories with linux containers running in the linux VM it creates. I believe it can be made to work but you have to use very specific folders in your home directory and you would have to google it to find all the details but it's a lot more of a hassle.
You have other options of course
Upgrade to Windows Pro and use Docker for Windows (which doesn't have the same sharing limitations, but still not a great experience and you can still encounter problems sharing the directories)
Install a hypervisor such as virtualbox and run a linux desktop distribution such as ubuntu or mint and use that instead (which I would recommend and would suggest ubuntu 18.04 mate edition)
Wait until next year when hopefully microsoft will release WSL2 for everyone (including home edition) and then Docker won't need a linux VM running and it should be a much better experience trying to run linux containers on windows.
As mentioned by lindluni here
Backslash problem in Hyperledger 2.0.1 when orderer/peer look for .pem files
the problem arises when one creates crypto artifacts under Windows since "golang filepath.Join uses the current OS's filepath scheme". Hence, under Windows backslash is used in all the generated config.yaml files found in crypto-config/*. One can replace this backslashes before the deployment to fix the issue.

How can I easily host a CGI executable (.exe) file locally on windows

I have been able to make Common Gateway Interface (CGI) executables work in IIS / IIS express in the past, but its a real faff and always takes a lot of trawling through the internet and trying lots of things, and it seems to change a bit in each version of IIS.
Is there an easier way?
If you have Python installed, you can run this from the command line:
python -m http.server --cgi 8000
You will need to run it in the directory that the website is in, and the CGI executable should be in a cgi-bin sub directory. More details on the Python Website
If you haven't got Python installed, it is probably easier to install it, than it is to get IIS working.

Install Elasticsearch Service in Linux

We are developing a java (spring boot) based software which depends on Elasticsearch. Right now we integrate elasticsearch via maven (as artifact).
This version seems to be the same as the .zip / .tar.gz version from the elasticsearch website.
As I have noticed there is a service installer for windows (x86 as well as x64).
But it seems that there is no "service installer" for linux in this package. I can use "./bin/elasticsearch -d -p pid" and the corresponding "kill cat pid" command to start/stop elasticsearch but it would be nice to have some form of service installer in this package as well so that elasticsearch is started automatically after an OS reboot.
I know the necessary files for systemd and init.d systems exist (at least in the .deb and .rpm package versions) so I assume it is not such a big deal to have a service installer in the artifact/zip/tar.gz version as well.
Am I right or do I underestimate this issue?
If there are the init.d files already, all you need to do is create the shortcut in rc.3 or rc.5 folders. Using redhat distros you'd simply do:
$ sudo chkconfig elasticdaemonname on
But that's assuming it is a daemon. If not, you'll have to daemonize it yourself. There are various possibilities to do this and I'm ready to bet all of them are documented for elasticsearch. But you could look for daemonize for start.

VirtualBox: How can I run an application in my host environment

For instance, I have a virtualised Linux-box running in my windows environment, and I have a shared-folder mapped to /vagrant and in that shared folder I have readme.txt. Is there a command I can run from within the virtualised OS to pop up readme.txt in my favourite text-editor in the windows host environment?
In a nutshell I'm just wondering if there is a standard way to invoke a host command from the guest.
I'm thinking an analogue of the cygstart command that cygwin provides, perhaps a part of the guest additions package.
This seems like it should be a well trodden path, since its highly likely a guest might want to communicate with its host in certain configurations.
Looks like somebody wrote a tool for this https://github.com/marcosdiez/openfile
Unfortunately it looks like there isn't a VirtualBox API for this so he has to run a server in the host:
it is necessary to run a C# server on Windows which accepts and runs
remote commands from the Unix box.
Should do the job though!

Reconcile PuTTY and OpenSSH with git remote URL

On a local development machine, I use Windows and PuTTY, with a linux server VM that I use to replicate the development environment for things like running tests and so forth. The VM (VirtualBox) uses a vboxfs share that contains my local projects.
I have set up msysgit on my machine to use PuTTY, my preferred SSH client, and that all works fine. Unfortunately, when I set a git remote URL, it has to use PuTTY's format to specify a session (ssh://<session name>/<repo>) in order for msysgit to work, which means none of the git urls work in the VM environment. This isn't a huge deal, but I was curious: Is there a way to reconcile the two configurations so I can use git commands in either environment without manually setting a remote url each time?
One work-around is to install PuTTY on your Linux machine. There are several precompiled versions out there or you can just download the official source and compile them.

Resources