Exact redirects -- what happens if I now add a custom domain? - redirect

I wanted to check something before I break everything. It may be obvious to you, but I'm naturally cautious and wanted to see whether I'm OK to do what I'm thinking.
I currently have docs on RTD (and have had them there for 3 years). We have moved pages around as versions changed, so have a set of about a hundred exact redirects, something like this:
/en/stable/introduction/intro.html -> /en/stable/introduction/setup-guide.html
Now I have a custom domain and want to point everything with a canonical link over there.
What will happen to those redirects? Are they applied first so someone with a bookmark to intro.html is pointed to setup-guide.html over on project.readthedocs.io and then the redirect to myprojectname.com/docs/ applied?
That is, will this happen?
/en/stable/introduction/intro.html --> myprojectname.com/docs/en/stable/introduction/setup-guide.html
Thanks in advance?
I haven't tried this yet. I'm too scared I'll break the whole edifice and end world order.

Related

How to determine correct files and blocks to be edited in Magento2?

this might seem like a strange question but I am learning Magento 2 at the moment and could use some guidance when it comes to figuring out an easier way than guessing to determine what are the correct files and blocks to edit. Let me demonstrate what I mean.
Say I want to edit template and layout of the customer review section of the customer account page.
I figured out after a while of searching around that vendor/magento/module-review/view/frontend/templates/customer/list.html was the correct template file I need to override, and I turned out to be correct, but it was kind of a lucky guess. There were a lot of other files around there that it seemed it could also possibly be.
Alright, we are getting somewhere. Now I need to change the layout, so which layout file do I need to edit? I tried vendor/magento/module-review/view/frontend/layout/review_customer_list.xml but this doesn't seem to be the correct one. Actually, there seems to be about 4/5 files in this same folder it could potentially be, and I don't seem to have any context to go off other than vague file names. Is trial and error, and guessing what we rely on to figure this out or is there a much easier way to determine this. I know this might be a really stupid, newbie question but I'm a little confused.
Additionally, when testing if this is the correct file I am trying to remove the pager at the bottom right and move the toolbar under the page title. How do I know what the correct names of these blocks are? I tried:
<move element="products.reviews.toolbar" destination="column.main" after="page.title"/>
<referenceBlock name="pager" remove="true" />
which didn't work, but I am also kind of just guessing the names of these blocks if I am honest. I have no idea if this is what these blocks are called.
Are there any easy ways to determine all these things instead of guessing? ID's in the DOM or something like this that reveal the names of the blocks/layouts I need to edit? Something like this?
Thanks for the help

Content merging AEM

We're looking for a solution on how to best deal with the situation where multiple authors are working on the same page. If the first author pushes in the content, the second should have a way to merge it when he tries to publish. Launches appears to be a way to take care of this but it doesn't seem to be handling content merging. Is there any way an author can view the diff(and or do merge) of the content that might have been pushed by another author while they were working concurrently ?
Please help with any pointers.
Page modifications happen in real time to the underlying structure. They also happen at as small a level as possible.i.e. If you go into a text area and modify the text there, the text node is changed on the server, you aren't saving the entire page.
The only way that person A could interfere with what person B is doing is if they were working on the exact same area of the page. Which, honestly is a process issue. I say this because the answer to your question is that there is nothing out of the box to handle this type of scenario and if you are on 6.0 or higher and looking at the JCR3. JCR3 handles this far worse than the older version did. Last time I checked it didn't support nodes at all
Adding to what Bailey said, AEM OOB allow multiple users to edit same page in real time, though if multiple users are working on same node will be a reason of conflict. Such cases can be managed by defining a process like:
1. Take a lock of page and edit page or
2. Create versions of page and publish versions

How can I auto-modify an image?

