Modify an etherpad instance with command line tool - html

Most instances of Etherpad accept setting the entire file by uploading an HTML file. Is there a way to automate this process with a command line tool such as cURL ?

You can use the HTTP API to create or change the content of a pad. There are several client libraries available.

Related

Error `Unable to find a template property named $schema.` when trying to decompile JSON into Bicep

I'm playing with Azure Bicep and I was expecting that I can take practically any ARM JSON template and translate it into Bicep. I'm intentionally using the word "translate" instead of "decompile" here, because the JSON template was not originally created with Bicep, so it was not compiled from Bicep to JSON in the first place.
I'm creating a VM deployment in the Azure Portal and when it's successfully deployed I download the JSON template (deployment.json and deployment_operations.json).
Then I run the following command:
bicep decompile deployment.json
The command fails with the following error message:
/deployment.json: Decompilation failed with fatal error "[1:1]: Unable to find a template property named $schema."
What should I do to resolve this error?
Bicep CLI version 0.13.1 (e3ac80d678).
PS The VM deployment is the simplest possible Windows Server VM with no data disks and extra features. Created via Azure Portal by clicking Next-Next-Create.
It appears that I've found the solution when writing the question. I was downloading and trying to decompile a wrong file.
The problem was that I was downloading the deployment.json file instead of an actual template file template.json. You need to click Download on the Template tab.
So instead of downloading the from the Overview tab, click the Template tab and then click Download. Or use the Save-AzResourceGroupDeploymentTemplate PowerShell cmdlet.
Similar problem, same solution: https://github.com/Azure/bicep/issues/5237

Save Databricks notebook as a HTML file programmatically

I searched many threads in different forums but unfortunately did not find a solution to my problem.
I would like to save my Databricks Notebook after executing it as an HTML file with the output of cells.
I know there is an option to save the file manually using File >> Export >> HTML, but is there an option to use some method in the last cell that will do this without manually clicking?
I mean something similar to:
!jupyter nbconvert your_notebook_name.ipynb --to html
Thanks for any tips!
If you run similar code in the notebook, will be then exported to the local disk of the driver node not to your computer, as code is executed in the cloud.
One approach to get it as HTML to your local disk, is to use Export command of Workspace REST API or corresponding command of Databricks CLI

Unable to download json data table

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.

Uploading a file through CKAN's API (1.8): How to do it?

I am trying to automate dataset and resource uploading in my CKAN instance. I am using Ubuntu Linux 10.04 64-bit and my CKAN instance version is 1.8.
I can create a new dataset using the command like like so:
$ curl http://ckan.installation.com/api/rest/dataset -H "Authorization:<my api key>" -d '{"name": "dataset-name", "title": "The Name of the Dataset"}'
{... JSON text recieved in response, including the id of the dataset ...}
Now, how do I go about creating and uploading resources (like image files) in my CKAN instance using the command line?
Thanks!
Uploading a file through the FileStore API is somewhat complicated. You'll be better reusing ckanclient's upload_file method. A simple Python script that uses this could solve your problem of uploading from the command-line.
Or, if you're feeling brave, that's the best place to start understanding how to upload a file using cURL.

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/