├── LICENSE ├── README.md ├── apps.md ├── basic.md ├── install.md ├── java.md ├── php.md ├── python.en.md ├── python.md ├── recovery.md └── refs.md /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | {one line to give the program's name and a brief idea of what it does.} 635 | Copyright (C) {year} {name of author} 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | {project} Copyright (C) {year} {fullname} 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Mac for Developer v0.1 2 | 3 | 将本人在使用Mac作为开发工具的过程中的一些体会做个记录和整理,方便以后自己和团队的参考,提高效率。如果本文对其他开发人员也有所帮助,欢迎您给给出反馈或者提出改进意见。 4 | 5 | 本文假设您是一个开发工程师,并且是一个Mac的新手。这些步骤在OS X Yosemite下测试通过。 6 | 7 | 欢迎大家一起改进这个项目,请`Fork`、`Star`或在[Issues](https://github.com/pubyun/macdev/issues)中提交 :) 8 | Please improve this project together. Submit your ideas by `Fork`、`Star` or [Issues](https://github.com/pubyun/macdev/issues) :) 9 | 10 | 您也可以关注我的[新浪微博](http://weibo.com/pubyun),以获取最新消息。 11 | You can also follow my [weibo](http://weibo.com/pubyun) for the latest news. 12 | 13 | ## Catalog 14 | 15 | * [Installation of OS X](https://github.com/pubyun/macdev/blob/master/install.md) 16 | * [Backup and recovery of OS X](https://github.com/pubyun/macdev/blob/master/recovery.md) 17 | * [Basic configuration](https://github.com/pubyun/macdev/blob/master/basic.md) 18 | * [Development enviroment of Python](https://github.com/pubyun/macdev/blob/master/python.en.md) 19 | * Development enviroment of Ruby - Work in progress ... 20 | * [Development enviroment of Java](https://github.com/pubyun/macdev/blob/master/java.md) 21 | * [Development enviroment of PHP](https://github.com/pubyun/macdev/blob/master/php.md) 22 | * [Useful software](https://github.com/pubyun/macdev/blob/master/apps.md) 23 | * Config - Work in progress ... 24 | * Common hotkey - Work in progress ... 25 | * [Reference documentation](https://github.com/pubyun/macdev/blob/master/refs.md) 26 | 27 | 28 | ## 目录 29 | 30 | * [OS X的安装](https://github.com/pubyun/macdev/blob/master/install.md) 31 | * [OS X的备份和恢复](https://github.com/pubyun/macdev/blob/master/recovery.md) 32 | * [基本设置](https://github.com/pubyun/macdev/blob/master/basic.md) 33 | * [python开发环境的设置](https://github.com/pubyun/macdev/blob/master/python.md) 34 | * ruby开发环境的设置 - 整理中... 35 | * [Java开发环境的设置](https://github.com/pubyun/macdev/blob/master/java.md) 36 | * [PHP开发环境的设置](https://github.com/pubyun/macdev/blob/master/php.md) 37 | * [常用软件](https://github.com/pubyun/macdev/blob/master/apps.md) 38 | * 配置文件 - 整理中 ... 39 | * 常用快捷键 - 整理中 ... 40 | * [参考文档](https://github.com/pubyun/macdev/blob/master/refs.md) 41 | -------------------------------------------------------------------------------- /apps.md: -------------------------------------------------------------------------------- 1 | # 常用软件 2 | 3 | ## 效率工具 4 | 5 | * Evernote(知识管理工具) 6 | * Geeknote (终端版Evernote) 7 | * OmniFocus(GTD极品,学习成本比较高) 8 | * OmniGraffle(流程图) 9 | * OmniOutliner(提纲思路) 10 | * Oh My Zsh 11 | * autojump (直达目录) 12 | 13 | ## The missing package manager for OS X 14 | * Homebrew 15 | 16 | ## 系统工具 17 | 18 | * JiTouch 19 | * OnyX 20 | * XQuartz(X11) 21 | * CleanMyMac 3(垃圾清理) 22 | * iterm2(终端) 23 | * ShiftIt(快捷键窗口控制) 24 | * Asepsis (转存 .DS_Store) 25 | * Gas Mask(Host切换) 26 | * Itsycal(显示日历) 27 | * cd to 28 | * XtraFinder(Finder扩展) 29 | * Alfred(万能搜索) 30 | * KeyCue(快捷键大全) 31 | * PopClip(增强复制粘贴) 32 | * FileZilla (FTP工具) 33 | * Retina DisplayMenu (更改显示器分辨率, 可超频) 34 | 35 | ## 压缩和解压缩 36 | 37 | * BetterZip 38 | * The Unarchiver 39 | 40 | ## 浏览器 41 | 42 | * Chrome 43 | * Firefox 44 | 45 | ## 密码管理 46 | 47 | * lastpass 48 | * 1password 49 | 50 | ## 即时通讯 51 | 52 | * QQ 53 | * AliWangWang 54 | * Skype 55 | * LimeChat(IRC) 56 | 57 | ## 虚拟机 58 | 59 | * Parallels Desktop 60 | * VMware fusion 61 | * Genymotion(Android虚拟机) 62 | * VirtualBox 63 | 64 | ## 云存储 65 | 66 | * 百度云 67 | * 腾讯微云 68 | * Dropbox 69 | 70 | ## VPN 和翻墙 71 | 72 | * GoAgentX 73 | * Tunnelblick 74 | * ShadowsocksX 75 | 76 | ## 开发相关 77 | 78 | * Dash 79 | * Vagrant 80 | * Mou(Markdown编辑器) 81 | * Haroopad(Markdown编辑器) 82 | * MacDown (Markdown 编辑器) 83 | * Atom (IDE) 84 | * TextMate(编辑器) 85 | * Sublime Text(编辑器) 86 | * XCode(IDE) 87 | * Eclipse(IDE) 88 | * IntelliJ IDEA(IDE) 89 | * PyCharm(Python IDE) 90 | * PHPStorm(PHP IDE) 91 | * WebStorm(Js IDE) 92 | * Wireshark(网络流量分析) 93 | * CocoaPacketAnalyzer(网络流量分析) 94 | * SourceTree(Git图形客户端) 95 | * GitHub Desktop(Git图形客户端) 96 | * SmartSVN(SVN图形客户端) 97 | * Navicat(数据库管理) 98 | * RoboMongo(MongoDB数据库管理) 99 | * Axure(原型设计) 100 | * Coda2(网页开发) 101 | * xScope(设计度量) 102 | * Kaleidoscope(文件比较) 103 | * DiffMerge(文件比较) 104 | * DiffFork(更好的文件比较) 105 | 106 | ## 输入法 107 | 108 | * 搜狗输入法 109 | * 百度输入法 110 | * QQ输入法 111 | * 鼠鬚管(开源) 112 | 113 | ## 设计相关 114 | 115 | * Adobe CC 116 | * Corel Painter 117 | 118 | ## 其他 119 | 120 | * 迅雷 121 | * VLC(影音) 122 | * f.lux (自动调节色温保护眼睛) 123 | * CoRD(RDP远程桌面) 124 | * TeamViewer(远程控制) 125 | -------------------------------------------------------------------------------- /basic.md: -------------------------------------------------------------------------------- 1 | # 基本设置 2 | 3 | ## Alfred 4 | 5 | Alfred是Mac平台上使用最频繁的效率工具,被誉为神兵利器。Alfred 2发布以后,在免费版的基础上加入了Powerpack模式,引入了工作流的概念,可以做出远比快速启动和自定义搜索更酷的事情。 6 | 7 | 免费版的Alfred已经可以满足我们的日常需要,极大提高我们的工作效率,常用的功能有: 8 | 9 | * 快速查找程序和文件 10 | * 快速搜索互联网 11 | * 快速搜索联系人 12 | * 计算器和字典 13 | * 剪贴板和代码片段 14 | * 强大的扩展功能和工作流 15 | 16 | 具体的安装和使用方法可以参见[官方网站](http://www.alfredapp.com/)和搜索相关资料。 17 | 18 | ## Xcode Command Line Tools 19 | 20 | Xcode是Apple的一个开发工具和库集合,Xcode Command Line Tools是Xcode的一部分。安装很多Unix软件都需要使用GCC编译器等开发工具,Xcode Command Line Tools就包含这些工具。 21 | 22 | 检查Xcode Command Line Tools是否已经安装: 23 | 24 | $ xcode-select -p 25 | /Applications/Xcode.app/Contents/Developer 26 | 27 | 打开一个终端窗口(Terminal),运行命令: 28 | 29 | xcode-select --install 30 | 31 | 然后点击"Install"按钮,安装Xcode的命令行工具 32 | 33 | ## 软件包管理工具 34 | 35 | 使用过Debian或者RedHat的操作系统的人,一定非常熟悉aptitude或yum包管理工具。在OS X平台下,同样有优秀的软件包管理工具,可以管理大量Apple没有提供,而你又经常会用到的开源软件包。我们有两种选择——MacPorts和Homebrew。 36 | 37 | 用过FreeBSD的人应该不会对它的包管理系统port感到陌生,而MacPorts正是由FreeBSD的port移植而来的。Homebrew则是一个全新的包管理系统,用Ruby进行开发。这两种包管理系统的工作方式都是下载source code然后在本地编译。但是这两种包管理系统还是存在很大差异的,主要差异有以下三点: 38 | 39 | * MacPorts的理念是尽量减少对系统现有库的依赖,而Homebrew则是尽量依赖系统现有库。 40 | * MacPorts的Package都是安装到/opt/local,而Homebrew的Package都是安装到/usr/local。 41 | * Macports使用rsync进行同步(现在也可以使用svn,详情点击[这里](https://trac.macports.org/wiki/howto/SyncingWithSVN)),而Homebrew使用git进行同步。 42 | 43 | MacPorts会自己重新编译系统现有库,编译时间较长,好处是不怎么依赖系统。同时Package都被安装到了/opt/local中,不会与系统现有的软件发生冲突。而Homebrew则正好相反,Homebrew会尽量使用系统现有库,所以编译时间会显著减少,坏处是与系统紧密依赖。同时Package都被安装到了/usr/local,有可能与系统自带的软件发生冲突。 44 | 45 | 总体来说,Homebrew使用简单,编译时间短,比较适合新手使用。MacPorts编译时间长,命令还要带上sudo,易用性上没有Homebrew好,但是比较干净,适合有洁癖的人使用(比如说我(^_-))。 46 | 47 | 还有最后一个问题,如果你使用了proxy或者firewall,MacPorts默认的rsync有可能会失效,请切换至svn方式进行同步。 48 | 49 | ### MacPorts 50 | 51 | 以下内容可能会随时间的推移而发生变化,请到[官方网站](https://www.macports.org/)查看最新文档( RTFM !!) 52 | 53 | * 安装MacPorts: 54 | 55 | 1.安装Xcode和Xcode Command Line Tools 56 | 57 | 2.在终端中同意Xcode许可 58 | 59 | sudo xcodebuild -license 60 | 61 | 3.到[这里](https://www.macports.org/install.php)选择与你系统版本相符的pkg包,下载并安装 62 | 63 | * 常用命令 64 | 65 | 寻求帮助: 66 | 67 | port help 68 | 这个命令可以指定动作,如: 69 | 70 | port help selfupdate 71 | 72 | 同步 ports tree: 73 | 74 | sudo port selfupdate 75 | 这个命令也会同时检测是否有新版本的MacPorts。 76 | 77 | 安装软件: 78 | 79 | sudo port install gcc 80 | 81 | 列出所有可用包: 82 | 83 | port list 84 | 当没有指定包名称时,会列出所有可用包,当指定了包名称时,会列出该包的所有可用版本。 85 | 86 | 查看已安装软件包: 87 | 88 | port installed 89 | 90 | 查看可升级软件包: 91 | 92 | port outdated 93 | 94 | 升级所有软件: 95 | 96 | sudo port upgrade outdated 97 | 98 | 搜索某个软件: 99 | 100 | port search gcc 101 | 102 | 查看软件包信息: 103 | 104 | port info gcc 105 | 106 | 清除垃圾: 107 | 108 | sudo port clean --all gcc 109 | 你也可以清除指定文件,详情自行port help clean。 110 | 111 | 卸载软件: 112 | 113 | sudo port uninstall gcc 114 | 115 | 移除已升级的软件包不活跃的版本: 116 | 117 | sudo port unistall inactive 118 | 119 | 列出软件包的依赖关系: 120 | 121 | port deps gcc 122 | 123 | * 高级使用技巧(Port Variants): 124 | 125 | Port Variants为我们提供了一种自定义编译选项的方法(和Gentoo中的USE标签类似)。 126 | 127 | 获取可用的选项: 128 | 129 | port variants gcc 130 | 131 | 调用variants进行编译: 132 | 133 | sudo port -v install fetchmail +ssl 134 | 135 | ### Homebrew 136 | 137 | Homebrew为Mac OS X提供了非常方便的软件安装方式,解决了包的依赖问题,不再需要烦人的sudo,一键式编译,无参数困扰。 138 | 139 | 由于Homebrew的安装方式可能变化,请到[官方网站](http://brew.sh)查看最新的方法和文档。 140 | 141 | 安装Homebrew: 142 | 143 | ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" 144 | brew doctor 145 | 146 | 更新formula和Homebrew: 147 | 148 | brew update 149 | 150 | 显示已经安装的软件列表: 151 | 152 | brew list 153 | 154 | 搜索某个软件: 155 | 156 | brew search wget 157 | 158 | 安装某个软件: 159 | 160 | brew install wget 161 | 162 | 查看需要升级的软件: 163 | 164 | brew outdated 165 | 166 | 升级所有的软件: 167 | 168 | brew upgrade 169 | 170 | 升级某个软件: 171 | 172 | brew upgrade wget 173 | 174 | 删除某个软件: 175 | 176 | brew uninstall wget --force 177 | 178 | 查看软件包信息: 179 | 180 | brew info wget 181 | 182 | 列出软件包的依赖关系: 183 | 184 | brew deps wget 185 | 186 | 出错以后的处理: 187 | 188 | brew update 189 | brew doctor 190 | 191 | ### homebrew-cask 192 | 193 | 通常OS X下二进制软件是通过App Store安装的,homebrew-cask是一个基于HomeBrew的软件安装程序,使用homebrew-cask可以在命令行下安装软件包,相对Mac App Store,还有一些优势: 194 | 195 | * 安装软件体验一致、简洁、优雅、快速 196 | * 对常用软件支持更全面,例如MPlayerX已经宣布不在更新Mac App Store上的版本 197 | * 软件更新速度快。例如Alfred 2.0已经出了很久,但在Mac App Store上还是1.2版本,QQ也是这样的情况 198 | * Mac App Store生态圈远不完善,审核流程过长,限制太多,维护成本过高让很多应用开发者被迫离开。 199 | 200 | homebrew-cask和Homebrew的区别: 201 | 202 | * Homebrew安装的是源文件包, 下载源文件、编译、安装,比如安装wget, gnupg, mutt等。 203 | * homebrew-cask安装的是二进制软件包, 比如QQ,Chrome,evernote等。homebrew-cask安装软件时自动创建软连接到Application目录,这样在Launchpad中也能查看到安装的软件,方便启动软件。 204 | 205 | #### 安装homebrew-cask 206 | 207 | brew install caskroom/cask/brew-cask 208 | 209 | #### 常用命令 210 | 211 | 列出所有可以被安装的软件: 212 | 213 | brew cask search 214 | 215 | 查找所有和drop相关的应用: 216 | 217 | brew cask search drop 218 | 219 | 查看迅雷应用的信息: 220 | 221 | brew cask info thunder 222 | 223 | 卸载QQ: 224 | 225 | brew cask uninstall qq 226 | 227 | 查看已安装的软件 228 | 229 | brew cask list 230 | 231 | 更新Casks: 232 | 233 | brew update && brew upgrade brew-cask 234 | 235 | 关于软件更新,目前homebrew-cask并不提供命令直接更新已安装的软件,软件更新主要是通过软件自身的更新流程,不过也可以通过以下命令先删除软件,再重新安装。 236 | 237 | brew cask uninstall APP && brew cask install APP 238 | 239 | 240 | #### 一键装机?有了homebrew-cask就可以 241 | 242 | brew cask install alfred 243 | brew cask install qq 244 | brew cask install skype 245 | brew cask install thunder 246 | brew cask install mplayerx 247 | brew cask install evernote 248 | brew cask install skitch 249 | brew cask install dropbox 250 | brew cask install google-chrome 251 | brew cask install mou 252 | brew cask install iterm2 253 | brew cask install sublime-text 254 | 255 | ## iTerm2 256 | 257 | Mac是一个具有精致图形界面的Unix平台,作为开发人员,经常会使用到终端(Terminal)或者称作控制台(Console)。系统自带的Terminal程序已经做得不错了,但是iTerm2的功能依然要更强大一些。 258 | 259 | 具体的安装和使用方法可以参见[官方网站](http://www.iterm2.com/)和搜索相关资料。 260 | 261 | ## Go2Shell 262 | 263 | Go2Shell可以方便地实现在Finder当前目录中打开一个终端,如果你经常需要在Finder和终端下切换工作,那么Go2Shell是你的必备工具。 264 | 265 | 安装完毕之后进入Applications文件夹中按住command键拖动Go2Shell图标到Finder工具栏上,以后点击可开启终端到当前路径。 266 | 267 | Go2Shell可以配合Iterm2使用,设置方式是在Termial執行下述命令 268 | 269 | open -a go2shell --args config 270 | 271 | 跳出Go2Shell Setup,选iTerm2 272 | 273 | ## zsh 274 | 275 | 喜欢强大的zsh,直接切换成zsh 276 | 277 | chsh -s /bin/zsh 278 | 279 | ## oh-my-zsh 280 | 281 | ## prezto(oh-my-zsh不要用?试试prezto) 282 | 283 | https://github.com/sorin-ionescu/prezto 284 | 285 | ## tmux 286 | 287 | ## 浏览器 288 | 289 | ### Google Chrome 290 | 291 | 内置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,直到现在一直没有修正。 292 | 293 | 临时的解决办法是,关闭Chrome的硬件加速, 在Chrome的设置里,选择"Show advanced settings",然后关闭选项"Use hardware acceleration when available"。 294 | 295 | ### Safari 296 | 297 | ### Firefox 298 | 299 | ## 编辑器 300 | 301 | ### Vim 302 | 303 | https://github.com/perfectworks/vim 304 | 305 | ### Emacs 306 | -------------------------------------------------------------------------------- /install.md: -------------------------------------------------------------------------------- 1 | # 系统的安装 2 | 3 | ## 安装之前 4 | 5 | 重装之前,使用时光机器(Time Machine),将所有硬盘资料备份到移动硬盘上。这个也可以方便地作为系统快照,恢复之前某个时刻的机器的状态。数据无价,Time Machine是Mac最有价值的功能之一,一次设置,终生受益。不管是更换机器,重新安装系统,丢失机器,还是硬件损坏,Time Machine都是你最后的保障。 6 | 7 | 覆盖安装和全新安装(即抹盘安装),默认是覆盖安装。你可以在安装界面使用磁盘工具将系统盘抹掉,这样安装以后就是一个完全干净的系统,但是你的数据和程序也将完全清除。你也可以选择覆盖安装,安装之前无需将系统盘抹掉,这样不会丢失程序和数据,但是可能引起冲突、不一致等问题。 8 | 9 | 安装时,请将语言选为English,不要使用中文界面。碰到问题的时候,使用英文关键词,在互联网查找、搜索,可以比中文关键字获得更加准确和丰富的信息。 10 | 11 | ## 网络安装还是本地安装 12 | 13 | Mac OS X支持网络安装和本地安装。网络安装,就是直接使用command+R,进入恢复模式,然后从互联网下载操作系统进行安装,整个过程自动、方便。安装的时候,注意只能使用wifi网络,并且仅支持WPA/WPA2加密方式,不支持WEP加密方式。 14 | 15 | 本地安装,就是预先下载安装镜像,制作安装盘,直接从本地安装盘安装。这样时间进度可控,出现问题的风险小。以后进行重新安装和恢复的时候,再也不用重新从网络长时间等待下载,整个安装过程一般在半个小时内完成。 16 | 17 | 苹果缺省的安装方式是网络安装,但是我们推荐使用本地安装方式。因为网络安装的方式在美国可能很适合,安装速度很快,但是中国大陆需要从境外服务器下载。Yosemite(10.10)安装镜像有5.2G大,即使你的网速有100Mbps或者更高,你也经常会发现网络安装的过程是一个痛苦的体验,往往看着安装进度条蜗牛一般前进,提示还有上百小时才能下载完毕。 18 | 19 | ## DNS服务器的选择 20 | 21 | 由于苹果的软件采用网络分发,下载服务器全球分布,选用不同的DNS会很大程度上影响软件的下载速度。推荐的一些DNS有: 22 | 23 | * 114.114.114.114 南京信风 24 | 25 | * 8.8.8.8 Google 26 | 27 | * 178.79.131.110 V2EX 28 | 29 | ## 制作安装盘 30 | 31 | ### 分区 32 | 33 | 准备一个U盘或移动硬盘(大于等于6G),建议使用USB 3或者雷电高速接口。最好使用移动硬盘作为介质,速度比U盘快,同时可以将移动硬盘作为时光机器和恢复磁盘助手(Recovery Disk Assistant)。 34 | 35 | 首先在磁盘工具内的"Options"里,选择GUID,否则无法启动,然后在"Partision Layout"将移动硬盘分成三个分区: 36 | 37 | * 分区名字Yosemite,大小8G,格式是Mac OS Extended(Journaled),本地磁盘安装介质的制作,方便以后安装系统。 38 | 39 | * 分区名字recovery,大小2G,格式是Mac OS Extended(Journaled),恢复助手,用于对系统进行恢复。 40 | 41 | * 分区名字data,剩余的磁盘空间,格式是Mac OS Extended(Journaled),数据备份和时光机器的介质。 42 | 43 | ### 制作安装盘 44 | 45 | 你可以从Mac App Store下载安装镜像: 46 | 47 | https://itunes.apple.com/us/app/os-x-yosemite/id915041082?mt=12 48 | 49 | 从App Store完成下载后,OS X Yosemite安装程序会自动启动,不要点击继续,停在安装界面第一页。插入刚才分区好的移动硬盘或者U盘,在命令行输入下面的命令,制作安装盘: 50 | 51 | sudo /Applications/Install\ OS\ X\ Yosemite.app/Contents/Resources/createinstallmedia --volume /Volumes/Yosemite --applicationpath /Applications/Install\ OS\ X\ Yosemite.app --nointeraction 52 | 53 | 等待创建完成,你就拥有了一个安装启动盘,以后都可以用来安装恢复系统。 54 | 55 | ### 制作恢复盘 56 | 57 | 苹果提供OS X Recovery Disk Assistant工具,这个工具将在本地磁盘制作一个恢复分区。下载地址: 58 | 59 | http://support.apple.com/kb/dl1433 60 | 61 | ## 安装OS X 62 | 63 | 安装盘制作完毕后,重启并按Option键,选择安装盘安装。安装或者恢复之前,一般使用时光机器进行备份,然后用磁盘工具删掉之前的机器磁盘上的内容。 64 | 65 | 安装一般需要30分钟左右。 66 | 67 | ## 安装以后 68 | 69 | * 更改安全设置 70 | 71 | 允许从所有来源安装应用程序,在Security and Privacy里设置"Allow apps downloaded from" 选项为"Anywhere" 72 | 73 | * 更改触摸板默认设置 74 | 75 | 在"Trackpad"里打开"Tap to click"设置 76 | -------------------------------------------------------------------------------- /java.md: -------------------------------------------------------------------------------- 1 | # Java开发环境的设置 2 | 3 | ## Java安装 4 | 5 | ### 安装Mac原生的Java 6 | 7 | Mac OS X 系统安装的时候,不带Java,但是可以通过简单的方法快速安装苹果原生的Java,版本是1.6。有三种安装方式: 8 | 9 | * 第一次使用java程序,比如打开eclipse的时候,系统就会自动安装Java。 10 | 11 | * 命令行下,执行下面的命令: 12 | 13 | java -version 14 | 15 | * 直接从苹果官方网站下载Java安装文件: 16 | 17 | http://support.apple.com/kb/DL1572?viewlocale=zh_CN 18 | 19 | ### 安装新版的Java 1.7 20 | 21 | 从下列网站下载 Mac OS X 版本的JDK,文件名是jdk-7u51-macosx-x64.dmg: 22 | 23 | http://www.oracle.com/technetwork/java/javase/downloads/index.html 24 | 25 | ## 设置JAVA_HOME环境变量 26 | 27 | 很多Java应用需要使用到JAVA_HOME环境变量,在Mac下,可以使用下面的方法,动态获取这个环境变量: 28 | 29 | 获取Java 1.6的JAVA_HOME: 30 | 31 | /usr/libexec/java_home -v 1.6 32 | 33 | 获取Java 1.7的JAVA_HOME: 34 | 35 | /usr/libexec/java_home -v 1.7 36 | 37 | 使用动态的方式设置JAVA_HOME的好处是,当自动升级了新版本的JAVA时,总能找到合适的JAVA_HOME目录。基于这个原因,程序员不要将文件安装在'/System'目录的JDK,因为Java升级的时候,文件会丢失。 38 | 39 | 也可以通过下列方法设置用户的环境变量,编辑文件'~/.zshrc'或'~/.bash_profile',加入下面两行之一: 40 | 41 | 对于Java 1.6: 42 | 43 | export JAVA_HOME=`/usr/libexec/java_home -v 1.6` 44 | export PATH=${JAVA_HOME}/bin:$PATH 45 | 46 | 对于Java 1.7: 47 | 48 | export JAVA_HOME=`/usr/libexec/java_home -v 1.7` 49 | export PATH=${JAVA_HOME}/bin:$PATH 50 | 51 | ## 扩展库(Extension Libraries)的目录位置 52 | 53 | 其他平台的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程序都可以直接使用。 54 | 55 | ## 安装Eclipse 56 | 57 | ### 手工安装 58 | 59 | 从下列地址下载Eclipse的相应版本,我一般选用'Eclipse IDE for Java EE Developers': 60 | 61 | http://www.eclipse.org/downloads/ 62 | 63 | 下载,解压文件,然后将eclipse目录拖到'Applications'目录,双击'/Applications/eclipse/'下的eclipse应用程序图标,就可以启动eclipse。 64 | 65 | 编辑文件'~/.zshrc'或'~/.bash_profile',加入: 66 | 67 | export ECLIPSE_HOME=/Applications/eclipse 68 | 69 | ### 使用homebrew-cask安装 70 | 71 | % brew cask alfred link 72 | % brew cask install eclipse-ide 73 | ==> Downloading http://download.eclipse.org/technology/epp/downloads/release/kepler/SR1/e 74 | ######################################################################## 100.0% 75 | ==> Symlinking App 'Eclipse.app' to '/Users/ppyy/Applications/Eclipse.app' 76 | ==> Success! eclipse-ide installed to /opt/homebrew-cask/Caskroom/eclipse-ide/4.3.1 77 | 78 | 这里'brew cask alfred link'可以使homebrew cask安装的程序被Alfed搜索到,可以快速启动。 79 | 80 | 编辑文件'~/.zshrc'或'~/.bash_profile',加入: 81 | 82 | export ECLIPSE_HOME=/opt/homebrew-cask/Caskroom/eclipse-ide/4.3.1/eclipse/ 83 | 84 | ### eclipse的优化 85 | 86 | 安装完毕eclipse以后,为了优化eclipse的运行,可以编辑目录'$ECLIPSE_HOME/Eclipse.app/Contents/MacOS'下的eclipse.ini文件。如果没有设置ECLIPSE_HOME变量,则在'Finder'程序下,右键点击(Ctrl+点击)Eclipse执行程序,选择'Show Package Contents',然后选择Contents目录下的MacOS目录,打开eclipse.ini文件,修改下列一些变量: 87 | 88 | --launcher.XXMaxPermSize 89 | 2048m 90 | ... 91 | -vmargs 92 | ... 93 | -Xms512m 94 | -Xmx850m 95 | -XX:PermSize=512m 96 | -XX:MaxPermSize=1024m 97 | 98 | ## 安装ant, maven, tomcat, jetty 99 | 100 | brew install ant maven tomcat jetty 101 | 102 | -------------------------------------------------------------------------------- /php.md: -------------------------------------------------------------------------------- 1 | # php开发环境设置 2 | 3 | ### hombrew 4 | 5 | ``` sh 6 | ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" 7 | ``` 8 | 9 | 可能需要翻墙,大概率需要`shadowsock`或者其他翻墙工具加上`proxychain-ng`可以做到翻墙使用homebrew。 10 | 11 | ### php环境 12 | 13 | 虽然Mac OS X 自带了php,但是我们可以选择使用Homebrew安装php56或者php54因为: 14 | 15 | - 使用Homebrew安装更新的php版本 16 | - 同时安装5.6和5.5和5.4的php 17 | - Homebrew会同时安装xdebug和mcrypt等工具 18 | 19 | 安装python 56: 20 | 21 | ``` 22 | brew install homebrew/php/php56 23 | brew install homebrew/php/php56-mcrypt 24 | brew install homebrew/php/php56-xdebug 25 | ``` 26 | 27 | 安装python 5.4: 28 | 29 | ``` 30 | brew install homebrew/php/php54 31 | ``` 32 | 33 | 一般来说如果php安装了xdebug,大概率composer运行的时候会报错。所以用来运行脚本的php不能安装xdebug。可以这样把已经安装了xdebug调试工具的php从`PATH`中移除。 34 | 35 | ``` sh 36 | brew unlink php56 37 | ``` 38 | 39 | ### composer 40 | 41 | ##### 英文原版安装(需要翻墙) 42 | 43 | 参考网址https://getcomposer.org/doc/00-intro.md 44 | 45 | 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. 46 | 47 | Run these commands to globally install `composer` on your system: 48 | 49 | ``` sh 50 | curl -sS https://getcomposer.org/installer | php 51 | mv composer.phar /usr/local/bin/composer 52 | ``` 53 | 54 | A quick copy-paste version including sudo: 55 | 56 | ``` sh 57 | curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer 58 | ``` 59 | 60 | ##### 中文镜像库安装 61 | 62 | 参考网址http://docs.phpcomposer.com/00-intro.html 63 | 64 | 如果你把它放在系统的 `PATH` 目录中,你就能在全局访问它。 在类Unix系统中,你甚至可以在使用时不加 `php` 前缀。 65 | 66 | 你可以执行这些命令让 `composer` 在你的系统中进行全局调用: 67 | 68 | ``` sh 69 | curl -sS https://getcomposer.org/installer | php 70 | mv composer.phar /usr/local/bin/composer 71 | ``` 72 | 73 | **注意:** 如果上诉命令因为权限执行失败,请使用 sudo 再次尝试运行 `mv` 那行命令。 74 | 75 | 或者 76 | 77 | 检查一些 PHP 的设置,然后下载 `composer.phar` 到你的工作目录中。这是 Composer 的二进制文件。这是一个 PHAR 包(PHP 的归档),这是 PHP 的归档格式可以帮助用户在命令行中执行一些操作。 78 | 79 | 你可以通过 `--install-dir` 选项指定 Composer 的安装目录(它可以是一个绝对或相对路径): 80 | 81 | ``` sh 82 | curl -sS https://getcomposer.org/installer | php -- --install-dir=bin 83 | ``` 84 | 85 | -------------------------------------------------------------------------------- /python.en.md: -------------------------------------------------------------------------------- 1 | # Configuration of the dev environment of Python 2 | 3 | ## Python (optional) 4 | Although Mac OS X comes with Python, we can use Homebrew to intall Python 2.7.x because 5 | 6 | * Use Homebrew to install more recent version of Python 7 | * Intall Python 2.7.x and 3.x at the same time 8 | * Homebrew will install tools like setuptools and pip 9 | 10 | To install Python 2.7.x 11 | 12 | brew install python --with-brewed-openssl 13 | 14 | To install Python 3.x 15 | 16 | brew install python3 --with-brewed-openssl 17 | 18 | ## pip 19 | 20 | We use pip to manage packages: 21 | 22 | sudo easy_install pip 23 | 24 | ## virtualenv virtualenvwrapper 25 | 26 | To install packages: 27 | 28 | sudo pip install virtualenv virtualenvwrapper 29 | 30 | To create the virtualenv folder 31 | 32 | mkdir ~/virtualenvs 33 | 34 | To config virtualenv in .zshrc or .bash_profile 35 | 36 | # virtualenvwrapper 37 | export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python 38 | export WORKON_HOME=~/virtualenvs 39 | [ -f /usr/local/bin/virtualenvwrapper.sh ] && source /usr/local/bin/virtualenvwrapper.sh 40 | [ -f /etc/bash_completion.d/virtualenvwrapper ] && source /etc/bash_completion.d/virtualenvwrapper 41 | export PIP_VIRTUALENV_BASE=$WORKON_HOME 42 | export PIP_RESPECT_VIRTUALENV=true 43 | 44 | 45 | To create the first python 2 virtualenv: 46 | 47 | mkvirtualenv test 48 | 49 | To create the first python 3 virtualenv: 50 | 51 | mkvirtualenv -p python3 test 52 | 53 | ## PyCharm 54 | 55 | PyCharm is the best Python IDE so far. There are community and professional versions for you to choose. 56 | 57 | -------------------------------------------------------------------------------- /python.md: -------------------------------------------------------------------------------- 1 | # python开发环境的设置 2 | 3 | ## Python (可选) 4 | 5 | 虽然Mac OS X 自带了Python,但是我们可以选择使用Homebrew安装Python 2.7.x。因为: 6 | 7 | * 使用Homebrew安装更新的python版本 8 | * 同时安装2.7.x和3.x的python 9 | * Homebrew会同时安装setuptools和pip等工具 10 | 11 | 安装python 2.7.x: 12 | 13 | brew install python --with-brewed-openssl 14 | 15 | 安装python 3.x: 16 | 17 | brew install python3 --with-brewed-openssl 18 | 19 | ## pip 20 | 21 | 我们使用pip来管理软件包: 22 | 23 | sudo easy_install pip 24 | 25 | 由于pip从pypi下载软件包,境外的pypi站点非常慢,导致安装缓慢或者下载失败。所幸清华大学和豆瓣都提供了pypi镜像,可以通过下面的配置文件来配置: 26 | 27 | $ vim ~/.pip/pip.conf 28 | ; http://www.pypi-mirrors.org/ 29 | [global] 30 | index-url=https://pypi.doubanio.com/simple 31 | 32 | ## virtualenv virtualenvwrapper 33 | 34 | 安装软件包: 35 | 36 | sudo pip install virtualenv virtualenvwrapper 37 | 38 | 创建virtualenv目录: 39 | 40 | mkdir ~/virtualenvs 41 | 42 | 在.zshrc或者.bash_profile里配置virtualenv: 43 | 44 | # virtualenvwrapper 45 | export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python 46 | export WORKON_HOME=~/virtualenvs 47 | [ -f /usr/local/bin/virtualenvwrapper.sh ] && source /usr/local/bin/virtualenvwrapper.sh 48 | [ -f /etc/bash_completion.d/virtualenvwrapper ] && source /etc/bash_completion.d/virtualenvwrapper 49 | export PIP_VIRTUALENV_BASE=$WORKON_HOME 50 | export PIP_RESPECT_VIRTUALENV=true 51 | 52 | 53 | 创建第一个python 2 的 virtualenv: 54 | 55 | mkvirtualenv test 56 | 57 | 创建第一个python 3 的 virtualenv: 58 | 59 | mkvirtualenv -p python3 test 60 | 61 | ## PyCharm 62 | 63 | PyCharm是python最好的集成开发工具,目前有专业版和社区版可供选择。 64 | 65 | 66 | -------------------------------------------------------------------------------- /recovery.md: -------------------------------------------------------------------------------- 1 | # 备份和恢复 2 | 3 | 第一次使用Mac OS X下的时光机器(Time Machine),就被苹果如此完美贴心的备份恢复方案打动。数据无价,电脑里留下了岁月的痕迹和凝结了我们的心血,数据备份的重要性是怎么强调都不为过的。Time Machine是对这些数据最好的保护。只要你已经使用Time Machine备份过,设想一下: 4 | 5 | * 当你的Mac丢失或者硬件损坏了以后,你只要从苹果商店新买一台Mac,然后从Time Machine备份中恢复。你会看到一个和之前一模一样的系统,包括数据、设置、状态。 6 | * 当你给自己奖赏了一台新Mac时候,可以使用Time Machine将所有东西迁移过去。 7 | * 当你误删除一个文档,几个月以后再想起来,可以从Time Machine恢复。 8 | * 当你对一个文档做了多次修改,引入了一个错误,希望恢复某次正确的一个版本的时候,Time Machine可以帮助你。 9 | 10 | 如果你熟悉git,那Time Machine简直就是一个操作系统级别的版本控制! 11 | 12 | 当我安装好一个新的Mac OS X系统以后,第一件事情,就是设置Time Machine。 13 | 14 | 现在云存储已经普及,容量也足够大,但是Time Machine还是有不可替代的优势: 15 | 16 | * 云存储没有版本历史,不能对之前的数据恢复。删除了就是删除了,也不能恢复之前某个时刻版本的数据资料。 17 | * 云存储有隐私泄露的问题,爱德华·斯诺登给我们好好上了一课。 18 | * 云存储不能解决恢复问题,仅仅只能做最基本的文件存储,不能在一台新的Mac上恢复所有数据和配置 19 | 20 | 简单地说,云存储就是一个简单的Windows操作系统级别的拷贝备份,和Time Machine细颗粒度,多版本,包括数据、配置、状态的完整备份恢复方案相比,弱爆了。 21 | 22 | 基于上述理由,郑重提醒,在设置Time Machine的exclude目录的时候,千万不要将云存储映射的目录排除在外。否则这些你认为已经被云存储保护过的资料,就不能享受Time Machine的保护,而这些资料往往是你最重要的资料。 23 | 24 | ## 准备工作 25 | 26 | Time Machine可以使用下面一些方式进行,我还是选择简单、可靠、廉价的第一种方案: 27 | 28 | * 本地外接移动硬盘 29 | 30 | 基于速度考虑,建议使用USB 3或者雷电高速接口,硬盘的大小可以选择1T或者2T,这个硬盘将伴随着你,保护你一生的数据资料。移动硬盘的分区方案,参见[安装]部分说明(https://github.com/pubyun/macdev/blob/master/install.md) 31 | 32 | * 使用Time Capsule 33 | 34 | 无线方案,使用方便。缺点是Time Capsule发热量大,速度相对于有线方案也较慢。 35 | 36 | * 如果你有一台Linux服务器,可以安装netatalk软件 37 | 38 | 看上去是一个理想的方案,但是设置好备份以后,不知道由于什么原因出现过几次备份无效,导致需要完全重新备份,后来丢弃了这个方案。 39 | 40 | 41 | ## Time Machine的设置 42 | 43 | Time Machine这么强大的功能,设置其实很简单,苹果官方网站有详细的[指南](http://support.apple.com/kb/HT1427?viewlocale=zh_CN),我在这里就不再重复。 44 | 45 | 需要注意的是,Mac OS X会在运行中产生一些临时数据或者中间数据,这些数据往往占用空间较大,而没有保存价值,可以设置成exclude,常见的有: 46 | 47 | /Library/Application Support/ 48 | /Library/Caches/ 49 | /private/var/log/ 50 | /private/var/vm/ 51 | /private/var/tmp/ 52 | ~/Downloads/ 53 | ~/Library/Caches 54 | ~/Library/Application Support/MobileSync/ 55 | ~/.Trash/ 56 | ~/Documents/Virtual\ Machines.localized/ 57 | ~/Library/Parallels 58 | 59 | 备份完毕以后,移动硬盘需要在Finder下umount才能拔出,否则有可能数据丢失。 60 | 61 | -------------------------------------------------------------------------------- /refs.md: -------------------------------------------------------------------------------- 1 | # 参考文档 2 | 3 | * [OS X键盘快捷键] (http://support.apple.com/kb/HT1343?viewlocale=zh_CN) 4 | * [Multi-Touch手势] (http://support.apple.com/kb/HT4721?viewlocale=zh_CN) 5 | * [Time Machine备份Mac] (http://support.apple.com/kb/HT1427?viewlocale=zh_CN) 6 | * [全面了解电池] (http://support.apple.com/kb/HT1446?viewlocale=zh_CN) 7 | * [基于Intel的Mac的启动组合键] (http://support.apple.com/kb/HT1533?viewlocale=zh_CN) 8 | * [mac-dev-setup] (https://github.com/nicolashery/mac-dev-setup) 9 | * [mac-dev] (http://www.yangzhiping.com/tech/mac-dev.html) 10 | * [Best-App] (https://github.com/hzlzh/Best-App) 11 | * [laptop] (https://github.com/thoughtbot/laptop) 12 | * [简单4步,创建 OS X Mavericks USB 安装启动盘] (http://ksmx.me/blog/2013/10/24/create-an-os-x-mavericks-usb-installer/) 13 | * [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) 14 | --------------------------------------------------------------------------------