The question I am asking is a little bit abstract, so I will try to make it more clear. There are websites where you sign up and get a signature in the format of an image. It has a general format, say a few boxes that are empty, and a logo in the middle. Now, say you gain the "Overachiever" badge, which looks like a pen. You signature is then updated, automatically, to include that pen badge in one of the blank boxes. I am completely clueless as to how to do this, and in what language to do this is, so can anyone help? I have been thinking about PHP as an option, but I do not know if that would work. Any suggestions?
You can do this with PHP (imagecreate) and for the updates in your images you can use cronjobs.
Is this for a forum? Depending on the platform, I know some hosts already have "addon's" that provide similar functionality to what you're after. (Karma addons etc.)
Maybe one of these will help? phpBB has some stuff like that.
https://www.phpbb.com/community/viewtopic.php?t=2147118
http://www.concrete5.org/
If you can execute an external process, you can do this using Image Magick.

I want to be able to search an html page that is refreshing every 10 seconds for the word "stat"

I want to be able to search an html page that is refreshing every 10 seconds for the word "stat". If the word is found I then want to alert the user through a pop up dialog and possibly a repeating sound until the user acknowledges it.
UPDATE:
Sorry the question was a bit ambiguous. I do not know a great deal about this stuff I just do it as a hobby.
OK so here is the deal. I work as Biomedical Electronics Technician for a hospital. We have a work order system that is web based. Nurses can enter a work order into this system. I have a browser window open at all times that refreshes periodically through an add-on for IE so I can always be up to date on the status of the work orders coming in. When a nurse the enters enters a work order they have the option of choosing Stat, High, Medium, or Low for the priority. When a stat work order is placed our response time should be within five minutes theoretically. I want some way to alert myself when a stat work order has been placed so I can respond accordingly. And I know a repeating sound would be annoying, but that might be the best way to get my attention.
Another caveat to this is the work order status can be changed by me, the tech. So when a work order is initially placed the status is Not assigned or something like that. Once I go start on a work order I change the status to In Progress. If I have to order a part I change the status to Hold for Parts, etc. So basically, what I am saying is I don't want to alerted if the status is anything but "Not assigned". If it will help I will get a copy of the source of the page when I get to work tomorrow.
Our IT department seems unwilling to help and the company that made the product is so busy chasing the daily bugs that show up to add new features such as this at this time. If I knew more a Google search might help, but alas I am a bit noobish in the programming realm, however I am 2 years from a C.S. degree so I am not a complete novice.
To answer another question, I do not have access to the page I am just viewing it so any sort of script would need to run on my client machine.
Thanks
I found this, try it https://addons.mozilla.org/en-US/firefox/addon/3028/
Maybe it can search for STAT on the entire page?
Based off your description, it doesn't sound like you have access to the server to change the code of the page itself, correct?
If that's the case, spend some time learning how to use Greasemonkey (or rather Greasemonkey for IE). It allows you to add functionality to a web page from the client (browser) side, regardless of what's on the server.
You'll need to find the elements that hold the "stat" term your after, and have it check periodically those elements periodically. Look into the setTimeout method for that periodicity. The rest you'll have to work out specific to that page.
What you're looking for, since you have python available, is to build a simple, easy to use webscraper.
First link is how i would do it quick and dirty.
http://www.ehow.com/how_4436125_read-web-page-using-python.html
Second link is a bit more robust and nifty with BeautifulSoup
http://www.builderau.com.au/program/python/soa/Build-a-basic-Web-scraper-in-Python/0,2000064084,339281476,00.htm
Basically, read the page (even set the whole loop on a 10 second refresh timer).
Go line by line with a while readline loop.
See if one of your magic words exists with a regular expression
...
profit?
(... meaning do your alert song and dance)
(profit being rejoice!)

What are some good ways of keeping content from being copied to other sites

