Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

New answers tagged

0

Done by using python too import re p=re.compile(r'[0-9]*\.[0-9]*\.[0-9]*') k=open('filename','r') for i in k: h=re.search(p,i) print h.group() output 192.23.39 192.23.39


0

Done by using sed command and it worked fine command sed -e "s/.*\:\///g" -e "s/:.*//g" -e "s/\///g" filename output 192.23.39.2 192.23.39.2


1

2 solutions to this : you can create a shell alias such as : alias curl='curl --proxy http://[host]:[port]' or define the proxy settings in a cURL config file : echo 'proxy = [host]:[port]' > ~/.curlrc I've not been able to make this work using environment variables. NB : your configuration defines HTTPS_PROXY and HTTP_PROXY both as uppercase and ...


0

Since you are using Bash, you may leverage associative arrays (introduced in bash-4.0-alpha1). You can define the script: #!/bin/bash declare -A urls urls[dev]=dev.example.com urls[tst]=test.example.com request="$(curl ... https://"${urls["$1"]}"/foo/bar ...)" And invoke it as: script dev The first positional parameter ($1) will be used as the key ...


0

W: Failed to fetch http://debian.mirrors.ovh.net/debian/dists/jessie-updates/InRelease Unable to find expected entry 'main/source/Sources' in Release file (Wrong sources.list entry or malformed file) You should remove the jessie-updates from your /etc/apt/sources.list: deb http://debian.mirrors.ovh.net/debian jessie main deb-src http://debian.mirrors.ovh....


0

Well, not sure if you did run correctly your command as everything is in one line apt-get clean apt-get update apt-get install php-curl if you run apt-get upgrade this will upgrade all the package on your system, not install curl. But it's something to do anyway to keep your system up to date. okay, it looks like you are in France, then I would suggest to ...


0

using grep : grep 'master[1,3]' | grep -oE "([0-9]{1,3}\.){3}[0-9]{1,3}"


2

You can do this by simply by using awk string manipulation functions awk -F'/[/]?' '$NF ~ /^(master1|master3).*/{ n=split($2,arr,":"); print arr[1] }'


2

The description of --anyauth says Tells curl to figure out authentication method by itself, and use the most secure one the remote site claims to support. This is done by first doing a request and checking the response-headers, thus possibly inducing an extra network round-trip. It works by sending the request with ...


1

locate is not "real time" : it scans the filesystem and remembers files and locations in its internal database. This is what's happening to you here when running : /usr/bin/youtube-dl You're served the outdated value of this file's location because the database has not (yet) been updated. You can force this with : slocate -u full details : https://ss64....


0

You downloaded with curl to /usr/local/bin/youtube-dl and have removed the old version from /usr/bin. locate is not up to date. Run /usr/local/bin/youtube-dl.


0

You can convert it to a one liner as: username=$( curl -s -X GET -H "Header:Value" http://127.0.0.1:8200/etc | jq -r '.data.value' ) echo ${username}


1

It seems that github.com is not behaving politely by saying that the resource does not exist when a non-authenticated GET request is made. Normally wget will first try requesting the resource without authentication, and retry with that authentication data when a 401 Not Authenticated error is given. This can be worked around by passing --auth-no-challenge ...


0

The parameters -L (--location) and -I (--head) still doing unnecessary HEAD-request to the location-url. If you are sure that you will have no more than one redirect, it is better to disable follow location and use a curl-variable %{redirect_url}. This code do only one HEAD-request to the specified URL and takes redirect_url from location-header: curl --...


0

If you look at the documentation you will find this syntax: curl -XPOST -d b=@/path/postbody.json


1

You may try to use openssl for that (if you need https) or nc and parse output by yourself. But are you sure that it's required? Even if you are not sure about curl already installed, python still is good choise with option to use urllib. And here is example of openssl usage: printf "GET / HTTP/1.0\n\n" | openssl s_client -connect reklamavip.ru:443 -crlf -...


2

The answer is in the title of your question: cURL error 6: Could not resolve host The curl command failed because the system DNS could not resolve the URL provided, for whatever reason. DNS could be misconfigured on your VPS, or the URL provided could be bad/malformed/non-existent. The problem you are encountering is one with curl and your system DNS; ...


Top 50 recent answers are included