mirroring interview questions
Top mirroring frequently asked interview questions
I did some googling and here's my answer
<!--[if IE]>
<style>
.mirror {
filter: progid:DXImageTransform.Microsoft.BasicImage(mirror=1);
}
</style>
<![endif]-->
<style>
.mirror {
display:block;
-moz-transform: matrix(-1, 0, 0, 1, 0, 0);
-webkit-transform: matrix(-1, 0, 0, 1, 0, 0);
-o-transform:matrix(-1, 0, 0, 1, 0, 0);
}
</style>
<div class="mirror">testing</div>
The only problem here is that the center of mirroring is not the center of the object, so maybe we need some javascript to move the object where we want it.
Source: (StackOverflow)
I'm interested in hearing people's thoughts about the pros and cons of database mirroring vs. log shipping in this scenario: we need to setup a database backup situation wherein there is exactly one secondary server that need not automatically pick up when the primary fails. Recovering and starting with the secondary should not have to take too long though.
Source: (StackOverflow)
How do I create a github mirror for an external git repository, such that it appears as "real mirror", e.g., as in https://github.com/mirrors?
So far, I set up a mirror using:
cd /path/to/bare/repository
git remote add --mirror github git@github.com:user/repo.git
and configure the post receive hook to do a git push --quiet github
. This way, however, github does not recognize the mirror.
Any ideas how to do it the github way, such that "Mirrorred from" appears underneath the repostiory name?
Source: (StackOverflow)
I have a remote git repository with big history and slow connection channel. Where are some local users, and slow push/pull after big commits or cloning from scratch for new users are big problems, now. I want to create local mirror of it. Local changes must be committed to local repo, and sync with remote in background. I understand that this problem is in demand, but I have not found any solution yet (I am not admin of remote repo, I just try to simplify local work with it).
Source: (StackOverflow)
I understand the general differences between the concepts of
- reflection (done at runtime using
Class, Method, Field, Annotation, ...
), and
- mirroring (done during annotation processing using
TypeMirror, TypeElement, ...
).
But can someone please compare the two concepts in-depth (or point me to a resource, where it is done)?
For instance, which concept offers what kinds of information that the other does not offer...
Thank you.
Source: (StackOverflow)
I am using Mercurial to develop a client project. After I've been working on this for 2 weeks, the client has now requested that I keep all code in their SVN repo.
I want to continue to use Mercurial for development, but to keep the client happy, export all commits (w/ messages) into SVN as well.
Is this possible?
Source: (StackOverflow)
When a new developer joins the team, or Jenkins runs a complete build, I need to create a fresh virtualenv. I often find that setting up a virtualenv with Pip and a large number (more than 10) of requirements takes a very long time to install everything from PyPI.
Often it fails altogether with:
Downloading/unpacking Django==1.4.5 (from -r requirements.pip (line 1))
Exception:
Traceback (most recent call last):
File "/var/lib/jenkins/jobs/hermes-web/workspace/web/.venv/lib/python2.6/site-packages/pip-1.2.1-py2.6.egg/pip/basecommand.py", line 107, in main
status = self.run(options, args)
File "/var/lib/jenkins/jobs/hermes-web/workspace/web/.venv/lib/python2.6/site-packages/pip-1.2.1-py2.6.egg/pip/commands/install.py", line 256, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "/var/lib/jenkins/jobs/hermes-web/workspace/web/.venv/lib/python2.6/site-packages/pip-1.2.1-py2.6.egg/pip/req.py", line 1018, in prepare_files
self.unpack_url(url, location, self.is_download)
File "/var/lib/jenkins/jobs/hermes-web/workspace/web/.venv/lib/python2.6/site-packages/pip-1.2.1-py2.6.egg/pip/req.py", line 1142, in unpack_url
retval = unpack_http_url(link, location, self.download_cache, self.download_dir)
File "/var/lib/jenkins/jobs/hermes-web/workspace/web/.venv/lib/python2.6/site-packages/pip-1.2.1-py2.6.egg/pip/download.py", line 463, in unpack_http_url
download_hash = _download_url(resp, link, temp_location)
File "/var/lib/jenkins/jobs/hermes-web/workspace/web/.venv/lib/python2.6/site-packages/pip-1.2.1-py2.6.egg/pip/download.py", line 380, in _download_url
chunk = resp.read(4096)
File "/usr/lib64/python2.6/socket.py", line 353, in read
data = self._sock.recv(left)
File "/usr/lib64/python2.6/httplib.py", line 538, in read
s = self.fp.read(amt)
File "/usr/lib64/python2.6/socket.py", line 353, in read
data = self._sock.recv(left)
timeout: timed out
I'm aware of Pip's --use-mirrors
flag, and sometimes people on my team have worked around by using --index-url http://f.pypi.python.org/simple
(or another mirror) until they have a mirror that responds in a timely fashion. We're in the UK, but there's a PyPI mirror in Germany, and we don't have issues downloading data from other sites.
So, I'm looking at ways to mirror PyPI internally for our team.
The options I've looked at are:
Running my own PyPI instance. There's the official PyPI implementation: CheeseShop as well as several third party implementations, such as: djangopypi and pypiserver (see footnote)
The problem with this approach is that I'm not interested in full PyPI functionality with file upload, I just want to mirror the content it provides.
Running a PyPI mirror with pep381client or pypi-mirror.
This looks like it could work, but it requires my mirror to download everything from PyPI first. I've set up a test instance of pep381client, but my download speed varies between 5 Kb/s and 200 Kb/s (bits, not bytes). Unless there's a copy of the full PyPI archive somewhere, it will take me weeks to have a useful mirror.
Using a PyPI round-robin proxy such as yopypi.
This is irrelevant now that http://pypi.python.org itself consists of several geographically distinct servers.
Copying around a virtualenv between developers, or hosting a folder of the current project's dependencies.
This doesn't scale: we have several different Python projects whose dependencies change (slowly) over time. As soon as the dependencies of any project change, this central folder must be updated to add the new dependencies. Copying the virtualenv is worse than copying the packages though, since any Python packages with C modules need to be compiled for the target system. Our team has both Linux and OS X users.
(This still looks like the best option of a bad bunch.)
Using an intelligent PyPI caching proxy: collective.eggproxy
This seems like it would be a very good solution, but the last version on PyPI is dated 2009 and discusses mod_python.
What do other large Python teams do? What's the best solution to quickly install the same set of python packages?
Footnotes:
Source: (StackOverflow)
Is it possible to have gitlab setup to automatically sync (mirror) a repository hosted at another location?
At the moment, the easiest way I know of doing this involves manually pushing to the two (gitlab and the other) repository, but this is time consuming and error prone.
The greatest problem is that a mirror can resynchronize is two users concurrently push changes to the two different repositories. The best method I can come up with to prevent this issue is to ensure users can only push to one of the repositories.
Source: (StackOverflow)
As far as i know SQL Server provides 4 techniques for better availability.
I think these are the primary usage scenarios, in summary :-
1) Replication would be primarily suited for online-offline data synchronization scenarios (laptop , mobile devices, remote servers).
2) Log shipping could be used to have a failover server with manual switching, whereas
3) Database Mirroring is an automatic failover technique
4) Failover Clustering is an advanced type of database mirroring.
Am i right ?
Thanks.
Source: (StackOverflow)
I have a project hosted on git.debian.org (alioth) and I'd like to configure a post-receive hook to update a mirror of the repository on http://gitorious.org
I suppose I'll have to use git push --mirror gitorious
Now, I'll need to have Alioth authorized on gitorious for the push to succeed. How do I do that?
I suppose I need to configure a user on gitorious and create a ssh key for it. And then when I do the git push in the post-receive hook, make sure this ssh key is used.
I could use a ~/.ssh/config
but the problem is that many users can push on alioth, and everyone would have to log in and configure the ~/.ssh/config
. Instead, I'd like to have a command line option or an environment variable to tell ssh which key to use. Can I do that?
Also, do you have other ideas how mirroring can be achieved? And, is it possible to configure it the other way around (gitorious pushing on alioth)?
Source: (StackOverflow)
As we are slowly moving from SVN to GIT we are looking into creating a cluster of git servers both to offload cloning over our wan, and to create redundancy or a hot standby in case of issues. One of our main demands is that we can commit to any of the gitserver, who would replicate it further up in the hierarchy.
As we develop as in many as 3 continents simultaneously i don't place a lot of trust in using rsync/crontab'ed git clones, as i believe commits on more than one server at the same time might corrupt the repositories (or give git a headache on how to merge the changes) . What is the best practices around such a deployment? Anyone with tips or pointers? Wandisco's SVN cluster does not cut it as we are migrating to Git.
Source: (StackOverflow)
I am currently crossing the jungle of SQL Server scale-out technologies like replication, log-shipping, mirroring... I have the following constraints on my choice:
- I want the read-only load to be spread accross the primary and the secondary (mirror, subscriber) server
- Write load can be sent directly to the primary server
- The solution should be nearly maintainance free. Schema changes should just replicate to the secondary server (attention: replication has some serious constraints here as it seems)
- Written data should be accessible very quickly (in under 1s, but better would be instantaneously) on the secondary server
- On server failure I can tollerate up to one hour of data loss easily. I am more concerned with easy scalability
Here are some options for what I could pick: http://msdn.microsoft.com/en-us/library/bb510414.aspx. Any experience you could share?
Source: (StackOverflow)
I have a mirrored database and I need to make some changes to it. Mainly, adding a view and some stored procedures. Now I know that if you make schema changes you are supposed to remove mirroring and the mirror database, make your changes to the principal, then backup-restore the principal and restore mirroring. Is this the case for stored procedures and views as well? Can I just make my changes to the Principal, then Failover and make my changes to the mirror as well? What are the possible issues and ramifications from doing something like this? It just seems like a very tedious task to have to do every time we want to make a small change, mainly because the database is over 10 gigs so it takes a little while to back up and restore.
Source: (StackOverflow)
I want to code a Christmas tree in SVG using path.
I started with writing the path for the left half of the tree, now I want to mirror these points along the y-axis to create the right half. I tried the scale command in many variations but it doesn't work at all. :/ Can somebody help me with this?
Here's my code:
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg width="2000" height="2000" xmlns="http://www.w3.org/2000/svg">
<path style="stroke:green;fill:none;
stroke-width:10;"
d="M1000,200 Q950,400 800,500 Q600,600 750,650 T700,850 Q400,1100 600,1100 T500,1400 Q250,1600 450,1600 L850,1600 Q950,1600 950,1700"/>
<path transform="translate(350)" style="stroke:green;fill:none;
stroke-width:10;"
d="M1000,200 Q950,400 800,500 Q600,600 750,650 T700,850 Q400,1100 600,1100 T500,1400 Q250,1600 450,1600 L850,1600 Q950,1600 950,1700"/>
</svg>
How it is now: http://www.bilderload.com/bild/272965/istFI270.jpg
How it should look: http://www.bilderload.com/bild/272964/soll399GL.jpg
Source: (StackOverflow)