How to download some files from heroku - json

I made one Dyno app in Heroku using node.js
that Dyno task is to collect data and create json file daily
but I don't know how to download them locally
I tried
http://myappname.heroku.com/filename.json
but failed
Heroku is new for me,so please don't treat me like advance user

You cannot do this.
If your code is writing a JSON file to the Heroku server daily, that file is almost instantly being deleted, so there is no way you can download it.
Heroku dynos are ephemeral. This means that any data you 'save' to the filesystem will be deleted almost instantly. If you need to save files, you should save them to a file service like Amazon S3 -- then download them through there.

Save your JSON file to /public folder.
Ensure that your app.js has the following:
app.use(express.static(__dirname + '/public'))
Now, you should be able to access:
http://myappname.heroku.com/filename.json

Related

Where does the downloaded file go when execute robot framework using Jenkins

I need one help,
I am Executing a script of robot framework using Jenkins, as per the flow the script should download one XLS and validate the data using Pandas.
When I am executing the script using Jenkins and searching the downloaded file in a hardcoded path i.e. "C:\Users\Administrator\Downloads" the file is not found.
but when executing it manually the file downloaded on the same path
Can anyone please help me by telling me where do Jenkins stores all the downloaded files?
PS : I am using Google Chrome as web browser
For each job Jenkins runs, it creates a workspace directory, usually at:
$JENKINS_HOME/workspace/(Name of the Job)
The scripts (and robotframework's in this case) are run there, as the root directory. Most probably the downloaded file will be in a path from there (or an error should have occurred because the Jenkins user does not have access to the C:\Users... path).
There is a step in the Jenkins job, which is to archive (download) files from workspace, to Jenkins database, to be shown as "artifacts". Even the screenshots images or videos recording, must be registered in that step, so they can be viewed on the Report and Log in Jenkins (Robot Framework Plugin).

IPFS file upload and view

I uploaded a pdf file to the IPFS de-centralised network. My question here. When I have the IPFS console and I couldn't view the pdf file anymore through the https://ipfs.io/gateway. Why is that? My understanding is once the file is uploaded to the IPFS network and the file will be distributed to the nodes.
Adding a file to IPFS via ipfs add <file> does not distribute it to the network (that would be free hosting!), it only puts the file into the standard format (IPLD) and makes it possible to access over the network (IPFS) as long as someone connected to the network has the file. When you first add something, that's only you. So if you close your laptop, suddenly the file is no longer available. UNLESS someone else has downloaded it since then, because then they can distribute it while your computer is off. There are many "pinning services" which do just that, for a small fee.
Hi Your understanding is correct,But can you tell me how are you uploading files to ipfs network there are number of ways to add data to ipfs network,
if you are able to add data to ipfs you will get the hash of the data, condition is daemon is running locally so that your data can be broadcasted to other peers you are attached to, you can check it by command: ipfs swarm peers
if above conditions are fulfilled you view/get data from https://ipfs.io/ipfs/<replace with hash you will get after adding>
if daemon is not running you can able to add you file and get the hash but you files will be saved locally, you wont be able to access it from web.
please let me know if you need other information

Why is Postman crashing right after startup

Postman is crashing about 5 seconds after starting. My last operation was a bulk load for ElasticSearch. The load worked as far as I can tell. Now Postman crashes. I have tried restarting several times, but all it does is hang for a few seconds and then crash.
I have Chrome version 56.
Postman version: 4.10.4
In case someone else is also facing this problem, Postman stores all its data locally in an application-specific indexed DB file. In my case also, the data got bit too large and postman started crashing.Following steps might help, they did in my case:
chrome://indexeddb-internals
Look for: chrome-extension://fhbjgbiflinjbdggehcddcbncdddomop
Under the "Paths:" section note the location of the chrome-extension_fhbjgbiflinjbdggehcddcbncdddomop_0.indexeddb.leveldb folder
Navigate to this location on your local system.
Copy this entire contents of this folder and save it to a safe location on your local system to be used later (your collections will be in DB file in this folder)
Remove the Postman extension from Chrome and then Re-Add the postman extension.
Postman should open but it will be default settings with none of your collections.
If you're in Linux just execute the following command from the terminal and start postman again
pkill -fi Postman
Go To:
C:\Users\%Username%\AppData\Local\Google\Chrome\User Data\Default\Storage\ext\fhbjgbiflinjbdggehcddcbncdddomop\def\IndexedDB\chrome-extension_fhbjgbiflinjbdggehcddcbncdddomop_0.indexeddb.leveldb\
Rename *.log files
And relaunch postman
I have deleted all files from the below folder and launched Postman. Crashing issue is solved. (To be on the safe side, I took a backup of this folder before deleting.)
C:\Users\%User%\AppData\Local\Google\Chrome\User Data\Default\Storage\ext\fhbjgbiflinjbdggehcddcbncdddomop\def\IndexedDB\chrome-extension_fhbjgbiflinjbdggehcddcbncdddomop_0.indexeddb.leveldb

Openshift application got error

I was created a PHP 5.4 application with Web load balancer and mysql 5.5 support on openshift free plan. My problem is when I login into my app via SSH delete the index.php file in app-root/runtime/repo folder (Openshift web folder) and create new test.txt file, my application doesnt show test.txt file. It still shows Openshift welcome page when I access my application.Then I delete test.txt file. The app-root/runtime/repo folder is empty. I tried create new file name 'blahblah' in runtime folder and access but still nothing, only 404 page. However, restart the application doesn't resolve the problem! The problem only happend when I add 'Web Load Balancer'. Without load balancer, my PHP app working normaly event I delete index.php file
When you use the "Web Load Balancer", it runs in front of your application and monitors which of your web servers are up and running. You can visit http://app-domain.rhcloud.com/haproxy-status to view the status of your backend servers. If nothing responds at the root context (/) of your application on the web servers, the haproxy thinks it is down and takes it out of rotation. You have to have something (even a blank index.php or index.html) page so that the haproxy will get a status 200, or change the url that is monitored in the haproxy.cfg file on your main gear.

How do you open a remote sqlite database over http?

Is it possible to open an sqlite file over http? I only need to read the db, and was hoping I could do something like:
var dbFile:File = new File("http://10.1.1.50/project/db.sqlite");
sqlConnection.open(dbFile);
Error #3125: Unable to open the database file.', details:'Connection closed.', operation:'open', detailID:'1001'
My situation calls for several apps compiled for various devices to share this file, which is served locally via wamp.
Zip your sqlite file from db.sqlite to db.zip. Load this zip file in flex using URLLoader and unzip it back in flex.
If not, you can also rename the file's extension to .xml, load it using httpservice or urlloader and once you get the result, you can rename the file's name back to .sqlite and start querying the file and it will work just fine.
There is no way you can achieve this over HTTP.
SqLite is a file and not a service/process that may be accessible via any port.
The best case scenario is when you have network access to the computer where the sqlite file is stored, like:
\\myserver\databases\mysqlitefile.db
...but this may work only on windows :(
You can adapt your code to use modsqlite http://modsqlite.sourceforge.net/#using
there's an apache module to allow remote sqlite access via http.
http://modsqlite.sourceforge.net/