Tag Info

Hot answers tagged

76

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 ...


52

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.


32

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


30

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.


24

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 ...


23

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


23

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


23

Try adding newline at the end of your crontab.


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

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 - ...


18

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 ...


13

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.


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

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?


11

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.


11

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 ...


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, example) 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


10

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


9

wget http://longname -O short_name


9

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


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 ...


8

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.


8

rsync is the standard utility for this: rsync -avz -e ssh source/ user@destServer:/dest/ a For archive, keeps permissions, type stamps, etc. v for verbose e ssh , use over ssh z for compression, if you want that. It won't try to re-compress archive (zip) files. rsync generally comes with Linux distributions. It also meets your requirement of not ...


8

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


8

This option works wget -N http://server/folder/file1.html info -N, --timestamping don't re-retrieve files unless newer than local.


7

In the spirit of teaching a man to fish: man wget


7

Maybe it's proxies - proxies are configured in the environment, so might be different for different users, but be consistently set up for those users by their login scripts. I'd suggest env | grep proxy to find out what is set.


7

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!


7

wget -q http://www.whatever.com/filename.txt -O /path/filename.txt -q is quiet mode so you can throw it in a cron without any output from the command



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