How to track downloads in AWStats when no file extension - joomla

I have a Joomla site, and I have a lot of downloads whose links are of the form
/item/download/60_7372007fc87frju9ebed04j8e65
AWStats is not tracking, and I suspect it is because I have to configure it to track when there is a download link of this form. Any ideas on how to get AWStats to track?
Thanks!

I'm not sure how you can do that in AWStats or if it can be done. But you can track that monthly by connecting to the server (in ssh), changing the /home/[your-user]/logs folder, extracting the log, and then running the following command:
grep "file-you-want-to-track" log-file | wc -l
The above should give you a count of how many have visited that download link

Related

VScode: how to setup for local edit and ftp-deplyment

I used to use Dreamweaver. I've a huge Classic ASP website. I edit the files on my local system, and when done, I can upload the file(s) via ftp to the remote webserver. Now, I try to switch to VSCode. I've installed ftp-simple, ftp-sync and deploy. But can't find the set-up to get a Dreamweaver like behaviour. Eg, I have to locate for each file I want to upload/deploy, the exact location in the remote file tree.
I really feel like deploy deserves more attention. I spent the past 4 days or so to find an extension that does just that. Auto-upload to an ftp-folder from a local folder. I wanted to make git work for my website, but couldn't get that to work on the server with ftp-simple or ftp-sync because those extensions only download the opened files or open in a different temporary folder each time. I set up deploy now and got exactly what I wanted thanks to your tiny comment, thank you!
(I'm sorry if this post is too old to comment on, but I browsed Stack overflow for days to find this, so I thought it might help others in the future to point this out.)
it sounds like your just missing your mapping configuration. Most text editor FTP packages include a configuration file where you specify the server, your credentials, and the root folder of your ftp server. Have you specified this?

Distributing data on cluster (using torrents?)

I hope this is a good place to ask this, otherwise please redirect me to the correct forum.
I have a large amount of data (~400GB) I need to distribute to all nodes in a cluster (~100 nodes). Any help into how to do this will be appreciated, following here is what Ive tried.
I was thinking of doing this using torrents but I'm running into a bunch of issues. These are the steps I tried:
I downloaded ctorrent to create the torrent and seed and download it. I had a problem because I didn't have a tracker.
I found that qbittorrent-nox has an embedded tracker so I downloaded that on one of my nodes and set the tracker up.
I now created the torrent using the tracker I created and copied it to my nodes.
When I run the torrent with ctorrent on the node with the actual data on it to seed the data I get:
Seed for others 72 hours
- 0/0/1 [1/1/1] 0MB,0MB | 0,0K/s | 0,0K E:0,1 Connecting
When I run on one of the nodes to download the data I get:
- 0/0/1 [0/1/0] 0MB,0MB | 0,0K/s | 0,0K E:0,1
So it seems they aren't connecting to the tracker ok, but I don't know why
I am probably doing something very wrong, but I can't figure it out.
If anyone can help me with what I am doing, or has any way of distributing the data efficiently, even not with torrents, I would be very happy to hear.
Thanks in advance for any help available.
but the node thats supposed to be seeding thinks it has 0% of the file, and so it doesn't seed.
If you create a metadata file (.torrent) with tool A and then want to seed it with tool B then you need to point B to both the metadata and the data (the content files) itself.
I know it is a different issue now, and might require a different topic, but Im hoping you might have ideas.
You should create a new question which will have more room for you to provide details.
So this is embarrassing, I might have had it working for a while now, but I did change my implementation since I started. I just re-checked and the files I was transferring were corrupted on one of my earlier tries and I have been using them since.
So to sum up this is what worked for me if anybody else ends up needing the same setup:
I create torrents using "transmission-create /path/to/file/or/directory/to/be/torrented -o /path/to/output/directory/output_file_name.torrent" (this is because qbittorrent-nox doesn't provide a tool that I could find to create torrents)
I run the torrent on the computer with the actual files so it will seed using "qbittorrent-nox ~/path/to/torrent/file/name_of_file.torrent"
I copy the .torrent file to all nodes and run "qbittorrent-nox ~/path/to/torrent/file/name_of_file.torrent" to start downloading
qbittorrent settings I needed to configure:
In "Downloads" change "Save files to location" to the location of the data in the node that is going to be seeding #otherwise that node wont know it has the files specified in the torrent and wont seed them.
To avoid issues with the torrents sometimes starting as queued and requiring a "force resume". This doesn't appear to have fixed the problem 100% though
In "Speed" tab uncheck "Enable bandwidth management (uTP)"
uncheck "Apply rate limit to uTP connections"
In "BitTorrent" tab uncheck "Torrent Queueing"
Thanks for all the help and Im sorry I hassled people for no reason from some point..

I downloaded my website files using filezilla from remote site to edit. But I can't locate it on my machine.

I had a few bugs in my code for a website and i need to download all the files of the website to my development machine for editing. I did so in Filezila by clicking on the root folder on the remote site and took the download option. It finished downloading but i couldn't locate it on the local machine.
I know my question may be stupid but please help cuz i am new to this?
Thanks
If you look at the bottom of the filezilla you have three tabs after the console log that is 1) Queued files 2) Failed transfer 3) Successful transfers
Again download the file and after download has complete click on Successful transfers option and there you would find the log and path where your files are downloaded.
Your download path appears here:

