invalid option when trying to curl a file in linux and give it rights for execution and then move it - linux

I am trying to download the file that will install Mate UI and give it rights to the scipt file then move it somewhere else, here is the content of the script (onpurposely one script is calling the other due to provisioning limitations):
sudo curl --noproxy "*" "http://location/install-gui.sh" --output /tmp/install-gui.sh
#install Mate Ui on linux
sudo chmod 777 /tmp/install-gui.sh
sudo mv /tmp/install-gui.sh /opt/
sudo /opt/install-gui.sh
I get:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 440 100 440 0 0 2430 0 --:--:-- --:--:-- --:--:-- 2430
: invalid option

Related

Transfrer file from raspberry pi to file server on same network with python

I have a raspberry pi taking pictures, that is connected to the LAN. I want to automatically upload each picture file to a samba ubuntu file server I have on my network, so I can easily view them.
I have tried to get the command "curl" with no luck. (which I would run with subprocess in python)
This is my command that doesn't work (trying to copy test.png to destination directory):
curl -T "/home/pi/Desktop/test.png" "smb://10.51.112.128/home/thomas/thomasdrive/destination" -u thomas:87651234
I get:
% Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 curl: (7) Couldn't connect to server
I've been searching the internet for a solution, but nothing I try seems to work

how to run tar xzc /tmp command in windows

I am trying to run the following command in cmd:
curl https://data.keithito.com/data/speech/tacotron-20180906.tar.gz | tar xzC /tmp
But I get an error message:
tar: Error opening archive: Faile d to op%en '\\. \taTpe0'o
tal % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 74.5M 0 16073 0 0 14172 0 1:31:54 0:00:01 1:31:53 14198
curl: (23) Failure writing output to destination
How can you write a command identical to this in cmd and not in linux?

Cannot install rvm to HOME path on arch linux

My problem is that I can't install RVM to $HOME path. My OS is Arch Linux.
Single-user tutorial says (https://wiki.archlinux.org/title/RVM)
Note: This will install to your home directory only (~/.rvm), and will not touch the standard Arch ruby package, which is in /usr.
But in my case, when I was running
[*** ~]$ curl -L get.rvm.io > rvm-install
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 194 100 194 0 0 541 0 --:--:-- --:--:-- --:--:-- 541
100 24535 100 24535 0 0 52737 0 --:--:-- --:--:-- --:--:-- 52737
[*** ~]$ bash < ./rvm-install
mkdir: cannot create directory ‘/rvm’: Permission denied
But I don't want to install to /rvm directory, I'd like to install to my $HOME path directory.
Help me guys please. What am I supposed to do?

curl syntax error: append couchdb document failed with "conflict"?

I've installed couchdb and mingw64 on my windows 10, I can use futon to operate my couch db, no problem. Then I tried command line using curl.
I used curl to create database named "my_database", I can query it using "GET":
$ curl -X GET http://localhost:5984/my_database/002
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 81 100 81 0 0 397 0 --:--:-- --:--:-- --:--:-- 397{"_id":"002","_rev":"1-5e653801ca3cefde8abb6492ae3bcbcd","name":"mesi","age":23}
But I cannot do any data update, seems my curl syntax had problem:
$ curl -X PUT http://127.0.0.1:5984/my_database/002/msg.jpg?res=1-5e653801ca3cefde8abb6492ae3bcbcd --data-binary #/e/msg.jpg -H "ContentType:image/jpg"
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
14 910k 100 58 14 128k 58 128k 0:00:07 --:--:-- 0:00:07 125M{"error":"conflict","reason":"Document update conflict."}
I know the jpg file is there:
$ ls /e/msg.jpg
/e/msg.jpg
Why I cannot update the jpg document as attachement? I guess I might have some syntax error using curl or couchdb, but how to fix it?
Using futon_db: created document, but what's the URL resource name of it?
Whenever you update a document/Attachment in CouchDB, you need to specify the revision (otherwise it cause conflicts). I guess that you only forgot to write rev properly (you wrote res).
Syntax taken from this question :
curl -vX PUT http://localhost:5984/YOUR_DB/YOUR_DOCUMENT/YOUR_ATTACHMENT.jpg?rev=REVISION_OF_THE_DOCUMENT_BEFORE_UPLOADING_AN_ATTACHMENT --data-binary #FILE_ON_THE_DISK.JPG -H "Content-Type: image/jpg"

npm error-npm not found in terminal

Please help me to clear this error
Apples-Mac-mini:bin apple$ curl -L http://npmjs.org/install.sh | sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 193 100 193 0 0 244 0 --:--:-- --:--:-- --:--:-- 471
100 6711 100 6711 0 0 431 0 0:00:15 0:00:15 --:--:-- 5456
sh: line 20: npm-install-3294.sh: Permission denied
sh: npm-install-3294.sh: No such file or directory
rm: npm-install-3294.sh: No such file or directory
curl -L http://npmjs.org/install.sh | sudo sh
Note the sudo in front. The errors you get are due to installer trying to copy files to system folders, requiring administrative permissions.
Also, you do not actually need to install NPM, as it is included in latest Node.js versions.
To install Node.js on MacOS, refer to their official site.
To fix it, run sh using sudo:
$ curl http://npmjs.org/install.sh | sudo sh

Resources