Tag Info

New answers tagged

0

This is an issue with curl, which has been fixed by the curl people, but many OS distributions package old versions. Basically if curl can find an ipv6 address for the domain in your URL, then it'll try to fetch it, and if that fails, curl fails, without falling back on trying the IPv4 address. You could argue whether that's a bug or not, but broken IPv6 ...


2

Another way, if you don't want to modify your tests, is to use iptables: iptables -A OUTPUT -d 192.168.0.0/16 -j REJECT That won't work for ping, but it will work for CURL and some other programmes. WARNING: Ensure you don't create a firewall rule that block your own network!!!!


0

Both curl and ping have timeout options you can set. curl: --connect-timeout <seconds> Maximum time in seconds that you allow curl's connection to take. This only limits the connection phase ... OR -m, --max-time <seconds> Maximum time in seconds that you allow the whole operation to ...


1

Have you looked at lsyncd? It's pretty much the same as what you have set up manually, except it runs as a proper service.


3

You probably wouldn't need 3 of those backslashes if you can remove the shell from the equation. Luckily, you can: { printf '{ "file_content":["' cat file.txt printf '", ...]}"' }| curl ... --data-binary @- Look at man curl. I suggest paying close attention to the differences between --data-ascii (which is what -d means), ...


0

To allow the shell to interpret the $(...) or backticks, you need to stop quoting it: curl ... --data '{ "file_content":["' $(cat file.txt) '", ...]}"' ... or curl ... --data '{ "file_content":["' `cat file.txt` '", ...]}"' ...


2

Running rsync on every update is also wasteful. The following script runs rsync and curl once when there's no activity for 0.1 second since the last event. #!/bin/bash time_stamp=$(date +"%B-%d-%Y") inotifywait -mr /usr/lib/unifi-video/data/videos -e create -e moved_to | while true; do T='' while read $T path action file; do echo "The file '$file' ...


0

You don't seem to be escaping special characters properly; specifically ;, & and ? Also, it may be a function of this website, but your double quotes aren't the quotes you're looking for: “ isn't the same as " I'd use: # curl "${WEBSITE_URL}/${ACTION_NAME}/${ACTION1}\;id=${ID}\?Command=TEST\&id1=${ID1}\&id2=${ID2}\&id3=${ID3}"


0

The HTTP standard specifies that all header lines, as well as the empty line that marks the end of the headers, must use CRLF (carriage return, line feed) endings. A lot of clients are liberal and accept LF alone, but most servers, including Google, respect the standard. curl -I displays the headers exactly as sent by the server, including the CR ...


0

Adding --disable-epsv switch fixed the problem. A little explanation: I just went through many hours of trying to figure out wierd FTP problems. The way that the problem presented was that after login, when the FTP client attempted a directory listing (or any other command), it would just hang. EPSV is "extended passive mode", and is a newer ...


0

Problem is with the ftp server running on 11.111.11.11 IP address. This hangs forever... ftp 11.111.11.11 First get your ftp server working with a simple ftp client. Likely this will fix your curl command too.


1

Example of 'here' document after creating a ~/.netrc with conections/users/passwords. #!/bin/bash ftp 11.1.1.11 << eof ascii get /tmp/myfile.txt bye eof Pitty you can't use lftp, it's a great client and I don't see any security difference between having your passwords in ~/.netrc or having them in the script if you give it ...


0

If anybody finds this on Google like I did, to fix the issue I just had to tweak my firewall rules for IPv6. By default I'd blocked everything on the incoming chain - after I added rules to allow established connections, ping requests and anything from localhost IPv6 connections started working!


1

How about simply using wget? $ wget http://picasaweb.google.com 2>&1 | grep Location: Location: /home [following] Location: https://www.google.com/accounts/ServiceLogin?hl=en_US&continue=https%3A%2F%2Fpicasaweb.google.com%2Flh%2Flogin%3Fcontinue%3Dhttps%253A%252F%252Fpicasaweb.google.com%252Fhome&service=lh2&ltmpl=gp&passive=true ...


0

Either you have two problems or one nasty one, to find out which type the command sudo sh -c 'type curl';type curl if both type commands show the same file you have the tough one, but probably you have two simpler ones: curl is installed twice and your dynamic linker is misconfigured.


1

Try this to remove carriage return: echo "$(curl -s -I https://google.com|grep Server)" abc | tr -d "\r" Output: Server: GFE/2.0 abc


2

echo $(curl -s -I https://google.com|grep Server)|cat -A shows that the value returned by curl has a ^M (a carriage return). When you print out the output of the curl, the carriage return takes the 'cursor' back to the start of the line, where it then prints out the ' abc', overwriting 'Serv'. In your second attempt, the carriage return has no obvious ...


1

How about: for i in {1..52}; do curl -O `printf "http://www.example.com/%02d_episode_%d.mp3" $i $i`; done


2

Remove the sleep 80 command and the & from the curl command immediately prior to it. Removing the & will make the script wait for the curl download to finish before proceeding to the next pass through the loop.



Top 50 recent answers are included