ClickOnce Error "different computed hash than specified in manifest" when transferring published files

I am in an interesting situation where I maintain the code for a program that is used and distributed primarily by our sister company. We are ready to distribute the program to all of the 3rd party users and since it is technically our sister companies program, we want to host it on their website. (in the interest of anonimity, I'll use 'program' everywhere instead of the actual application name, and 'www.SisterCompany.com' instead of their actual URL.)
So I get everything ready to go, setup the Publish setting to check for updates at program start, the minimum required version, and I set the Insallation Folder URL and Update Location to "http://www.SisterCompany.com/apps/program/", with the actual Publishing Folder Location as "C:\LocalProjects\Program\Publish\". Everything else is pretty standard.
After publish, I confirm that everything installs and works correctly when running directly from the publish location on my C: drive. So I put everything on our FTP server, and the guy at our sister company pulls it down and places everything in the '/apps/program/' directory on their webserver.
This is where it goes bad. When I try to install it from their site, I get the - File, Program.exe.config, has a different computed hash than specified in manifest. Error. I tested it a bit, and I even get that error trying to install from any network location on our network other than my local C: drive.
After doing the initial publish in visual studio, I have changed no files (which is the answer/reason I've found by doing some searching about this error).
What could be causing this? Is it because I set the Installation Folder URL to a location that it isn't initially published too?
Let me know if any additional info is needed.
Thanks.
After bashing my head against this all weekend, I have finally found the answer. After unsigning the project and removing the hash on the offending file (an xml file), I got the program to install, but it was giving me 'Windows Side by Side' Errors. I drilled down into the App Cache were the file was, and instead of a config .xml file, it was one of the HTML files from the website the clickonce installer was hosted on. Turns out that the web server didn't seem to like serving up an .XML (or .mdb it turns out) file.
This MSDN article ended up giving me the final solution:
I had to make sure that the 'Use ".deploy" file extension' was selected so that the web server wouldn't mangle files with extensions it didn't like.
I couldn't figure out why that one file's hash would be different. Turns out it wasn't even the same file at all.
It is possible that one of the FTP transfers is happening in text mode, rather than binary?
For me the problem was that .config transformations were done after generating manifest.
To anyone else who's still having trouble, five years later:
The first problem was configuring the MIME type, which on nginx (/etc/nginx/mime.types) should look like this:
application/x-ms-manifest application
See Click Once Server and Client Configuration.
The weirder problem to me was that I was using git to handle the push to the server, i.e.
git remote add live ssh://user#mybox/path/to/publish
git commit -am "committing...";git push live master
Works great for most things, but it was probably being registered as a "change," which prevented the app from installing locally. Once I started using scp instead:
scp -r * user#mybox/path/to/dir/
It worked without a hitch.
It is unfortunate that there is not a lot of helpful information out there about this.

Selenium + Firefox + HTTPS

Okay. I know that I am asking a hackneyed, overchewed question but I am posting this because my problem is not getting solved despite trying all the solutions provided on various links.
My constraint - I don't want to use a saved firefox profile to save the website's certificate.
Selenium server version - 2.0b3
Solutions tried -
1) http://seleniumhq.org/docs/05_selenium_rc.html#handling-https-and-security-popups
Browser launcher *firefox
Selenium started with trustAllSSLCertificates option.
Did not help. FF again asks to save the certificate.
2) http://blog.mogotest.com/2010/04/13/how-to-accept-self-signed-ssl-certificates-in-selenium/
Browser launcher *firefoxproxy
Selenium started with trustAllSSLCertificates option.
Did not help.
3) Selenium Testing HTTPs Trust All certificates working for FF but not IE
4) Besides that I tried creating my own cert_override.txt and populating the 5 fields as explained in https://developer.mozilla.org/En/Cert_override.txt but getting the value for the 5th field which is the certificate's serial number and the issuer name as a base64 encoded string is not straightforward as explained in http://tinyurl.com/ce4vn99.
5) Using the Remember Certificate Exception addon for Firefox http://sejq.blogspot.in/2009/01/remember-certificate-exception.html is yet another option but I have not been able to do a full silent install of it. When we drop the xpi file in the required directory, the next time Firefox starts, it will prompt saying that should it found the addon and should it go ahead and install. The addon won't just get reflected in the browser. If anyone can atleast help me with a FULL silent install of this, it would be great!
All I want is that this works in Firefox. I am not interested in IE and Google Chrome.
Any help in providing an answer and not just terming this as a duplicate would be greatly appreciated.
I would suggest an alternative to Selenium.
Have you tried Sahi? It's basically a very similar application, in that it allows scripted browser control, but for a lot of cases it seems to work better than Selenium.
From the Sahi FAQ page:
How does it compare to Selenium?
Sahi is easier to learn and use for testers. Sahi’s recorder works on all browsers. Sahi automatically waits for AJAX and page loads. It does not use XPaths, but uses more intuitive APIs like _in and _near. Sahi works well across frames, iframes, popup windows, sites with dynamic ids, https sites, 401 authentication sites etc. It has inbuilt HTML reports, and ability to run multiple scripts in parallel.
In my experience, this is accurate. There are certain types of browser event that Selenium struggles with, that Sahi handles much better.
I know that doesn't solve your problem with Selenium, and I know it's a pain if you've already written your tests in Selenium to re-do them in Sahi so it may not be the solution you're looking for, but if all else fails, it may be worth considering.
ps - you didn't mention anything about your development environment, but there is a PHP-based testing tool called Mink which integrates with both Sahi and Selenium -- ie you can write the a single test script and have it work in either. I don't know of any similar tool in other languages, but it might be of interest if it helps you migrate between the two.
So the solution turned out to be the 5th point mentioned above.
Here are the steps to solve the issue -
1) Download the Remember Certificate Exception xpi file from https://addons.mozilla.org/en-US/firefox/addon/remember-certificate-exception/
2) Unzip it to get a set of files. Keep them in a temporary folder. (temp_folder/extracted_files)
3) Open the install.rdf file and copy the content of em:id node present in the Description node.
4) Rename the temporary folder just created with this copied string.
5) Place this folder under the profile_name/extensions/ directory. Also delete the extensions.cache/.ini/.rdf files from your profile folder. These need to be deleted so as to prevent the user from being prompted that his profile has been changed and that there is a new addon to be installed. Only if the 3 files are deleted, it will be a fully silent install.
This can be automated using a script.
#!/bin/bash
mkdir /tmp/addon
cp -r ~/POC/remember_certificate_exception-1.0.0-fx.xpi /tmp/addon
unzip /tmp/addon/remember_certificate_exception-1.0.0-fx.xpi -d /tmp/addon
rm /tmp/addon/remember_certificate_exception-1.0.0-fx.xpi
folder_name=$(cat /tmp/addon/install.rdf | grep -m 1 "<em:id>" | cut -f2 -d ">" | cut -f1 -d "<")
mv /tmp/addon /tmp/$folder_name
cp -r /tmp/$folder_name ~/.mozilla/firefox/*.default/extensions
rm -f ~/.mozilla/firefox/*.default/extensions.
https://addons.mozilla.org/en-US/firefox/addon/skip-cert-error/
Use this addon. This will bypass the https errors. This is configurable as well
I've put together an example that shows how to use Selenium to test HTTPS endpoints -- without ignoring certificate validation errors. It shows how to setup the selenium clients with trusted root CAs that can be used to validate the server certificates presented by the HTTPS endpoints being tested. See https://github.com/JeNeSuisPasDave/Selenium-and-TLS
The example demonstrates Chrome and Firefox Selenium nodes. Chrome looks in the system trusted certificate store for root CA certs used for validation; Firefox looks in the cert8.db file within the current profile.
I think this approach is important because I think that instructing your test harness to ignore certificate errors is unnecessarily risky; doing so may eventually hide errors that you wish you had trapped before they got deployed to production.
I wrote an short post about this topic, https://develves.net/blogs/asd/2017-02-20-selenium-and-tls/, but you really just need the example repo linked above.

Resources