Repository: pubyun/macdev
Branch: master
Commit: 59bea60b83cf
Files: 11
Total size: 54.9 KB
Directory structure:
gitextract_vnw1v3h0/
├── LICENSE
├── README.md
├── apps.md
├── basic.md
├── install.md
├── java.md
├── php.md
├── python.en.md
├── python.md
├── recovery.md
└── refs.md
================================================
FILE CONTENTS
================================================
================================================
FILE: LICENSE
================================================
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
{one line to give the program's name and a brief idea of what it does.}
Copyright (C) {year} {name of author}
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
{project} Copyright (C) {year} {fullname}
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
================================================
FILE: README.md
================================================
# Mac for Developer v0.1
将本人在使用Mac作为开发工具的过程中的一些体会做个记录和整理,方便以后自己和团队的参考,提高效率。如果本文对其他开发人员也有所帮助,欢迎您给给出反馈或者提出改进意见。
本文假设您是一个开发工程师,并且是一个Mac的新手。这些步骤在OS X Yosemite下测试通过。
欢迎大家一起改进这个项目,请`Fork`、`Star`或在[Issues](https://github.com/pubyun/macdev/issues)中提交 :)
Please improve this project together. Submit your ideas by `Fork`、`Star` or [Issues](https://github.com/pubyun/macdev/issues) :)
您也可以关注我的[新浪微博](http://weibo.com/pubyun),以获取最新消息。
You can also follow my [weibo](http://weibo.com/pubyun) for the latest news.
## Catalog
* [Installation of OS X](https://github.com/pubyun/macdev/blob/master/install.md)
* [Backup and recovery of OS X](https://github.com/pubyun/macdev/blob/master/recovery.md)
* [Basic configuration](https://github.com/pubyun/macdev/blob/master/basic.md)
* [Development enviroment of Python](https://github.com/pubyun/macdev/blob/master/python.en.md)
* Development enviroment of Ruby - Work in progress ...
* [Development enviroment of Java](https://github.com/pubyun/macdev/blob/master/java.md)
* [Development enviroment of PHP](https://github.com/pubyun/macdev/blob/master/php.md)
* [Useful software](https://github.com/pubyun/macdev/blob/master/apps.md)
* Config - Work in progress ...
* Common hotkey - Work in progress ...
* [Reference documentation](https://github.com/pubyun/macdev/blob/master/refs.md)
## 目录
* [OS X的安装](https://github.com/pubyun/macdev/blob/master/install.md)
* [OS X的备份和恢复](https://github.com/pubyun/macdev/blob/master/recovery.md)
* [基本设置](https://github.com/pubyun/macdev/blob/master/basic.md)
* [python开发环境的设置](https://github.com/pubyun/macdev/blob/master/python.md)
* ruby开发环境的设置 - 整理中...
* [Java开发环境的设置](https://github.com/pubyun/macdev/blob/master/java.md)
* [PHP开发环境的设置](https://github.com/pubyun/macdev/blob/master/php.md)
* [常用软件](https://github.com/pubyun/macdev/blob/master/apps.md)
* 配置文件 - 整理中 ...
* 常用快捷键 - 整理中 ...
* [参考文档](https://github.com/pubyun/macdev/blob/master/refs.md)
================================================
FILE: apps.md
================================================
# 常用软件
## 效率工具
* Evernote(知识管理工具)
* Geeknote (终端版Evernote)
* OmniFocus(GTD极品,学习成本比较高)
* OmniGraffle(流程图)
* OmniOutliner(提纲思路)
* Oh My Zsh
* autojump (直达目录)
## The missing package manager for OS X
* Homebrew
## 系统工具
* JiTouch
* OnyX
* XQuartz(X11)
* CleanMyMac 3(垃圾清理)
* iterm2(终端)
* ShiftIt(快捷键窗口控制)
* Asepsis (转存 .DS_Store)
* Gas Mask(Host切换)
* Itsycal(显示日历)
* cd to
* XtraFinder(Finder扩展)
* Alfred(万能搜索)
* KeyCue(快捷键大全)
* PopClip(增强复制粘贴)
* FileZilla (FTP工具)
* Retina DisplayMenu (更改显示器分辨率, 可超频)
## 压缩和解压缩
* BetterZip
* The Unarchiver
## 浏览器
* Chrome
* Firefox
## 密码管理
* lastpass
* 1password
## 即时通讯
* QQ
* AliWangWang
* Skype
* LimeChat(IRC)
## 虚拟机
* Parallels Desktop
* VMware fusion
* Genymotion(Android虚拟机)
* VirtualBox
## 云存储
* 百度云
* 腾讯微云
* Dropbox
## VPN 和翻墙
* GoAgentX
* Tunnelblick
* ShadowsocksX
## 开发相关
* Dash
* Vagrant
* Mou(Markdown编辑器)
* Haroopad(Markdown编辑器)
* MacDown (Markdown 编辑器)
* Atom (IDE)
* TextMate(编辑器)
* Sublime Text(编辑器)
* XCode(IDE)
* Eclipse(IDE)
* IntelliJ IDEA(IDE)
* PyCharm(Python IDE)
* PHPStorm(PHP IDE)
* WebStorm(Js IDE)
* Wireshark(网络流量分析)
* CocoaPacketAnalyzer(网络流量分析)
* SourceTree(Git图形客户端)
* GitHub Desktop(Git图形客户端)
* SmartSVN(SVN图形客户端)
* Navicat(数据库管理)
* RoboMongo(MongoDB数据库管理)
* Axure(原型设计)
* Coda2(网页开发)
* xScope(设计度量)
* Kaleidoscope(文件比较)
* DiffMerge(文件比较)
* DiffFork(更好的文件比较)
## 输入法
* 搜狗输入法
* 百度输入法
* QQ输入法
* 鼠鬚管(开源)
## 设计相关
* Adobe CC
* Corel Painter
## 其他
* 迅雷
* VLC(影音)
* f.lux (自动调节色温保护眼睛)
* CoRD(RDP远程桌面)
* TeamViewer(远程控制)
================================================
FILE: basic.md
================================================
# 基本设置
## Alfred
Alfred是Mac平台上使用最频繁的效率工具,被誉为神兵利器。Alfred 2发布以后,在免费版的基础上加入了Powerpack模式,引入了工作流的概念,可以做出远比快速启动和自定义搜索更酷的事情。
免费版的Alfred已经可以满足我们的日常需要,极大提高我们的工作效率,常用的功能有:
* 快速查找程序和文件
* 快速搜索互联网
* 快速搜索联系人
* 计算器和字典
* 剪贴板和代码片段
* 强大的扩展功能和工作流
具体的安装和使用方法可以参见[官方网站](http://www.alfredapp.com/)和搜索相关资料。
## Xcode Command Line Tools
Xcode是Apple的一个开发工具和库集合,Xcode Command Line Tools是Xcode的一部分。安装很多Unix软件都需要使用GCC编译器等开发工具,Xcode Command Line Tools就包含这些工具。
检查Xcode Command Line Tools是否已经安装:
$ xcode-select -p
/Applications/Xcode.app/Contents/Developer
打开一个终端窗口(Terminal),运行命令:
xcode-select --install
然后点击"Install"按钮,安装Xcode的命令行工具
## 软件包管理工具
使用过Debian或者RedHat的操作系统的人,一定非常熟悉aptitude或yum包管理工具。在OS X平台下,同样有优秀的软件包管理工具,可以管理大量Apple没有提供,而你又经常会用到的开源软件包。我们有两种选择——MacPorts和Homebrew。
用过FreeBSD的人应该不会对它的包管理系统port感到陌生,而MacPorts正是由FreeBSD的port移植而来的。Homebrew则是一个全新的包管理系统,用Ruby进行开发。这两种包管理系统的工作方式都是下载source code然后在本地编译。但是这两种包管理系统还是存在很大差异的,主要差异有以下三点:
* MacPorts的理念是尽量减少对系统现有库的依赖,而Homebrew则是尽量依赖系统现有库。
* MacPorts的Package都是安装到/opt/local,而Homebrew的Package都是安装到/usr/local。
* Macports使用rsync进行同步(现在也可以使用svn,详情点击[这里](https://trac.macports.org/wiki/howto/SyncingWithSVN)),而Homebrew使用git进行同步。
MacPorts会自己重新编译系统现有库,编译时间较长,好处是不怎么依赖系统。同时Package都被安装到了/opt/local中,不会与系统现有的软件发生冲突。而Homebrew则正好相反,Homebrew会尽量使用系统现有库,所以编译时间会显著减少,坏处是与系统紧密依赖。同时Package都被安装到了/usr/local,有可能与系统自带的软件发生冲突。
总体来说,Homebrew使用简单,编译时间短,比较适合新手使用。MacPorts编译时间长,命令还要带上sudo,易用性上没有Homebrew好,但是比较干净,适合有洁癖的人使用(比如说我(^_-))。
还有最后一个问题,如果你使用了proxy或者firewall,MacPorts默认的rsync有可能会失效,请切换至svn方式进行同步。
### MacPorts
以下内容可能会随时间的推移而发生变化,请到[官方网站](https://www.macports.org/)查看最新文档( RTFM !!)
* 安装MacPorts:
1.安装Xcode和Xcode Command Line Tools
2.在终端中同意Xcode许可
sudo xcodebuild -license
3.到[这里](https://www.macports.org/install.php)选择与你系统版本相符的pkg包,下载并安装
* 常用命令
寻求帮助:
port help
这个命令可以指定动作,如:
port help selfupdate
同步 ports tree:
sudo port selfupdate
这个命令也会同时检测是否有新版本的MacPorts。
安装软件:
sudo port install gcc
列出所有可用包:
port list
当没有指定包名称时,会列出所有可用包,当指定了包名称时,会列出该包的所有可用版本。
查看已安装软件包:
port installed
查看可升级软件包:
port outdated
升级所有软件:
sudo port upgrade outdated
搜索某个软件:
port search gcc
查看软件包信息:
port info gcc
清除垃圾:
sudo port clean --all gcc
你也可以清除指定文件,详情自行port help clean。
卸载软件:
sudo port uninstall gcc
移除已升级的软件包不活跃的版本:
sudo port unistall inactive
列出软件包的依赖关系:
port deps gcc
* 高级使用技巧(Port Variants):
Port Variants为我们提供了一种自定义编译选项的方法(和Gentoo中的USE标签类似)。
获取可用的选项:
port variants gcc
调用variants进行编译:
sudo port -v install fetchmail +ssl
### Homebrew
Homebrew为Mac OS X提供了非常方便的软件安装方式,解决了包的依赖问题,不再需要烦人的sudo,一键式编译,无参数困扰。
由于Homebrew的安装方式可能变化,请到[官方网站](http://brew.sh)查看最新的方法和文档。
安装Homebrew:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew doctor
更新formula和Homebrew:
brew update
显示已经安装的软件列表:
brew list
搜索某个软件:
brew search wget
安装某个软件:
brew install wget
查看需要升级的软件:
brew outdated
升级所有的软件:
brew upgrade
升级某个软件:
brew upgrade wget
删除某个软件:
brew uninstall wget --force
查看软件包信息:
brew info wget
列出软件包的依赖关系:
brew deps wget
出错以后的处理:
brew update
brew doctor
### homebrew-cask
通常OS X下二进制软件是通过App Store安装的,homebrew-cask是一个基于HomeBrew的软件安装程序,使用homebrew-cask可以在命令行下安装软件包,相对Mac App Store,还有一些优势:
* 安装软件体验一致、简洁、优雅、快速
* 对常用软件支持更全面,例如MPlayerX已经宣布不在更新Mac App Store上的版本
* 软件更新速度快。例如Alfred 2.0已经出了很久,但在Mac App Store上还是1.2版本,QQ也是这样的情况
* Mac App Store生态圈远不完善,审核流程过长,限制太多,维护成本过高让很多应用开发者被迫离开。
homebrew-cask和Homebrew的区别:
* Homebrew安装的是源文件包, 下载源文件、编译、安装,比如安装wget, gnupg, mutt等。
* homebrew-cask安装的是二进制软件包, 比如QQ,Chrome,evernote等。homebrew-cask安装软件时自动创建软连接到Application目录,这样在Launchpad中也能查看到安装的软件,方便启动软件。
#### 安装homebrew-cask
brew install caskroom/cask/brew-cask
#### 常用命令
列出所有可以被安装的软件:
brew cask search
查找所有和drop相关的应用:
brew cask search drop
查看迅雷应用的信息:
brew cask info thunder
卸载QQ:
brew cask uninstall qq
查看已安装的软件
brew cask list
更新Casks:
brew update && brew upgrade brew-cask
关于软件更新,目前homebrew-cask并不提供命令直接更新已安装的软件,软件更新主要是通过软件自身的更新流程,不过也可以通过以下命令先删除软件,再重新安装。
brew cask uninstall APP && brew cask install APP
#### 一键装机?有了homebrew-cask就可以
brew cask install alfred
brew cask install qq
brew cask install skype
brew cask install thunder
brew cask install mplayerx
brew cask install evernote
brew cask install skitch
brew cask install dropbox
brew cask install google-chrome
brew cask install mou
brew cask install iterm2
brew cask install sublime-text
## iTerm2
Mac是一个具有精致图形界面的Unix平台,作为开发人员,经常会使用到终端(Terminal)或者称作控制台(Console)。系统自带的Terminal程序已经做得不错了,但是iTerm2的功能依然要更强大一些。
具体的安装和使用方法可以参见[官方网站](http://www.iterm2.com/)和搜索相关资料。
## Go2Shell
Go2Shell可以方便地实现在Finder当前目录中打开一个终端,如果你经常需要在Finder和终端下切换工作,那么Go2Shell是你的必备工具。
安装完毕之后进入Applications文件夹中按住command键拖动Go2Shell图标到Finder工具栏上,以后点击可开启终端到当前路径。
Go2Shell可以配合Iterm2使用,设置方式是在Termial執行下述命令
open -a go2shell --args config
跳出Go2Shell Setup,选iTerm2
## zsh
喜欢强大的zsh,直接切换成zsh
chsh -s /bin/zsh
## oh-my-zsh
## prezto(oh-my-zsh不要用?试试prezto)
https://github.com/sorin-ionescu/prezto
## tmux
## 浏览器
### Google Chrome
内置Intel HD 4000/HD 5000/Iris系列显卡的机器,比如2012 Mac Air, 2013 Mac pro 13等,在OS X操作系统上运行Chrome,会频繁发生操作系统死机的情况。这个问题在[2012.6.28就被Google确认](http://gizmodo.com/5922235/we-were-right-google-confirms-chrome-is-to-blame-for-crashing-macbooks),是OS X内核的一个Bug,直到现在一直没有修正。
临时的解决办法是,关闭Chrome的硬件加速, 在Chrome的设置里,选择"Show advanced settings",然后关闭选项"Use hardware acceleration when available"。
### Safari
### Firefox
## 编辑器
### Vim
https://github.com/perfectworks/vim
### Emacs
================================================
FILE: install.md
================================================
# 系统的安装
## 安装之前
重装之前,使用时光机器(Time Machine),将所有硬盘资料备份到移动硬盘上。这个也可以方便地作为系统快照,恢复之前某个时刻的机器的状态。数据无价,Time Machine是Mac最有价值的功能之一,一次设置,终生受益。不管是更换机器,重新安装系统,丢失机器,还是硬件损坏,Time Machine都是你最后的保障。
覆盖安装和全新安装(即抹盘安装),默认是覆盖安装。你可以在安装界面使用磁盘工具将系统盘抹掉,这样安装以后就是一个完全干净的系统,但是你的数据和程序也将完全清除。你也可以选择覆盖安装,安装之前无需将系统盘抹掉,这样不会丢失程序和数据,但是可能引起冲突、不一致等问题。
安装时,请将语言选为English,不要使用中文界面。碰到问题的时候,使用英文关键词,在互联网查找、搜索,可以比中文关键字获得更加准确和丰富的信息。
## 网络安装还是本地安装
Mac OS X支持网络安装和本地安装。网络安装,就是直接使用command+R,进入恢复模式,然后从互联网下载操作系统进行安装,整个过程自动、方便。安装的时候,注意只能使用wifi网络,并且仅支持WPA/WPA2加密方式,不支持WEP加密方式。
本地安装,就是预先下载安装镜像,制作安装盘,直接从本地安装盘安装。这样时间进度可控,出现问题的风险小。以后进行重新安装和恢复的时候,再也不用重新从网络长时间等待下载,整个安装过程一般在半个小时内完成。
苹果缺省的安装方式是网络安装,但是我们推荐使用本地安装方式。因为网络安装的方式在美国可能很适合,安装速度很快,但是中国大陆需要从境外服务器下载。Yosemite(10.10)安装镜像有5.2G大,即使你的网速有100Mbps或者更高,你也经常会发现网络安装的过程是一个痛苦的体验,往往看着安装进度条蜗牛一般前进,提示还有上百小时才能下载完毕。
## DNS服务器的选择
由于苹果的软件采用网络分发,下载服务器全球分布,选用不同的DNS会很大程度上影响软件的下载速度。推荐的一些DNS有:
* 114.114.114.114 南京信风
* 8.8.8.8 Google
* 178.79.131.110 V2EX
## 制作安装盘
### 分区
准备一个U盘或移动硬盘(大于等于6G),建议使用USB 3或者雷电高速接口。最好使用移动硬盘作为介质,速度比U盘快,同时可以将移动硬盘作为时光机器和恢复磁盘助手(Recovery Disk Assistant)。
首先在磁盘工具内的"Options"里,选择GUID,否则无法启动,然后在"Partision Layout"将移动硬盘分成三个分区:
* 分区名字Yosemite,大小8G,格式是Mac OS Extended(Journaled),本地磁盘安装介质的制作,方便以后安装系统。
* 分区名字recovery,大小2G,格式是Mac OS Extended(Journaled),恢复助手,用于对系统进行恢复。
* 分区名字data,剩余的磁盘空间,格式是Mac OS Extended(Journaled),数据备份和时光机器的介质。
### 制作安装盘
你可以从Mac App Store下载安装镜像:
https://itunes.apple.com/us/app/os-x-yosemite/id915041082?mt=12
从App Store完成下载后,OS X Yosemite安装程序会自动启动,不要点击继续,停在安装界面第一页。插入刚才分区好的移动硬盘或者U盘,在命令行输入下面的命令,制作安装盘:
sudo /Applications/Install\ OS\ X\ Yosemite.app/Contents/Resources/createinstallmedia --volume /Volumes/Yosemite --applicationpath /Applications/Install\ OS\ X\ Yosemite.app --nointeraction
等待创建完成,你就拥有了一个安装启动盘,以后都可以用来安装恢复系统。
### 制作恢复盘
苹果提供OS X Recovery Disk Assistant工具,这个工具将在本地磁盘制作一个恢复分区。下载地址:
http://support.apple.com/kb/dl1433
## 安装OS X
安装盘制作完毕后,重启并按Option键,选择安装盘安装。安装或者恢复之前,一般使用时光机器进行备份,然后用磁盘工具删掉之前的机器磁盘上的内容。
安装一般需要30分钟左右。
## 安装以后
* 更改安全设置
允许从所有来源安装应用程序,在Security and Privacy里设置"Allow apps downloaded from" 选项为"Anywhere"
* 更改触摸板默认设置
在"Trackpad"里打开"Tap to click"设置
================================================
FILE: java.md
================================================
# Java开发环境的设置
## Java安装
### 安装Mac原生的Java
Mac OS X 系统安装的时候,不带Java,但是可以通过简单的方法快速安装苹果原生的Java,版本是1.6。有三种安装方式:
* 第一次使用java程序,比如打开eclipse的时候,系统就会自动安装Java。
* 命令行下,执行下面的命令:
java -version
* 直接从苹果官方网站下载Java安装文件:
http://support.apple.com/kb/DL1572?viewlocale=zh_CN
### 安装新版的Java 1.7
从下列网站下载 Mac OS X 版本的JDK,文件名是jdk-7u51-macosx-x64.dmg:
http://www.oracle.com/technetwork/java/javase/downloads/index.html
## 设置JAVA_HOME环境变量
很多Java应用需要使用到JAVA_HOME环境变量,在Mac下,可以使用下面的方法,动态获取这个环境变量:
获取Java 1.6的JAVA_HOME:
/usr/libexec/java_home -v 1.6
获取Java 1.7的JAVA_HOME:
/usr/libexec/java_home -v 1.7
使用动态的方式设置JAVA_HOME的好处是,当自动升级了新版本的JAVA时,总能找到合适的JAVA_HOME目录。基于这个原因,程序员不要将文件安装在'/System'目录的JDK,因为Java升级的时候,文件会丢失。
也可以通过下列方法设置用户的环境变量,编辑文件'~/.zshrc'或'~/.bash_profile',加入下面两行之一:
对于Java 1.6:
export JAVA_HOME=`/usr/libexec/java_home -v 1.6`
export PATH=${JAVA_HOME}/bin:$PATH
对于Java 1.7:
export JAVA_HOME=`/usr/libexec/java_home -v 1.7`
export PATH=${JAVA_HOME}/bin:$PATH
## 扩展库(Extension Libraries)的目录位置
其他平台的Java软件使用'$JAVA_HOME/lib/ext'来存放扩展库的jar文件,Mac OS X的Java虽然也存在这一个'lib/ext'目录,你不能将jar文件存放在这个目录。'/Library/Java/Extensions'目录可以用来存放系统级别的jar文件或JNI库,'~/Library/Java/Extensions'目录用来存放用户级别的jar文件或JNI库。存放在这两个目录下的文件,不需要设置在classpath环境变量下,任何运行的java程序都可以直接使用。
## 安装Eclipse
### 手工安装
从下列地址下载Eclipse的相应版本,我一般选用'Eclipse IDE for Java EE Developers':
http://www.eclipse.org/downloads/
下载,解压文件,然后将eclipse目录拖到'Applications'目录,双击'/Applications/eclipse/'下的eclipse应用程序图标,就可以启动eclipse。
编辑文件'~/.zshrc'或'~/.bash_profile',加入:
export ECLIPSE_HOME=/Applications/eclipse
### 使用homebrew-cask安装
% brew cask alfred link
% brew cask install eclipse-ide
==> Downloading http://download.eclipse.org/technology/epp/downloads/release/kepler/SR1/e
######################################################################## 100.0%
==> Symlinking App 'Eclipse.app' to '/Users/ppyy/Applications/Eclipse.app'
==> Success! eclipse-ide installed to /opt/homebrew-cask/Caskroom/eclipse-ide/4.3.1
这里'brew cask alfred link'可以使homebrew cask安装的程序被Alfed搜索到,可以快速启动。
编辑文件'~/.zshrc'或'~/.bash_profile',加入:
export ECLIPSE_HOME=/opt/homebrew-cask/Caskroom/eclipse-ide/4.3.1/eclipse/
### eclipse的优化
安装完毕eclipse以后,为了优化eclipse的运行,可以编辑目录'$ECLIPSE_HOME/Eclipse.app/Contents/MacOS'下的eclipse.ini文件。如果没有设置ECLIPSE_HOME变量,则在'Finder'程序下,右键点击(Ctrl+点击)Eclipse执行程序,选择'Show Package Contents',然后选择Contents目录下的MacOS目录,打开eclipse.ini文件,修改下列一些变量:
--launcher.XXMaxPermSize
2048m
...
-vmargs
...
-Xms512m
-Xmx850m
-XX:PermSize=512m
-XX:MaxPermSize=1024m
## 安装ant, maven, tomcat, jetty
brew install ant maven tomcat jetty
================================================
FILE: php.md
================================================
# php开发环境设置
### hombrew
``` sh
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
```
可能需要翻墙,大概率需要`shadowsock`或者其他翻墙工具加上`proxychain-ng`可以做到翻墙使用homebrew。
### php环境
虽然Mac OS X 自带了php,但是我们可以选择使用Homebrew安装php56或者php54因为:
- 使用Homebrew安装更新的php版本
- 同时安装5.6和5.5和5.4的php
- Homebrew会同时安装xdebug和mcrypt等工具
安装python 56:
```
brew install homebrew/php/php56
brew install homebrew/php/php56-mcrypt
brew install homebrew/php/php56-xdebug
```
安装python 5.4:
```
brew install homebrew/php/php54
```
一般来说如果php安装了xdebug,大概率composer运行的时候会报错。所以用来运行脚本的php不能安装xdebug。可以这样把已经安装了xdebug调试工具的php从`PATH`中移除。
``` sh
brew unlink php56
```
### composer
##### 英文原版安装(需要翻墙)
参考网址https://getcomposer.org/doc/00-intro.md
You can place the Composer PHAR anywhere you wish. If you put it in a directorythat is part of your `PATH`, you can access it globally. On unixy systems youcan even make it executable and invoke it without directly using the `php`interpreter.
Run these commands to globally install `composer` on your system:
``` sh
curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer
```
A quick copy-paste version including sudo:
``` sh
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
```
##### 中文镜像库安装
参考网址http://docs.phpcomposer.com/00-intro.html
如果你把它放在系统的 `PATH` 目录中,你就能在全局访问它。 在类Unix系统中,你甚至可以在使用时不加 `php` 前缀。
你可以执行这些命令让 `composer` 在你的系统中进行全局调用:
``` sh
curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer
```
**注意:** 如果上诉命令因为权限执行失败,请使用 sudo 再次尝试运行 `mv` 那行命令。
或者
检查一些 PHP 的设置,然后下载 `composer.phar` 到你的工作目录中。这是 Composer 的二进制文件。这是一个 PHAR 包(PHP 的归档),这是 PHP 的归档格式可以帮助用户在命令行中执行一些操作。
你可以通过 `--install-dir` 选项指定 Composer 的安装目录(它可以是一个绝对或相对路径):
``` sh
curl -sS https://getcomposer.org/installer | php -- --install-dir=bin
```
================================================
FILE: python.en.md
================================================
# Configuration of the dev environment of Python
## Python (optional)
Although Mac OS X comes with Python, we can use Homebrew to intall Python 2.7.x because
* Use Homebrew to install more recent version of Python
* Intall Python 2.7.x and 3.x at the same time
* Homebrew will install tools like setuptools and pip
To install Python 2.7.x
brew install python --with-brewed-openssl
To install Python 3.x
brew install python3 --with-brewed-openssl
## pip
We use pip to manage packages:
sudo easy_install pip
## virtualenv virtualenvwrapper
To install packages:
sudo pip install virtualenv virtualenvwrapper
To create the virtualenv folder
mkdir ~/virtualenvs
To config virtualenv in .zshrc or .bash_profile
# virtualenvwrapper
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python
export WORKON_HOME=~/virtualenvs
[ -f /usr/local/bin/virtualenvwrapper.sh ] && source /usr/local/bin/virtualenvwrapper.sh
[ -f /etc/bash_completion.d/virtualenvwrapper ] && source /etc/bash_completion.d/virtualenvwrapper
export PIP_VIRTUALENV_BASE=$WORKON_HOME
export PIP_RESPECT_VIRTUALENV=true
To create the first python 2 virtualenv:
mkvirtualenv test
To create the first python 3 virtualenv:
mkvirtualenv -p python3 test
## PyCharm
PyCharm is the best Python IDE so far. There are community and professional versions for you to choose.
================================================
FILE: python.md
================================================
# python开发环境的设置
## Python (可选)
虽然Mac OS X 自带了Python,但是我们可以选择使用Homebrew安装Python 2.7.x。因为:
* 使用Homebrew安装更新的python版本
* 同时安装2.7.x和3.x的python
* Homebrew会同时安装setuptools和pip等工具
安装python 2.7.x:
brew install python --with-brewed-openssl
安装python 3.x:
brew install python3 --with-brewed-openssl
## pip
我们使用pip来管理软件包:
sudo easy_install pip
由于pip从pypi下载软件包,境外的pypi站点非常慢,导致安装缓慢或者下载失败。所幸清华大学和豆瓣都提供了pypi镜像,可以通过下面的配置文件来配置:
$ vim ~/.pip/pip.conf
; http://www.pypi-mirrors.org/
[global]
index-url=https://pypi.doubanio.com/simple
## virtualenv virtualenvwrapper
安装软件包:
sudo pip install virtualenv virtualenvwrapper
创建virtualenv目录:
mkdir ~/virtualenvs
在.zshrc或者.bash_profile里配置virtualenv:
# virtualenvwrapper
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python
export WORKON_HOME=~/virtualenvs
[ -f /usr/local/bin/virtualenvwrapper.sh ] && source /usr/local/bin/virtualenvwrapper.sh
[ -f /etc/bash_completion.d/virtualenvwrapper ] && source /etc/bash_completion.d/virtualenvwrapper
export PIP_VIRTUALENV_BASE=$WORKON_HOME
export PIP_RESPECT_VIRTUALENV=true
创建第一个python 2 的 virtualenv:
mkvirtualenv test
创建第一个python 3 的 virtualenv:
mkvirtualenv -p python3 test
## PyCharm
PyCharm是python最好的集成开发工具,目前有专业版和社区版可供选择。
================================================
FILE: recovery.md
================================================
# 备份和恢复
第一次使用Mac OS X下的时光机器(Time Machine),就被苹果如此完美贴心的备份恢复方案打动。数据无价,电脑里留下了岁月的痕迹和凝结了我们的心血,数据备份的重要性是怎么强调都不为过的。Time Machine是对这些数据最好的保护。只要你已经使用Time Machine备份过,设想一下:
* 当你的Mac丢失或者硬件损坏了以后,你只要从苹果商店新买一台Mac,然后从Time Machine备份中恢复。你会看到一个和之前一模一样的系统,包括数据、设置、状态。
* 当你给自己奖赏了一台新Mac时候,可以使用Time Machine将所有东西迁移过去。
* 当你误删除一个文档,几个月以后再想起来,可以从Time Machine恢复。
* 当你对一个文档做了多次修改,引入了一个错误,希望恢复某次正确的一个版本的时候,Time Machine可以帮助你。
如果你熟悉git,那Time Machine简直就是一个操作系统级别的版本控制!
当我安装好一个新的Mac OS X系统以后,第一件事情,就是设置Time Machine。
现在云存储已经普及,容量也足够大,但是Time Machine还是有不可替代的优势:
* 云存储没有版本历史,不能对之前的数据恢复。删除了就是删除了,也不能恢复之前某个时刻版本的数据资料。
* 云存储有隐私泄露的问题,爱德华·斯诺登给我们好好上了一课。
* 云存储不能解决恢复问题,仅仅只能做最基本的文件存储,不能在一台新的Mac上恢复所有数据和配置
简单地说,云存储就是一个简单的Windows操作系统级别的拷贝备份,和Time Machine细颗粒度,多版本,包括数据、配置、状态的完整备份恢复方案相比,弱爆了。
基于上述理由,郑重提醒,在设置Time Machine的exclude目录的时候,千万不要将云存储映射的目录排除在外。否则这些你认为已经被云存储保护过的资料,就不能享受Time Machine的保护,而这些资料往往是你最重要的资料。
## 准备工作
Time Machine可以使用下面一些方式进行,我还是选择简单、可靠、廉价的第一种方案:
* 本地外接移动硬盘
基于速度考虑,建议使用USB 3或者雷电高速接口,硬盘的大小可以选择1T或者2T,这个硬盘将伴随着你,保护你一生的数据资料。移动硬盘的分区方案,参见[安装]部分说明(https://github.com/pubyun/macdev/blob/master/install.md)
* 使用Time Capsule
无线方案,使用方便。缺点是Time Capsule发热量大,速度相对于有线方案也较慢。
* 如果你有一台Linux服务器,可以安装netatalk软件
看上去是一个理想的方案,但是设置好备份以后,不知道由于什么原因出现过几次备份无效,导致需要完全重新备份,后来丢弃了这个方案。
## Time Machine的设置
Time Machine这么强大的功能,设置其实很简单,苹果官方网站有详细的[指南](http://support.apple.com/kb/HT1427?viewlocale=zh_CN),我在这里就不再重复。
需要注意的是,Mac OS X会在运行中产生一些临时数据或者中间数据,这些数据往往占用空间较大,而没有保存价值,可以设置成exclude,常见的有:
/Library/Application Support/
/Library/Caches/
/private/var/log/
/private/var/vm/
/private/var/tmp/
~/Downloads/
~/Library/Caches
~/Library/Application Support/MobileSync/
~/.Trash/
~/Documents/Virtual\ Machines.localized/
~/Library/Parallels
备份完毕以后,移动硬盘需要在Finder下umount才能拔出,否则有可能数据丢失。
================================================
FILE: refs.md
================================================
# 参考文档
* [OS X键盘快捷键] (http://support.apple.com/kb/HT1343?viewlocale=zh_CN)
* [Multi-Touch手势] (http://support.apple.com/kb/HT4721?viewlocale=zh_CN)
* [Time Machine备份Mac] (http://support.apple.com/kb/HT1427?viewlocale=zh_CN)
* [全面了解电池] (http://support.apple.com/kb/HT1446?viewlocale=zh_CN)
* [基于Intel的Mac的启动组合键] (http://support.apple.com/kb/HT1533?viewlocale=zh_CN)
* [mac-dev-setup] (https://github.com/nicolashery/mac-dev-setup)
* [mac-dev] (http://www.yangzhiping.com/tech/mac-dev.html)
* [Best-App] (https://github.com/hzlzh/Best-App)
* [laptop] (https://github.com/thoughtbot/laptop)
* [简单4步,创建 OS X Mavericks USB 安装启动盘] (http://ksmx.me/blog/2013/10/24/create-an-os-x-mavericks-usb-installer/)
* [How to make a bootable OS X 10.10 Yosemite install drive] (http://www.macworld.com/article/2367748/how-to-make-a-bootable-os-x-10-10-yosemite-install-drive.html)
gitextract_vnw1v3h0/ ├── LICENSE ├── README.md ├── apps.md ├── basic.md ├── install.md ├── java.md ├── php.md ├── python.en.md ├── python.md ├── recovery.md └── refs.md
Condensed preview — 11 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (58K chars).
[
{
"path": "LICENSE",
"chars": 35121,
"preview": "GNU GENERAL PUBLIC LICENSE\n Version 3, 29 June 2007\n\n Copyright (C) 2007 Free Software Foundation,"
},
{
"path": "README.md",
"chars": 1935,
"preview": "# Mac for Developer v0.1\n\n将本人在使用Mac作为开发工具的过程中的一些体会做个记录和整理,方便以后自己和团队的参考,提高效率。如果本文对其他开发人员也有所帮助,欢迎您给给出反馈或者提出改进意见。\n\n本文假设您是一个"
},
{
"path": "apps.md",
"chars": 1508,
"preview": "# 常用软件\n\n## 效率工具\n\n* Evernote(知识管理工具)\n * Geeknote (终端版Evernote)\n* OmniFocus(GTD极品,学习成本比较高)\n* OmniGraffle(流程图)\n* OmniOut"
},
{
"path": "basic.md",
"chars": 5681,
"preview": "# 基本设置\n\n## Alfred\n\nAlfred是Mac平台上使用最频繁的效率工具,被誉为神兵利器。Alfred 2发布以后,在免费版的基础上加入了Powerpack模式,引入了工作流的概念,可以做出远比快速启动和自定义搜索更酷的事情。\n"
},
{
"path": "install.md",
"chars": 2140,
"preview": "# 系统的安装\n\n## 安装之前\n\n重装之前,使用时光机器(Time Machine),将所有硬盘资料备份到移动硬盘上。这个也可以方便地作为系统快照,恢复之前某个时刻的机器的状态。数据无价,Time Machine是Mac最有价值的功能之一"
},
{
"path": "java.md",
"chars": 2663,
"preview": "# Java开发环境的设置\n\n## Java安装\n\n### 安装Mac原生的Java\n\nMac OS X 系统安装的时候,不带Java,但是可以通过简单的方法快速安装苹果原生的Java,版本是1.6。有三种安装方式:\n\n* 第一次使用jav"
},
{
"path": "php.md",
"chars": 1892,
"preview": "# php开发环境设置\n\n### hombrew\n\n``` sh\nruby -e \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install"
},
{
"path": "python.en.md",
"chars": 1394,
"preview": "# Configuration of the dev environment of Python\n\n## Python (optional)\nAlthough Mac OS X comes with Python, we can use H"
},
{
"path": "python.md",
"chars": 1289,
"preview": "# python开发环境的设置\n\n## Python (可选)\n\n虽然Mac OS X 自带了Python,但是我们可以选择使用Homebrew安装Python 2.7.x。因为:\n\n* 使用Homebrew安装更新的python版本\n* "
},
{
"path": "recovery.md",
"chars": 1771,
"preview": "# 备份和恢复\n\n第一次使用Mac OS X下的时光机器(Time Machine),就被苹果如此完美贴心的备份恢复方案打动。数据无价,电脑里留下了岁月的痕迹和凝结了我们的心血,数据备份的重要性是怎么强调都不为过的。Time Machine"
},
{
"path": "refs.md",
"chars": 863,
"preview": "# 参考文档\n\n* [OS X键盘快捷键] (http://support.apple.com/kb/HT1343?viewlocale=zh_CN)\n* [Multi-Touch手势] (http://support.apple.com/"
}
]
About this extraction
This page contains the full source code of the pubyun/macdev GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 11 files (54.9 KB), approximately 16.1k tokens. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.