Sublime Text auto touch and upload file - flask

I'm using Sublime text with the FTPSync plugin to develop a Flask web application deployed by Phusion Passenger.
Due to the way my web application is cached on the remote server, whenever I make a change to my actual web application I also need to change the last modified date on a file in Flask's '/tmp' folder on the web server in order for changes to my other web application's files to take effect (this based on advice from How do I clear the cache of Ruby Phusion Passenger in Ubuntu?).
Currently I have a 'restart.txt' in my web application's '/tmp' directory which I 'touch' (add a char/remove a char, then save) and then upload using FTPSync which causes the other changes I've FTP'd to the server to take effect.
I'm looking for a way to automatically touch that 'restart.txt' file and upload it whenever a file in my web app project is uploaded (currently anytime I 'save' a file).
Is there any way in Sublime Text 2 to script an action to automatically touch + upload a file and have that script run whenever a file is being uploaded?

Related

How to download files onto personal computer from EC2 without knowing file name?

I want to use selenium to log into a private database and download some files. I can already do this via a python script that will launch a new chrome window (via selenium) and automatically download the files I need locally.
My python script uses selenium. Once the python script is run, it launches a google chrome window, which selenium then does some automatic clicking on to download files.
Now, I want to deploy my code to a web application so that I have a website online for others to use. I have my script on an Amazon EC2 instance and I call/invoke my script whenever a user on my website clicks a button. However, the files are downloaded onto the EC2 instance. I need these files to be downloaded on the person's personal computer after he clicks my button on my website.
Is there a way to achieve this, either by re-directing downloads? The file names are not known at runtime.
In summary, I have a script (which downloads files) on EC2 that is invoked when my button on my website is clicked. But I need the downloaded files to go onto the user's computer, not the EC2 instance/terminal.
Thank you in advance!
However, the files are downloaded onto the EC2 instance. I need these files to be downloaded on the person's personal computer
No there is no way to redirect downloads from an EC2 instance in the same way that you can't redirect downloads normally outside of AWS anyway.
When you download a file, you download it to the machine that requests the download.
Perhaps try returning the download URL in some way back to the UI and trigger the download yourself on the machine (if the URL does not need credentials). Or download the file, reupload to S3 and create a pre-signed URL that you can return to the UI.

Python Flask application host in IIS with fast cgi process

Please guide me how python2.7 Flask framework application host in IIS with fast CGI process. I searched so many ideas on the internet but it doesn't help me till now. Anyone can give me simple process to do it and if you have video tutorial then please share the link of it. Some trial I want to specify,
Install IIS feature 'on' like CGI
Create Virtual Environment and link to physical project folder
Convert to Application
select application --> Click on Handler Mapping--> Add Script Map and input required data like *.py, python27.exe %s %s --> ok
Placed all .py file in 'cgi-bin' folder
convert into application
Edit in 'C:\Windows\System32\inetsrv\config\applicationHost.config'
Open application in browser with sample py application like print 'Hello'. Getting output as I mentioned in sanp.
*** First I tried with simple application then I want to host Flask Framework.

Can Jetty hot redeployment work without service interruption?

I'm running a web app with Jetty 9.0.5 (I could update, 9.1.2 is the latest as I write this). I have the usual web app deployer as described in the Jetty docs and defined in etc/jetty-deploy.xml. I use a Jetty xml file to define my web app context, so when I push new code to my production server, I upload a new myapp.war file using rsync and then touch that myapp.xml file. This works pretty well, but there are few seconds where the app throws a NullPointerException or other weirdness, and some users appear to be getting corrupt statically served files (.js files from the war), so that they have to flush their browser's cache for the app to work again.
Is this supposed to work perfectly, or do you expect a brief dead period like this?
I don't put the myapp.war in the webapps directory (only the the myapp.xml is there) and explodeWars is true in the deployer.

JAR file in Web page execution

Can java application run within web page?
If i create a .jar file and i want it to place it on my website then can it be made available to run in the web page itself i.e. like an applet? Or it can be made available as a downloadable item?
The only way I can think of is using Java Web Start, it will allow you to launch fully-featured application from the Web Browser. It doesn't allow you to run it like an applet but it allows that the end user runs a full java app without needing to install it.
Index of JWS.

loading gwt app from django

I am trying to load a google web toolkit application with django, but the gwt host page does not seem to work (just a blank screen) when I invoke it with render_to_response() from my django view. I have verified that a plain hello-world html file loads fine from the gwt war directory, so it's not a path issue. Also the host page renders if I manually open it in a browser. I am running my django app in development mode using manage.py runserver. Any ideas?
When you say you've tried it manually within the browser - is that over HTTP or file:///
Does sound like a path issue, TBH. Have a look in Safari or Firebug to see the HTTP activity when the host page loads. The 'nocache' JS file you include the in the host page loads the appropriate compiled JS for that user agent. Maybe it can't find JS.