wget not working properly. [closed] - wget

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I have some doubt on wget command. Here is the thing I want to achieve. I want to download a tar package from this link "http://snapshots.linaro.org/oneiric/lt-origen-oneiric/20120321/0/images/hwpack/hwpack_linaro-lt-origen_20120321-0_armel_supported.tar.gz" .. This link is working fine when I am using it in browser to download the package, but when I use the same link to download it through wget command, its redirecting to "http://snapshots.linaro.org/licenses/samsung-v2.html" link which is acceptance of license agreement and instead of downloading the tar file, it is downloading the license agreement file.
So, what option should I provide so that it will download the desired tar file and the license agreement file. Please help me on this issue.

You should replicate with wget the same actions you would do with a web browser. The first step is to see what are the http requests that are executed when you ask for the license page, and for the confirm button.
To do this you can use firebug or livehttpheaders. Once you have the urls (with post/get params) you can reproduce it with a shell script and multiple wget calls.
If the website tracks cookies, you will need to instruct wget to keep them in a cookiejar and use said cookiejar for further requests.
In your case the first request is
GET /oneiric/lt-origen-oneiric/20120321/0/images/hwpack/hwpack_linaro-lt-origen_20120321-0_armel_supported.tar.gz HTTP/1.1
for which you get a cookie and a redirect
Set-Cookie: downloadrequested=/oneiric/lt-origen-oneiric/20120321/0/images/hwpack/hwpack_linaro-lt-origen_20120321-0_armel_supported.tar.gz; path=/; domain=.snapshots.linaro.org
Location: http://snapshots.linaro.org/licenses/samsung-v2.html
when you click on the accept button
GET /licenses/samsung-accepted.html HTTP/1.1
you get another cookie and another location (which is the file you want to donwload)
Set-Cookie: samsunglicenseaccepted-v1=true; path=/oneiric/lt-origen-oneiric/20120321/0/images/hwpack/; domain=.snapshots.linaro.org; expires=Wed, 21-Mar-2012 17:37:57 GMT
Location: http://snapshots.linaro.org/oneiric/lt-origen-oneiric/20120321/0/images/hwpack/hwpack_linaro-lt-origen_20120321-0_armel_supported.tar.gz

Related

How to make an offline translator? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
**Problem: **
The result must be a working translator - offline.
We need http API (self-hosted) similar to Google Translate.
I found a few options:
Install Microsoft Translator on Windows, download dictionaries, and somehow through http transfer requests for translation there
Apertium, this option is closer to reality, but it’s not clear how to set everything up ...
Apache Joshua
Promt, it is perfect but it is very expensive
Install Android on PC, and there is already Google Translate, but again there will be a question of sending http requests
**Todo: **
We need to translate whole sentences, not just individual words.
Maybe there is some kind of command line utility. Or maybe there is something for linux.
Which of the above options is better to look for more information?
The five-minute solution is to do this on Debian or Ubuntu:
sudo apt install apertium-apy # http server for apertium
sudo apt install apertium-eng-spa # install some language data
sudo systemctl enable apertium-apy # start http server on next boot
sudo systemctl start apertium-apy # start http server right now too
You now have translation between English and Spanish that responds to http requests and answers in JSON:
curl 'http://localhost:2737/translate?langpair=spa|eng&q=Eres+la+leche'
You can see all the apt-installable Apertium language pairs with
apt-cache search apertium |grep 'pair$'
If you want more pairs in Apertium, you could try the adding the nightly apt repo with unreleased data (or consider Contributing your own language data).
However, you tagged this neural-network – if you want NN's, or more language pairs than Apertium has, you could train a translator with OpenNMT and data from e.g. http://opus.nlpl.eu/ , but that will definitely take more than five minutes :-)