I understand that no matter what I do, someone will be able to copy it. However I can still make them work hard for it. What are some good ways of making data not easily copied using php compatible coding.
--- Added ----
The data is a listing of results for certain local sports events. We send people out to collect the information, post the information, make corrections and such. However a competing website takes our results (I know they are directly copying them) and never updates them which causes people to call our office and complain.
---- Answer for my Use ----
I picked one of them, however I am going to use multiple of your answers. I am going to add my link in a using the copy pasta trick. I am going to put fake hidden text into it. I am also going to do the fake hidden text trick with different versions of the div tag that are fake (making it even harder to scrape or to do something like copy to textpad and replace it real easily), and I am going to talk to a lawyer as well about legal recourse and what I can do to make it illegal for them to copy the data (such as creative bios or something cool like that). Thanks for your help.
Joe, you can't really make them work really hard to get your data. It's essentially just a single request to any of your pages. Your best option is to explicitly state that you own the rights to all of your content, and that any infringement on that ownership will lead to legal ramifications*.
* Not a lawyer
Your data will be copied to every computer that requests the page and it will stay there until the person clears their cache. To answer your question, you can't.
What you can do is create a CSS style such as:
.copy-pasta { display: none; }
And then throughout your content, add something like this:
<p class="copy-pasta">Content provided via [your website here]</p>
This will increase your page rank when copy-pasters blatantly steal your content, meaning you will show up first in search results.
Place some <div style="display: inline; position: absolute; overflow: hidden; width: 0px">useless words</div> in the text. It won't display for reading, but if someone copy and paste... "WOW where it came from WTF!! *CRY*"
How about putting links to your site in with the displayed data? No big fanfare, but just suggest that the for the most up to date figures, they can go to the real website that publishes them.
Most of what you try will only work for a time. Until you exceed their laziness factor. (What they're doing suggests a high laziness factor.)
Laws don't protect publicly available data, but you may be able to protect the packaging and presentation.
Programs used to copy out data look for the data using pattern-matching. You could 'decorate' your data with randomly-chosen tags (like one row would have a span tag surrounding it, the next row a div, etc...). Just a thought.
Clarification:
With screen-scraper at least, the user of the program specifies what HTML comes before the data they want, and what HTML comes after it. You can make it more difficult for them to automatically retrieve the data.
Why are people calling your office to complain if the data is on a competing website? If they have a domain name that is similar enough to yours that people are confusing the two of you or if they've put something on their site that makes it look like you've endorsed them, then you've got them for trademark infringement.
Disable the context menu is a start.
$(document).bind('contextmenu', function(e)
{
return false;
});
Or
<body oncontextmenu="return false;">
Forbidding people to get data is almost impossible. You can mess up your tags and make the code really dirty and hard to parse... but it's not really enough. You could also generate a big image with the data in it, this would be painful to parse! ... but you don't want to do that.
Because you said...
However a competing website takes our
results (I know they are directly
copying them) and never updates them
which causes people to call our office
and complain.
... my call would be to take this the other way and create an API allowing people to get your content in a way that YOU designed.
Also if they are just shamelessly stealing your data and they don't have the right to do it, consider a legal option.
Another option is to use PHP code to generate images from the site's HTML. You would use the images to display the content, instead of HTML which can be easily copied out. Example code is here, and I bet you could find more code to do this by Googling:
http://www.acasystems.com/en/web-thumb-activex/faq-php-convert-html-to-image.htm
Try Copyscape it wont prevent your content from being copied, but it will make finding the copies very easy.
You may encrypt the data on the page, and have javascript obfuscated decoding routine that will decode it for you viewers. You may switch keys and encryption algorithms from time to time. Same javascript should disable ability to select text and/or copy it to prevent manual copy-pasting.
They won't be able to copy manually and their scraper would have to be able to run javascript to get the data.
Caveat is that the data won't be visible for Google, but if data is rather numeric it might not be such a big harm.
If they scrape automatically and very often you may also try to pinpoint their IP by observing most active IP-s on your site and serve them fake data.
Please don't use lawyers, that's hitting below the belt.
use swf to display your data, just like other online books