Debug springboot application by running .sh file using IntelliJ - spring-boot

I have a springboot application that has a local.sh file which contains some exports and mvn path, application jar paths. To run the application, i run this command in terminal './local.sh' (I use Mac).
I want to run my application in debug mode.
Tried with this approach, but application still running in run mode.
Added new Shell script configuration, gave the script path and in Script options entered 'set -x', gave the working directory. After this configuration, clicked on debug icon.
Is there any other way that i can run springboot application in debug mode by running .sh file?
Please let me know if you need more information.

Related

How to run java application automatically when EC2 instance starts without having to run it manually with java -jar file_name-SNAPSHOT.jar?

I tried the following steps but when I access my application in the browser using the url link, it returns a blank page. Here is what I did:
Copy My jar file to /home/ec2-user/
cp myApp-0.0.1-SNAPSHOT.jar /home/ec2-user
Next, I opened the rc.local in the VI editor and appended myApp-0.0.1-SNAPSHOT.jar
vi /etc/rc.local
#
#
#
#
touch /var/lock/subsys/local
//Append the below command:
java -jar /home/ec2-user/myapp-0.0.1-SNAPSHOT.jar
/:wq
Give permission to the symlink by running the following command:
chmod +X /etc/rc.d/rc.local
So I stopped my ec2 instance and after a while, I started it again to see if I was able to test my endpoints without having to manually run my appl with java -jar myApp-0.0.1-SNAPSHOT.jar But it did not succeed. I was told this way of doing is now obsolete. I also tried to follow the following link but the file naming was not obvious to me so I messed up some steps and got to the same result: failed Please can anyone direct me? Thanks! I tried the following steps but when I access my application in the browser using the url link, it returns blank page.

How to run Meteor.js locally but connecting mongo to mongodb.com in Windows

I have a Meteor app deployed on AWS using database from mongodb.com, and it's working fine.
now I want to be able to work with the same database instead of local when I run my app locally for development (along with my settings.json). I tried everything but the problem is all solutions work on none Windows machines.
here is the latest command I tried but nothing happens:
set MONGO_URL=mongodb://<username>:<password>#<mydatabase>.mongodb.net:27017/meteor meteor --settings settings.json
what's the solution?
I ran into this issue as well, the solution that worked for me was to create a BAT file within the root project folder containing the full run command for Meteor.
In the root directory create a bat file such as run.bat
Edit the BAT file to contain your Meteor start command:
SET MONGO_URL=mongodb+srv://username:password#production.mongodb.net/root meteor run --settings settings.json
Run the file.

GCE Windows startup Script is not running

I have a simple Django code which I want to keep running on a specific GCE instance. Sometimes the instance gets restarted due to some reasons, not in my control. I created a batch script which I tried to put in Startup folder in both users and common folder. It didn't work. I tried putting the script in using sysprep-specialize-script-url(using cloud storage), sysprep-specialize-script-cmd and sysprep-specialize-script-bat. It didn't work. Here's the content of the batch script -
cd C:\Users\kartik_domadiya\Desktop\happierMiscGoogleCloud
manage.py runserver 0.0.0.0:80
pause
I tried running C:\Program Files\Google\Compute Engine\metadata_scripts\run_startup_scripts.cmd manually and it worked (with any metadata key). So I can see that there's no problem with the script itself.
I even tried with putting the batch script in task scheduler which didn't work too.
So is there any way I can debug the problem and find out why isn't the batch script working? I am using Windows 2012 R2, if that matters.
PS: I know that's a development server and should not be used in production.
I moved the code to C:/code (basically out of any particular user's folder) and then provided all user its access (Right Click > Properties > Security), updated the batch file and put it into startup folder (Run > shell:startup).
It started working after that. I suppose the issue was due to access permission.

How can I make a batch file that runs an exe at startup by adding it to windows registry?

I got a python app, i compile it with pyinstaller and works perfectly, i got the file "MyApp.exe", but i want it to run at startup by adding the app to the registry, using the os.system module, that allows me to run batch commands.
How can I make a batch file that runs an exe at startup by adding it
to windows registry ?
Supposing that the exe is calles "MyApp.exe" and is located in D:\\Apps\, how can i get it done ?

command not found in jenkins running on Mac machine

I predominantly work on windows OS and quite new to MAC systems. I am trying to set up Jenkins CI tool on one of the MAC machines, I have installed jenkins on mac and it is running on 8080 port.
Issue: I am getting the following error on Jenkins console output when i execute the job:
**/var/folders/zz/zzzivhrRnAmviuee+++++E++++2/-Tmp-/hudson6910375920437308281.sh: line 13:
**ampts: command not found**
Build step 'Execute shell' marked build as failure**
Things I tried:
I added the correct path in .bash_profile and since then I am able to successfully run the ampts command from terminal and every thing works fine from terminal. But the same does not run from the execute shell in Jenkins which is running on MAC.
Earlier the job was running as anonymous I created the account in jenkins and placed .bash_profile with the correct path under ~jenkins/users/home/my.account and restarted jenkins but still I am facing the same issue.
I also tried placing .bashrc under ~jenkins and also under ~jenkins/users/home/my.account but still no success.
Can some one point out what I am missing. or what needs to be done in case of Jenkins running on MAC.
This will depend on how you've started the Jenkins client. If you start it from the command line with the javaws command then I think this will inherit the environment variables of the terminal prompt. If you start the JNLP agent from the browser then it will inherit the system environment (which is different to the bash environment). There's a few things you could try:
Set the PATH variable explicitly in the ~/.MacOSX/environment.plist file (see the Apple docs)
If you are using Ant to run the jobs then you can add the environment variable to the ~/.antrc file (same syntax as the .bash_profile)
Set the environment variable in the Jenkins configure page for this node.

Resources