CPAN download failing [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
Has anyone noticed a serious problem with CPAN downloads?
All of the download links seem to be iunable to resolve www.cpan.org,
but the directory structure inside CPAN doesn't allow any simple swapping to search.cpan.org.
Has anyone found a fix?
Tried to use metacpan.org:
wget http://metacpan.org/CPAN/authors/id/M/MP/MPIOTR/Text-Iconv-1.7.tar.gz
Result:
--2013-06-15 16:00:17-- https://metacpan.org/CPAN/authors/id/M/MP/MPIOTR/Text-Iconv-1.7.tar.gz
Connecting to metacpan.org|46.43.35.68|:443... connected.
ERROR: certificate common name “cpan.metacpan.org” doesn’t match requested host name “metacpan.org”.
To connect to metacpan.org insecurely, use ‘--no-check-certificate’.
Tried without certificate: page not found.
What is happening in CPAN?
http://search.cpan.org seems temporarily broken. You can use https://metacpan.org instead. For the certificates, you can bypass it by using :
export PERL_LWP_SSL_VERIFY_HOSTNAME=0
cpan https://metacpan.org/path/to/Module.pm

How would I go about running the Dart VM on a windows server ? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I have seen some tutorials on how to run a webserver on the Dart VM on linux machine. But what are the basic steps for doing the same on a windows server? Would you need to turn off the ISS if that is running? I assume I would need to hook up the VM through some environmental variables, but I have not seen a tutorial.
It's a different mental concept to something like IIS.
Essentially, you run a .dart script from the command line using the dart binary dart.exe
For example, the following script represents a "dart server" listening on port 8080
import 'dart:io';
void main() {
var httpServer = new HttpServer();
httpServer.defaultRequestHandler = (req, HttpResponse res) {
var result = "${req.method}: ${req.path}";
print(result); // log to console
res.outputStream.writeString("You requested $result"); // return result to browser
res.outputStream.close();
};
httpServer.listen("127.0.0.1", 8080);
}
Save the text above as myServer.dart and from the command line, run dart.exe myServer.dart.
Then navigate to http://127.0.0.1:8080/foo/bar and you will get the output below shown in the browser:
You requested GET: /foo/bar
From that, you can write code to add more handlers for specific methods / paths etc..., load files from the file system to send to the browser, access data sources, return data, anything, really that you can write in Dart code and send to the browser.
(Clarification: You would only need to turn of IIS if it is already serving on the same port, for this example, port 8080).

Can't open site in SharePoint Designer [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I'm trying to open a sharepoint site in SPD with no success.
SPD is processing, and nothing happens, it keeps processing as if it wouldn't find the site.
Do you have any clue where it comes from ?
For information I'm using the Site administration for this and the SPDSettings of the Web Application are all set to true.
EDIT : After waiting for 10 minutes I had this error :
Service Unavailable
Service Unavailable HTTP Error 503. The service is unavailable.
EDIT 2 : I think this error comes from the fact that i was deploying another solution in the same web application, but in another site collection ...
Your question is unfortunately too general to provide a specific answer. The SharePoint designer communicates to your SharePoint site via a series of web services to pull down the information. There's probably issues going on during these requests. Have you tried logging into the SharePoint Designer as the System Account in order to dismiss any security issues with the site contents?
To diagnose the source of these issues, review the ULS logs that are created during the period of trying to access the designer. These can be reviewed at:
\\<Server Name>\c$\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\LOGS
Use ULS Log Viewer to provide a real time view of all the log entries SharePoint creates during your usage.

What is the Linux command to add tftp service for Ubuntu? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 12 years ago.
Improve this question
i'm following instructions about: "Installing and setting TFTPD in Ubuntu":
it asks to: Create /etc/xinetd.d/tftp and put this entry:
service tftp
{
protocol = udp
port = 69
socket_type = dgram
wait = yes
user = nobody
server = /usr/sbin/in.tftpd
server_args = /tftpboot
disable = no
}
what does it mean to create....
is there any command i need to type??
and "put this entry" - it means to type in one line all the lines above?
i don't know Linux & i need your help please........
And note this warning in the tftpd package description:
Tftpd is a server which supports the Internet Trivial File Transfer Protocol
(RFC 783). The TFTP server operates at the port indicated in the `tftp'
service description; see services(5). The server is normally started by
inetd(8).
Tftpd is not suitable for use with the PXE bootloader; for that,
use atftpd or tftpd-hpa.
I don't know why it isn't suitable, but when it is labeled like that, I would suggest paying attention. :)
That is a file. What you will do is open up a terminal and
sudo nano /etc/xinetd.d/tftp
paste the contents, save & close. All done.