Hot answers tagged

127

In order to download the certificate, you need to use the client built into openssl like so: echo -n | openssl s_client -connect HOST:PORTNUMBER | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > /tmp/$SERVERNAME.cert That will save the certificate to /tmp/$SERVERNAME.cert. You can use -showcerts if you want to download all the certificates in ...


59

You can redirect the output of wget to /dev/null (or NUL on Windows): wget http://www.example.com -O /dev/null The file won't be written to disk, but it will be downloaded.


41

You could do it like this: */5 * * * * wget -O /dev/null -o /dev/null example.com Here -O sends the downloaded file to /dev/null and -o logs to /dev/null instead of stderr. That way redirection is not needed at all.


35

I found the answer. Openssl provides it. openssl s_client -connect ${REMHOST}:${REMPORT}


28

If you don't want to save the file, and you have accepted the solution of downloading the page in /dev/null, I suppose you are using wget not to get and parse the page contents. If your real need is to trigger some remote action, check that the page exists and so on I think it would be better to avoid downloading the html body page at all. Play with wget ...


28

Or use curl, where it's the default behaviour. curl http://www.google.com/ http://curl.haxx.se/


28

Try adding newline at the end of your crontab.


26

wget -O - -o /dev/null http://google.com


25

Careful Before running the script, do you trust the person who wrote it? For example, did you expect the script to contain this? echo "brain1" > /etc/hostname That will try to change your hostname. For future reference, if, after verifying the script is correct and not malicious, you can run it in one line like this: wget -O - http://dl.dropbox....


21

Don't tar. Use rsync -av to preserve permissions while transfering the files. Though like tar, this does not preserve selinux context. Not that I would consider that important though.


18

You can use the -d option in curl with a @- argument to accept input from a pipe. You will need to construct the key-value pairs yourself. Try this: echo "time=`uptime`" | curl -d @- http://URL The backticks (`) denote that the enclosed command (in this case uptime) should be executed, and the backtick-quoted text replaced with the output of the executed ...


17

If you want to use the GUI, try clicking Places -> Connect to Server.... For Service Type choose Windows share, and fill out the fields like so: Server: 192.168.1.66 Share: SharedFolder Then download your file from the window. If you want to use a command-line interface, smbclient uses a FTP-like interface (get, put, etc.): ~$ smbclient //192.168.1.66/...


15

They are actually options for the wget command and not to do with cron's operation. -q tells wget to operate quietly (ie. to not output the usual status information) -O /dev/null tells it to output to /dev/null Type man wget for more info on wget's operation and options.


15

Powershell. $wc = New-Object System.Net.WebClient $wc.DownloadFile($source, $dest) There's also Invoke-WebRequest in PS 3.0.


14

Do you need to actually download the contents or just receive the 200 OK? If you only have to have the server process the request, why not simply use the --spider argument?


13

The GNUTLS client tool, gnutls-cli, can also make this easy: gnutls-cli --print-cert www.example.com < /dev/null > www.example.com.certs The program is designed to provide an interactive client to the site, so you need to give it empty input to end the interactive session.


13

You probably want to buy more disk space, but assuming you don't, you could... pipe the tarball around rather than downloading it. newserver# ssh olduser@oldserver "cat /path/to/tarball" | tar xf - or if you don't have SSH access to your old server newserver# wget -O - http://oldserver/path/to/tarball | tar xf - or use rsync like Dennis said. Be ...


12

$ wget http://www.somewebsite.com -O foo.html --delete-after


12

Use '&' after a command to background a process, and 'wait' to wait for them to finish. Use '()' around the commands if you need to create a sub-shell. #!/bin/bash curl -s -o foo http://example.com/file1 && echo "done1" & curl -s -o bar http://example.com/file2 && echo "done2" & curl -s -o baz http://example.com/file3 &&...


11

Check your /etc/nsswitch.conf file (or whatever the equivalent is on Debian if it's not that). host and nslookup always do DNS lookups. However other applications will look in NSS first for other naming systems (e.g. /etc/hosts, NIS, etc). If something else is configured but not working it could prevent the application from ever trying the DNS.


11

wget is not hanging. Your shell is waiting for you to enter another command, and the shell prompt is at the top of the output somewhere... The problem is: You did not quote the URL, and it contains an ampersand. This character is used to put a process in the background, and importantly, anything following it is treated as another command line to be run. So ...


10

If the file is executable (check if it has x in ls -l, if not, then use chmod to set the executable bit) and the first line contains #!/bin/bash then it will be interpreted in bash. The other option is, as you suggest, to pass it as an argument to bash: /bin/bash /path/to/your/file.sh


10

Use a .wgetrc file (GNU manual) in which you can set username and passwords for either or both ftp and http. To use the same credentials for both specify user=casper password=CasperPassword or individually ftp_user=casperftp ftp_password=casperftppass http_user=casperhttp http_password=casperhttppass


9

wget http://longname -O short_name


9

From man wget: You have a file that contains the URLs you want to download? Use the -i switch: wget -i <file>


9

Turns out I didn't install the setup file with dependencies from this page: http://gnuwin32.sourceforge.net/packages/wget.htm ("Complete package, except sources") Doh!


9

By default wget will check for certificates in the path defined in openssl conf file /etc/pki/tls/openssl.cnf (no sure whether the path is correct for fc8). Please check the openssl configuration file and confirm that the paths are correct. May be it is openssl, that need to be corrected.


8

Use curl, no point guessing what every error will look like. [wizard@laptop ~] curl -s -S http://www.google.coccm/ > /dev/null && echo "TRUE" curl: (6) Couldn't resolve host 'www.google.coccm' [wizard@laptop ~]$ curl -s -S http://www.google.com/ > /dev/null && echo "TRUE" TRUE -s/--silent Silent mode. Don’t show progress meter or ...


8

You might also try HTTrack which has, IMO, more flexible and intuitive include/exclude logic. Something like this... httrack "https://example.com" -O ExampleMirrorDirectory \ "-*" \ "+https://example.com/images/*" \ "-*.swf" The rules will be applied in order, and will override previous rules... Exclude everything But include https://example.com/images/...



Only top voted, non community-wiki answers of a minimum length are eligible