start/stop .sh file for .jar file - centos

I have a file JTS3ServerMod.jar that i want to be able to start and stop via ssh (centos) so the command would basically be ./JTS3ServerMod.jar {start|stop|restart}
how would i do this? I tried to look at how the teamspeak startscript work but was not able to convert that from starting a binary to a .jar file.

Related

Where to put Play package for console to recognize command?

Download binary packages on https://www.playframework.com/documentation/2.0/Installing gives me a play-2.0 folder with play exec file. However running play on that same directory using console returns
play: command not found
My environment is MAC and I tried
chmod a+x play
while running into the same problem
Can someone give me a guide on the installation process?
When we run a command, the shell look for this file (command) in a list of directories (folders). This list of directories is stored in a enviroment variable called PATH. If you want to see the values inside PATH. You can run:
echo $PATH
Note that the folders are separated by :.
The problem you are facing is because the shell can't find a dir that contains the file play. This happens because the play's dir is not in PATH
You can add play's dir to your PATH by running
export PATH=$PATH:/path/to/your/play/dir
This is a temporary thing. After you exit your shell session you will loose it. To make it permanent you need to edit the .bash_profile file in your home folder and add this command in the end of the file and save it.

Jboss CLI Command to list the last file in a directory

I need the Jboss CLI command to list the last file of a directory. For eg, I have the directory contains two files
helloworld.sh
helloworld1.sh
I Want a command to list only the last file.
JBoss CLI doesn't support listing files itself AFAIK.
Nevertheless, it seems you use the Jython, so you could use its own way to do what you need. Something like:
import os
os.listdir("/path/to/folder")[-1]

How to install liquibase on redhat linux

Thought this might help others. If you are running a headless VM it might not be immediately evident how to install liquibase. I was using a redhat linux box and wondering which command to try to install liquibase.
If you have access to another computer with a browser. Go to http://www.liquibase.org/download and copy the path to the liquibase zip file. Paste that path onto a wget command as in the example below
wget https://github.com/downloads/liquibase/liquibase/liquibase-2.0.5-bin.zip
unzip the zip file in the location of your choice such as ~/liquibase
Once you are done you will have to manually create your liquibase.properties file.

Copy Directories Recursively From Ftp Server Using Perl

I need to write a perl script which has to log in to an FTP server and download all the sub-directories and contents on sub-directories to local machine. The version of Perl on the FTP server is 5.8.8, i can't upgrade it. One method is to create directories on local machine and then copy each file. I was wondering if there is any command to copy a directory and its content. Is it possible to "tar" the directory to save space?
Thanks,
Amit.
There is Net::FTP::Recursive. I haven't tried it but it seems to fit your requirements.

How do I unzip a .zip file in a remote directory using NAnt ftp task?

I have a zip file in my ftp server. Is there any way to unzip it using NAnt?
Here is a sample code of what I would like to do:
<ftp connection="liveAuditToolConnection" remotedir="/remotedir">
<unzip zipfile="backup.zip"/>
</ftp>
Suppose that the backup.zip file already exists in the ftp server.
thanx:)
NAnt does not support remote operations. If you are running on a Windows system, trying looking at PSExec