How to run windows batch file containing OpenSSL encrypt file command from a Windows Service application - windows

We would like to make some Postgres databases backups from a windows service application, using OpenSSL app to encrypt those files. To accomplish that we use a batch file, containing that command lines. If we do it in two steps, first we make the backup file and after that we want to encrypt it or even when we include in Postgres "pg_dump" instructions it doesn't work, I presume because the service app is running as SYSTEM. If I run the same application as desktop mode it works fine.
Is there any workaround that can help us to do that?
Thank you. Regards.

Related

Can't save a temporary csv file to /home/app directory on heroku using R shiny app [duplicate]

I published my first simple app on Heroku with a free dyno. This app writes a simple .txt file, that seems to be correctly written because my API services are working fine.
But if I try to check this file by entering in the file system using "heroku run bash -a MYAPP", I can't see that file in the folder I thought to see. It is like the file is not existing. Can someone tell me why?
Thanks.
I found this on https://devcenter.heroku.com/articles/active-storage-on-heroku:
In addition, any files stored on disk will not be visible from one-off dynos such as a heroku run bash instance or a scheduler task because these commands use new dynos.
It is still not so clear to me, but at least I know it is a normal (but strange) behaviour of Heroku!

Downloading a file created from console output in PuTTY

So my class Project3 prints a load of data to the console of PuTTY when I run it, and I've used "java Project3 > variance.data" to create the file variance.data in the pwd.
I think this has worked because when i use "ls" variance.data is there.
However I want to save this file onto my computer, how do I do this?
You can use PuTTy Secure Copy to download the file.
Open CMD on your Windows machine and use the following command:
pscp <user>#<Remote Server IP>:/path/to/file .
You will then be prompted for the password of the user you are trying to connect as.
You can use FileZilla to connect to the server with your credential (the one you use with PuTTY) and then download the file you need only double-clicking on it. In the image you'll fine it in the 5th rectangle. At the same way, you can easily upload a file double-clicking on in the 4th rectangle.

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.

Pack setup files to single executable setup

I have an old setup of the old program written on c++ which contains multiple installation files files.
_SETUP.1
_SETUP.DLL
_INST32I.EX_
_ISDEL.EXE
SETUP.EXE
DISK1.ID
SETUP.INI
SETUP.INS
_SETUP.LIB
SETUP.PKG
I want to combine all that in to single executable file and i want to execute SETUP.EXE when user would run that single executable. Is it possible to achieve somehow?
The easiest way is simple create archive and say to user to to unpack that and to run SETUP.EXE but i am just wondering may be i can create setup like i describe above.
IExpress.exe is ideal for your job. Google for samples. It is included in your Windows installation. Just open a Command Prompt and type iexpress.exe - this starts a wizard that helps you getting started.

Remove execute permission on file downloaded on a Mac

We have a web app running on a Windows server, which allows a user to do some processing and download the results. The result is a set of files which are dynamically created on the server and zipped into a single file for facilitating the download process.
Everything works fine on Windows, but when users download the file from the web app on a Mac, the contents of the zip file have the execute (chmod +x) permission set (I presume that the same happens on *NIX and Linux machines). This can, of course, be removed by running the 'chmod -x' command, but is there a way by which one can remove the execute permission on the files, so that when downloaded on a Mac, the files don't have the execute permission set by default?
I believe it's not possible - .zip files don't contain permissions, so on a Mac it has to default to "most permissive" (otherwise it's possible that there are applications inside the zip that wouldn't be marked as executable when they need to be).
tars, for instance, do record permissions, but that'd be a bit more difficult to create on a Windows server.

Resources