Unable to download json data table - json

I'm trying to get/download data, seen on this page:
https://80.95.112.246/aplikace/monras/tabulky/svz.json?id=1159
using linux command line tools (ubuntu server, no display, no gui, remote ssh connection only). I've tried every possible tool without success (including PhantomJS). The only way I was able to get the numbers from the table was Firefox "save complete page" on a Windows PC.
Can someone help me with this? I need to store the table data in a text file on the server.

If your goal is simply to save the file onto the machine, run:
curl https://80.95.112.246/aplikace/monras/tabulky/svz.json?id=1159 -o svz.json
The downloaded file will be saved as svz.json in the current directory.

Related

How can I simulate clicking download button in terminal and download large gdrive file

I want to download a large file from gdrive in remote server. I can download the file in my Chrome via clicking download and confirm. My question is how can simulate the click download button in a terminal or a simple programming script so that I can download the file on my remote server.
Take an example of this file
I can check the Chrome network
(it does not work for gdrive, but works for some website) Though I do not understand why it works, I can use the feature copy as curl and get runnable terminal cmd to download some file.
Note
I find there is a good python package gdown and easy to use. However, for some large file, it can not work. For exmaple, this 500mb file.
For the large file, gdrive ask a another confirmation
It would be great if I understand how "download button" works and simulating click action in remote server.

Console command for opening files inside already opened project in PhpStorm

I've faced the problem. I use PhpStorm to edit files from FTP server using WinSCP client. In WinSCP client I've set command for using external editor. So, when I try to open php-file from remote FTP server WinSCP downloads this file in temporary file and open it using command provided by me - "C:\Program Files\JetBrains\PhpStorm 2020.1.1\bin\phpstorm64.exe" "!.!"
Earlier, when I used PhpStorm 2019 or 2018, it opened file in already opened window/project. But when I've upgraded to PhpStorm 2020, it started to open file from FTP in separate windows. It's so annoying and some functionality doesn't work in such case (auto suggestions and others).
I know that I can use built-in remote files browser within PhpStorm to view and edit remote files, but I accustomed to use separate FTP client for such purposes.
Does somebody know how to fix this problem? What console command should I use so as to open separate file in already opened window/project?
It's a LightEdit mode: https://blog.jetbrains.com/idea/2020/04/lightedit-mode/
Since 2020.2 you can use the -p (--project) option instead to force opening files in already opened project windows. For example idea -p myfile.txt. IDEA-237118
You can also permanently disable that mode by following these steps:
Invoke Help | Find Action... (or via Search Anywhere: use Double Shift and switch to Actions tab)
Search for Registry... action and select it
Once in the Registry dialog locate light.edit.file.open.enabled entry (just start typing, speed search will narrow it down) and set it to false (uncheck the box).
Not sure if IDE restart is needed (probably not).

Is transcrypt supposed to run from the local filesystem?

I've installed Transcrypt, compiled the Hello Solar System demo, and run it as instructed using the python web server.
However, I was also able to run the hello.html file directly from Chrome on Windows 10 ... once. Subsequently it refuses to run - the buttons appear but clicking them does not update the text.
------- EDIT ---------
Thanks - CORS is the problem - the browser must connect to a web server, not a file on the local filesystem.
You've probably run into a security policy of Chrome called CORS. Start a webserver from the directory where your html file is, using python -m http.server, and browse to localhost:8000. In your browser window, click on the html file and things should work.

How to allow-file-access-from-files in Chrome?

I am using Chrome to test some of my WebGL texture programs. According to the book 'WebGL Programming Guide', if I need to access files from my local disk, I should add the option --allow-file-access-from-files to Chrome.
How do I do that?
The short answer is DON'T
Open up a shell/terminal/command line and type
cd path/to/htmlfiles
python -m SimpleHTTPServer
Then in your browser to go
http://localhost:8000
If you find it's too slow consider this solution
The reason you don't want to allow file access is allowing it can be used to steal data from your machine. For example, you go to a site and download some webpage. You then view that page locally. With file access on that locally run page can now access all your files AND upload them to a server.

making an XML dump of a MediaWiki using dumpBackup.php

Using the MediaWiki maintenance script called dumpBackup.php I want to create an XML dump of my MediaWiki.
To do this you have to login to the server using an SSH client, I'm using Putty (Windows), but I also tried it on OSX using Terminal.
According to the MediaWiki Manual for dumpBackup.php this is done using these commands:
cd w/maintenance
php dumpBackup.php --full >d:\backup.xml
Since I am using GoDaddy hosting the last line is a bit different for me. The reason is that SSH for GoDaddy by default still uses php4 (unlike the HTTP server). For this reason my command is (assuming you are also in the maintenance folder):
usr/local/php5/bin/php dumpBackup --full >d:\backup.xml
The however, all this does for me is print everything on the screen and no file is created. Does anybody know why this is and how to make sure the file is created.
You left out the > from the original example:
php dumpBackup.php --full >d:\backup\dump.xml
The > tells the shell to redirect the output of the script to the file d:\backup\dump.xml instead of the screen.
By the way, d:\backup\dump.xml is a Windows file name. Since your server seems to be using a Unixish OS (probably Linux), you probably don't want to use that filename. However, if you don't mind having the file created in your current directory, just plain dump.xml will work fine on both Windows and *nix.
You could also try e.g. ~/dump.xml or $HOME/dump.xml (both of which create the file in your home directory) or $TMP/dump.xml (which creates it in the directory designed for temporary files, usually /tmp.) This could be useful if you don't have enough space available in the directory you installed MediaWiki in.
To see how much space you do have, try the commands df -h (which shows the amount of actual free space) and quota -vs (which shows how much of that space you're allowed to use, if that has been limited). For more help with these commands, try man df and/or man quota.