├── .gitignore ├── COPYING ├── README.org ├── conforg ├── dotfiles │ ├── imported │ │ ├── chktexrc │ │ ├── dircolors.ansi-dark │ │ └── git-completion.bash │ ├── link-dotfiles.sh │ └── mine │ │ ├── Rprofile │ │ ├── XCompose │ │ ├── abcde.conf │ │ ├── bash_logout │ │ ├── bash_profile │ │ ├── bashrc │ │ ├── gemrc │ │ ├── gitattributes │ │ ├── gitconfig │ │ ├── lessfilter │ │ ├── lintr │ │ ├── nanorc │ │ ├── pryrc │ │ ├── rubocop.yml │ │ ├── shellcheckrc │ │ ├── signature │ │ ├── signature.work │ │ ├── sqliterc │ │ ├── tmux.conf │ │ └── xmodmaprc └── scripts │ ├── emacs-install-personal.sh │ ├── emacs-install-requirements.sh │ ├── emacs-update.sh │ ├── initialize.sh │ ├── r-install-packages.sh │ ├── r-install-personal.sh │ ├── r-install-requirements.sh │ ├── r-install-system.sh │ ├── ruby-install-gems.sh │ ├── ruby-install-personal.sh │ ├── ruby-install-requirements.sh │ ├── ruby-install-system.sh │ ├── ruby-rbenv.sh │ ├── tor-install-requirements.sh │ ├── tor-install-system.sh │ └── tor-run.sh ├── conforguration.org └── install ├── copy-dotfiles.sh ├── copy-scripts.sh └── install.sh /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 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 | 635 | Copyright (C) 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 | Copyright (C) 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.org: -------------------------------------------------------------------------------- 1 | #+TITLE: Conforguration README 2 | #+AUTHOR: William Denton 3 | #+EMAIL: william@williamdenton.org 4 | 5 | * Conforguration 6 | 7 | Use the power of [[http://orgmode.org/][Org]] to manage accounts and install software the way I like it done. 8 | 9 | Conforguration contains: 10 | 11 | + all my non-private "dot files" ([[https://en.wikipedia.org/wiki/Run_commands][run command files]], containing configuration instructions for different programs) 12 | + scripts to install (from source) Emacs, R, Ruby and Tor 13 | 14 | The dot files and scripts can be used locally and on remote machines. It is easy to push everything from the local machine to a remote one from this Org file. 15 | 16 | I made this to suit my tastes and work the way I want. There may be some things in my dot files that you like, in which case you're free to copy them, but watch out! This is not meant for widespread general use! 17 | 18 | * How does it work? 19 | 20 | Everything is in [[file:conforguration.org][conforguration.org]]. Tangling that file (by running =M-x org-babel-tangle= or =C-c C-v t=) will generate all of the dot files and scripts. 21 | 22 | Installing Conforguration locally copies files into =~/conforg/=: 23 | 24 | + dot files to =~/conforg/dotfiles/= 25 | + scripts to =~/conforg/scripts/= 26 | 27 | The same files can easily be pushed to remote machines. 28 | 29 | There are two types of dot files: "mine" (most of them) or "imported" (a few copied verbatim from elsewhere). Symbolic links are made from $HOME to =~/conforg/dotfiles/=. 30 | 31 | The scripts can be run locally or on remote machines. For either local or remote installations or updates, you can use =C-c C-c= on the shell blocks to execute them or you can run the scripts at the command line on the given machine. (If it takes twenty minutes to compile something on a remote machine, you might find it easier to run that script over there instead of from inside Emacs here.) 32 | 33 | * Usage 34 | 35 | Assume Conforguration will be in =~/src/conforguration/=. 36 | 37 | ** Requirements 38 | 39 | This all assumes your shell is [[https://www.gnu.org/software/bash/][Bash]]. 40 | 41 | All that is needed to get it is Git. On a Debian, Ubuntu or related system, run this: 42 | 43 | #+begin_src shell :eval no 44 | sudo apt install git rsync 45 | #+end_src 46 | 47 | ** Installation 48 | 49 | First, get Conforguration. To clone it with your Git account, run this: 50 | 51 | #+BEGIN_SRC shell 52 | git clone git@github.com:wdenton/conforguration.git ~/src/conforguration/ 53 | #+END_SRC 54 | 55 | Or if you don't want to use a GitHub account: 56 | 57 | #+BEGIN_SRC shell 58 | git clone https://github.com/wdenton/conforguration.git ~/src/conforguration/ 59 | #+END_SRC 60 | 61 | Set up =/usr/local/src/= and =~/conforg/=. This is only necessary once. 62 | 63 | #+BEGIN_SRC shell 64 | ~/src/conforguration/conforg/scripts/initialize.sh 65 | #+END_SRC 66 | 67 | Install the dot files and scripts in =~/conforg/=, and refresh bash to see the effects. 68 | 69 | #+BEGIN_SRC shell 70 | ~/src/conforguration/install/install.sh 71 | source ~/.bashrc 72 | #+END_SRC 73 | 74 | Now you're running under Conforguration! 75 | 76 | ** Installing Emacs 77 | 78 | This installs [[https://www.gnu.org/software/emacs/][Emacs]] and [[https://orgmode.org/][Org]] from source. 79 | 80 | For this to work in Ubuntu you'll need to have enabled source code repositories for packages in the APT configuration. You can do this with the GUI Software Updater tool (in the Ubuntu Software tab, enable the source code option) or in a shell (edit =/etc/apt/sources.list= and uncomment all of the =deb-src= lines). Then update all the packages, for example with =sudo apt update=. 81 | 82 | #+BEGIN_SRC shell 83 | ~/conforg/scripts/emacs-install-requirements.sh 84 | ~/conforg/scripts/emacs-install-personal.sh 85 | #+END_SRC 86 | 87 | To get my personal Emacs configuration, run the following. Warning: this will overwrite all sorts of VERY IMPORTANT files, so don't do this unless you're me, or you're on a new bare system and want to try it out. 88 | 89 | #+begin_src shell 90 | cd 91 | git clone git@github.com:wdenton/.emacs.d.git 92 | #+end_src 93 | 94 | Then run =emacs=. A few dozen packages should be downloaded and installed and when that's done your Emacs will look exactly like mine! 95 | 96 | If something goes wrong, you can run everything in =init.el= by hand to install all of the packages. Run ~emacs~ (or ~emacs -nw~ if you can only use a terminal), then type ~C-x C-f ~/.emacs/init.el~ to load the file, then run ~M-x eval-buffer~ to execute everything in it at once. Then quit Emacs and restart it, perhaps twice. Then everything should be good. 97 | 98 | Whenever you want to upgrade Emacs and Org (packages need to be upgraded inside Emacs; my ridiculous keystroke for that is =C-x l p U x=), run: 99 | 100 | #+begin_src shell 101 | ~/conforg/scripts/emacs-update.sh 102 | #+end_src 103 | 104 | ** Installing R 105 | 106 | You can install [[https://www.r-project.org/][R]] for personal use (where it runs out of =/usr/local/src/=) or system-wide. The version number is set in [[file:conforguration.org][conforguration.org]]. 107 | 108 | #+BEGIN_SRC shell 109 | ~/conforg/scripts/r-install-requirements.sh 110 | ~/conforg/scripts/r-install-personal.sh 111 | source ~/.bashrc 112 | #+END_SRC 113 | 114 | Run =~/conforg/scripts/r-install-system.sh= to install R into =/usr/local/bin/=. 115 | 116 | ** Installing Ruby 117 | 118 | You can install [[https://www.ruby-lang.org/en/][Ruby]] for personal use (where it runs out of =/usr/local/src/=) or system-wide. The version number is set in [[file:conforguration.org][conforguration.org]]. 119 | 120 | To install a personal version with [[https://github.com/rbenv/rbenv][Rbenv]]: 121 | 122 | #+BEGIN_SRC shell 123 | ~/conforg/scripts/ruby-install-requirements.sh 124 | ~/conforg/scripts/ruby-rbenv.sh 125 | source ~/.bashrc 126 | ~/conforg/scripts/ruby-install-personal.sh 127 | #+END_SRC 128 | 129 | System-wide: 130 | 131 | #+BEGIN_SRC shell 132 | ~/conforg/scripts/ruby-install-requirements.sh 133 | ~/conforg/scripts/ruby-install-system.sh 134 | #+END_SRC 135 | 136 | Whenever you want to upgrade Rbenv, just run the same script again; if Rbenv is installed it will now upgrade it. 137 | 138 | #+BEGIN_SRC shell 139 | ~/conforg/scripts/ruby-rbenv.sh 140 | #+END_SRC 141 | 142 | * Why? 143 | 144 | Because [[https://www.ansible.com/][Ansible]] and similar configuration management tools aren't done in Org. 145 | 146 | * What next? 147 | 148 | I don't know, but if you're interested, have at it. 149 | 150 | There are a lot of dot files in [[https://github.com/webpro/awesome-dotfiles][awesome-dotfiles]], and it seems [[https://github.com/aldrichtr/tangld][tangld]] is a similar project to this. There will be things to be learned from any related projects. 151 | 152 | * License 153 | 154 | GPL v3. See COPYING for details. 155 | -------------------------------------------------------------------------------- /conforg/dotfiles/imported/chktexrc: -------------------------------------------------------------------------------- 1 | ## 2 | ## ChkTeX, example resource file for ChkTeX. 3 | ## Copyright (C) 1995-96 Jens T. Berger Thielemann 4 | ## 5 | ## This program is free software; you can redistribute it and/or modify 6 | ## it under the terms of the GNU General Public License as published by 7 | ## the Free Software Foundation; either version 2 of the License, or 8 | ## (at your option) any later version. 9 | ## 10 | ## This program is distributed in the hope that it will be useful, 11 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ## GNU General Public License for more details. 14 | ## 15 | ## You should have received a copy of the GNU General Public License 16 | ## along with this program; if not, write to the Free Software 17 | ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | ## 19 | ## Contact the author at: 20 | ## Jens Berger 21 | ## Spektrumvn. 4 22 | ## N-0666 Oslo 23 | ## Norway 24 | ## E-mail: 25 | ## 26 | 27 | ##################################################################### 28 | # 29 | # Note: The format has changed slightly (again). The { ... } 30 | # syntax does now mean case-sensitive comparing, while [ ... ] means 31 | # case-insensitive comparing of the keywords. Case-insensitive 32 | # comparing of the keywords is only supported on a few of the 33 | # keywords (it's not meaningful in all contexts, and it slows ChkTeX 34 | # down). Keywords supporting this are marked throughout the file. 35 | # 36 | # You may also reset a list by saying "KEYWORD = { ... }"; it will 37 | # then be set equal to the contents of the list you specify. 38 | # 39 | # Comments begin with `#', and continues for the rest of the line. 40 | # Blank lines plus leading and trailing spaces are of course ignored. 41 | # 42 | # The general format of this file is the following: 43 | # 44 | # KEYWORD { item item ...} [ item item ... ] /* Adds items */ 45 | # 46 | # KEYWORD [ item item ...] { item item ... } /* Adds items */ 47 | # 48 | # KEYWORD = item 49 | # 50 | # KEYWORD = { item item ... } /* Clears list before adding */ 51 | # 52 | # KEYWORD = [ item item ... ] /* Clears list before adding */ 53 | # 54 | # This does _not_ mean that you may alternate the forms; certain 55 | # keywords demands a list, other a single value. You thus have to 56 | # look at the examples of their use. 57 | # 58 | # Please also note that if you specify a list-keyword twice, we'll 59 | # concatenate the lists. If you specify a item-keyword twice, we'll 60 | # kill the previous value. 61 | # 62 | # We are slightly context-sensitive when detecting tokens like "}" 63 | # and "]"; they have to be preceded by a space. This generally makes 64 | # life easier. 65 | # 66 | # Items are separated by spaces. Newlines are considered as spaces, 67 | # but can't be escaped. You may surround items with quotes (`"') to 68 | # easily put spaces into them. 69 | # 70 | # Escape sequences available: 71 | # 72 | # Sequence Resulting character 73 | # ! A space (type `! ', not just a exclamation mark) 74 | # !" " 75 | # !# # 76 | # !! ! 77 | # !{ { 78 | # !} } 79 | # ![ [ 80 | # !] ] 81 | # != = 82 | # !b Backspace 83 | # !n New line 84 | # !r Carriage return 85 | # !t Tab 86 | # !f Form feed 87 | # !xNN NN must be a hexadecimal number (00 - ff), 88 | # _both_ characters must be included. 89 | # !dNNN DDD must be a decimal number (000 - 255), all 90 | # three characters must be included. Unspecified 91 | # results if DDD > 255. 92 | # !NNN DDD must be a octal number (000 - 377), all 93 | # three characters must be included. Unspecified 94 | # results if DDD > 377. 95 | # 96 | # Minor note: As you can see, most of these escape sequences are 97 | # equal to those in C (with some extensions); however, we use ! 98 | # instead of \ as escape character for obvious reasons. 99 | # 100 | # 101 | # Quick summary of keywords follows. Keywords marked with a * accept 102 | # keywords accepting case-insensitive lists. 103 | # 104 | # Abbrev* - A list of abbreviations not automatically caught. 105 | # CenterDots - Commands/characters which should have \cdots in 106 | # between. 107 | # CmdLine - Default commandline options. These will be 108 | # processed before the ones you give on the command 109 | # line. 110 | # HyphDash \ 111 | # NumDash - Number of dashes allowed in different contexts. 112 | # WordDash / 113 | # IJAccent - Commands which puts an accent _over_ their 114 | # argument. 115 | # Italic - Commands immediately turning on italic mode. 116 | # ItalCmd - Commands putting their argument into italic. 117 | # Linker - Commands which should have a non-breaking space in 118 | # front. 119 | # LowDots - Commands/characters which should have \ldots in 120 | # between. 121 | # MathEnvir - Environments which turn on math mode. 122 | # MathCmd - Commands which turn on math mode. 123 | # TextCmd - Commands which turn off math mode. 124 | # MathRoman - Mathematical operators with LaTeX replacement 125 | # defined. 126 | # NoCharNext - Insists on that certain commands aren't followed by 127 | # certain characters. 128 | # NonItalic - Commands immediately turning off italic mode. 129 | # NotPreSpaced- Commands which should not have a space in front of 130 | # them. 131 | # Primitives - Primitive TeX commands. 132 | # PostLink - Commands which generates a page reference. 133 | # OutFormat - Formats to use for output. See the -f & -v switch 134 | # in the main doc. 135 | # QuoteStyle - Either "Traditional" or "Logical". See main doc, 136 | # warning 38. 137 | # Silent - These commands do not produce any textual output; 138 | # and are thus allowed to have a space after them. 139 | # TabSize - Tab size you are using. 140 | # TeXInputs - Paths to search \input and \include files for. 141 | # UserWarn* - These strings will be searched for throughout the 142 | # text. 143 | # VerbEnvir - Environments which contents should be ignored. 144 | # VerbClear - String we will overwrite unwanted data with. 145 | # WipeArg - Commands (with arguments) which should be ignored 146 | # in the checking. 147 | # 148 | 149 | 150 | ##################################################################### 151 | # 152 | # Enter which type of quote-style you are using here. Currently, we 153 | # support the following styles: 154 | # 155 | # Style Example of use 156 | # Traditional "An example," he said, "would be great." 157 | # Logical "An example", he said, "would be great". 158 | # 159 | 160 | QuoteStyle = Traditional 161 | 162 | ##################################################################### 163 | # 164 | # Enter here what interval you have between your tabs. Only regular 165 | # intervals are supported. 166 | # 167 | 168 | TabSize = 8 169 | 170 | ##################################################################### 171 | # 172 | # Here, you can put default commandline options; most users would for 173 | # instance like to put -v2 here. 174 | # 175 | 176 | CmdLine 177 | { 178 | 179 | } 180 | 181 | ##################################################################### 182 | # 183 | # These patterns will be searched for through the text; no matter 184 | # whether they appear as normal text, commands or whatever. 185 | # Currently case-sensitive. They are not found in comments. 186 | # 187 | # I usually define a special command like this: 188 | # 189 | # \def\unknown{\large\bf??} 190 | # 191 | # which I use whenever there is some information I don't have at the 192 | # moment of writing. Thus, it makes sense to search for it. 193 | # 194 | # You should be able to develop your own uses for this. 195 | # 196 | 197 | UserWarn 198 | { 199 | 200 | \unknown 201 | ### 202 | # 203 | # Another example; one should write \chktex or Chk\TeX - never ChkTeX. 204 | # 205 | ### 206 | 207 | ChkTeX 208 | } 209 | [ 210 | 211 | ### 212 | # 213 | # You may put case-insensitive patterns here. 214 | # 215 | ### 216 | 217 | ] 218 | 219 | 220 | ### 221 | # 222 | # These patterns will be searched for, no matter whether they appear 223 | # as normal text, commands or arguments. However, they will _not_ 224 | # match in verbatim environments. 225 | # 226 | # Remember that you have to escape (with a !) the following 227 | # characters: "#!= as well as spaces and {}[] if they are proceeded by 228 | # a space. 229 | # 230 | # Since these are PCRE regular expressions, you can use (?i) to make 231 | # the expression case insensitive. See the man pages (man pcresyntax) 232 | # or the nicely formatted http://perldoc.perl.org/perlre.html for 233 | # documentation on the regular expression syntax. Note however that 234 | # some the features of perl regular expression are not available such 235 | # as running code (callouts), and replacing. 236 | # 237 | # An initial PCRE comment (?# ... ) can be used change what is 238 | # displayed, thereby reminding yourself how to fix the problem. 239 | # 240 | ### 241 | UserWarnRegex 242 | { 243 | 244 | (?!#Always! use! \nmid)\\not! *(\||\\mid) 245 | 246 | # capitalize section when saying Section 6. 247 | (?!#-1:Capitalize! before! references)PCRE:\b(chapter|(sub)?section|theorem|lemma|proposition|corollary|appendix)~\\ref 248 | (?!#1:Capitalize! before! references)POSIX:([^[:alnum:]]|^)(chapter|(sub)?section|theorem|lemma|proposition|corollary|appendix)~\\ref 249 | 250 | # spell it out. 251 | # PCRE:(?i)\bintro\b(?!#Spell! it! out.! This! comment! is! not! used.) 252 | # POSIX:([^[:alnum:]]|^)intro([^[:alnum:]]|$) 253 | 254 | # Pretty tables--see http://texdoc.net/texmf-dist/doc/latex/booktabs/booktabs.pdf 255 | (?!#-2:Use! \toprule,! midrule,! or! \bottomrule! from! booktabs)\\hline 256 | # This relies on it being on a single line, and not having anything 257 | # else on that line. With PCRE we could match balanced [] and {}, 258 | # but I wonder if it's worth the complexity... 259 | (?!#-2:Vertical! rules! in! tables! are! ugly)\\begin\{(array|tabularx?\*?)\}(\[.*\])?\{.*\|.*\} 260 | 261 | } 262 | 263 | 264 | ##################################################################### 265 | # 266 | # Here you can list the path of where ChkTeX should look for files it 267 | # \inputs. The // postfix is now supported; if you append a double 268 | # path-separator we'll recursively search that directory directories. 269 | # MS-DOS users must append \\ instead, e.g. "C:\EMTEX\\". 270 | # 271 | # If you under either MS-DOS or UNIX wish to search an entire 272 | # partition or the complete directory tree, you must use *three* 273 | # slashes, e.g. "c:\\\" or "///". This may be considered to be a bug. 274 | # 275 | # By default, we'll search the current directory (not recursively, 276 | # put "//" in the list for this); any paths specified below will be 277 | # searched in addition to this. 278 | # 279 | 280 | TeXInputs 281 | { 282 | 283 | } 284 | 285 | ##################################################################### 286 | # 287 | # Here you may specify more output formats for use with the -v option, 288 | # it simply indexes into this list. Remember to use ! instead of \, 289 | # though. 290 | # 291 | # For explanation of how % fields expand; look at ChkTeX.{dvi,ps,pdf}. 292 | # 293 | # We will by default select entry number _two_ in this list (we count 294 | # from 0), and -v without any parameter selects entry number _three_. 295 | # 296 | 297 | OutFormat 298 | { 299 | 300 | # -v0; silent mode 301 | %f%b%l%b%c%b%n%b%m!n 302 | 303 | # -v1; normal mode 304 | "%k %n in %f line %l: %m!n%r%s%t!n%u!n" 305 | 306 | # -v2; fancy mode 307 | "%k %n in %f line %l: %m!n%r%i%s%I%t!n!n" 308 | 309 | # -v3; lacheck mode 310 | "!"%f!", line %l: %m!n" 311 | 312 | # -v4; verbose lacheck mode 313 | "!"%f!", line %l: %m!n%r%s%t!n%u!n" 314 | 315 | # -v5; no line number, ease auto-test 316 | "%k %n in %f: %m!n%r%s%t!n%u!n" 317 | 318 | # -v6; emacs compilation mode 319 | "!"%f!", line %l.%c:(#%n) %m!n" 320 | 321 | } 322 | 323 | 324 | 325 | ##################################################################### 326 | # 327 | # These commands should be ignored when detecting whether a command 328 | # is ended by a space. You can specify regular expressions in the [] 329 | # section in case you have many custom macros that can be safely 330 | # terminated with a space. 331 | # 332 | 333 | Silent 334 | { 335 | \rm \em \bf \it \sl \sf \sc \tt \selectfont 336 | \rmfamily \sffamily \ttfamily \mdseries \bfseries 337 | \slshape \scshape \relax 338 | \vskip \pagebreak \nopagebreak 339 | 340 | \textrm \textem \textbf \textit \textsl \textsf \textsc \texttt 341 | 342 | \clearpage \ddots \dotfill \flushbottom \fussy \indent \linebreak 343 | \onecolumn \pagebreak \pushtabs \poptabs \scriptsize \sloppy 344 | \twocolumn \vdots 345 | \today \kill \newline \thicklines \thinlines 346 | 347 | \columnsep \space \item \tiny \footnotesize \small \normalsize 348 | \normal \large \Large \LARGE \huge \Huge \printindex 349 | 350 | \newpage \listoffigures \listoftables \tableofcontents 351 | \maketitle \makeindex 352 | 353 | \hline \hrule \vrule 354 | 355 | \centering 356 | 357 | \bigskip \medskip \smallskip 358 | 359 | \noindent \expandafter 360 | 361 | \makeatletter \makeatother 362 | 363 | \columnseprule 364 | 365 | \textwidth \textheight \hsize \vsize 366 | 367 | \if \fi \else 368 | 369 | \csname \endcsname 370 | 371 | \z@ \p@ \@warning \typeout 372 | 373 | \dots \ldots \input \endinput \nextline \leavevmode \cdots 374 | \appendix \listfiles \and \quad 375 | \hskip \vfill \vfil \hfill \hfil \topmargin \oddsidemargin 376 | \frenchspacing \nonfrenchspacing 377 | \begingroup \endgroup \par 378 | 379 | \vrefwarning \upshape \headheight \headsep \hoffset \voffset 380 | \cdot \qquad 381 | \left \right 382 | \qedhere 383 | 384 | \xspace 385 | 386 | \addlinespace \cr \fill \frontmatter 387 | \toprule \midrule \bottomrule 388 | 389 | }[ 390 | # Here you can put regular expressions to match Silent macros. It was 391 | # designed for the case where you have many custom macros sharing a 392 | # common prefix, but can of course be used for other things. 393 | 394 | # Support ConTeXt to at least some extent 395 | \\start.* \\stop.* 396 | 397 | ] 398 | 399 | ##################################################################### 400 | # 401 | # Here, you can specify the length of various dashes. We sort the 402 | # dash according to which type of characters that are on the left and 403 | # right of it. We are only conclusive if they are the same. 404 | # 405 | # We associate as follows: 406 | # 407 | # Name Type of character on each side 408 | # HyphDash Alphabetic (foo-bar) 409 | # NumDash Numeric (2--3) 410 | # WordDash Space (like this --- see?) 411 | # 412 | # Below you specify how many dashes which are legal in each case. We 413 | # define 0 as a magic constant which always generates an error. You 414 | # may specify more than one legal dash-length. 415 | # 416 | # Let's look at an example. You use the following dash-syntax: 417 | # 418 | # foo-bar 419 | # 2--3 420 | # like this---see? 421 | # 422 | # 423 | # HYPHDASH { 1 3 } # Either a hyphen, or inter-word 424 | # NUMDASH { 2 } # Between words 425 | # WORDDASH { 0 } # We never use this 426 | # 427 | 428 | HyphDash 429 | { 430 | 1 3 431 | } 432 | 433 | NumDash 434 | { 435 | 2 436 | } 437 | 438 | WordDash 439 | { 440 | 2 3 441 | } 442 | 443 | ##################################################################### 444 | # 445 | # Here are exceptions to the dash rules above. For example, an 446 | # n-dash -- between words is usually wrong, but in some cases it is 447 | # correct, such as when naming a theorem. The Birch--Swinnerton-Dyer 448 | # conjecture is one example where the difference matters. You can 449 | # tell that Birch is one person and Swinnerton-Dyer is another. 450 | # 451 | # Adding line suppressions for these is possible, but can quickly 452 | # become tedious if a certain theorem is referenced often. For this 453 | # reason exceptions can be specified here. They are case-sensitive. 454 | # 455 | 456 | DashExcpt 457 | { 458 | Birch--Swinnerton-Dyer 459 | } 460 | 461 | ##################################################################### 462 | # 463 | # This keyword indicates commands whose argument isn't LaTeX code, 464 | # and thus should be ignored. 465 | # 466 | # After the command, you may place arguments that you wish that 467 | # should be wiped in the process; use [] for optional arguments, {} 468 | # for required ones and * if the command supports an alternative 469 | # variant. These should be separated from the command with a colon. 470 | # Some commands (e.g. \cmidrule) use () to delimit and optional 471 | # argument and so this syntax is supported as well. 472 | # 473 | # For instance, if you would like to wipe the \newcommand command, 474 | # you would declare it as \newcommand:*[][]{} 475 | # 476 | # These commands may be "executed" before they're wiped, so you will 477 | # typically also wish to list filehandling commands and similar here. 478 | # 479 | 480 | WipeArg 481 | { 482 | \label:{} \ref:{} \eqref:{} \vref:{} \pageref:{} \index:[]{} 483 | \cite:[][]{} \nocite:{} 484 | \input:{} \verbatiminput:[]{} \listinginput:[]{}{} 485 | \verbatimtabinput:[]{} \include:{} \includeonly:{} 486 | \bibitem:[]{} 487 | \cline:{} \cmidrule:[](){} 488 | \href:{}{} 489 | # Cleveref -- there are many others that could be here as well... 490 | \cref:*{} \cpageref:*{} \crefrange:*{}{} \cpagerefrange:*{}{} 491 | \Cref:*{} \Cpageref:*{} \Crefrange:*{}{} \Cpagerefrange:*{}{} 492 | # natbib 493 | \citet:*[][]{} \citep:*[][]{} \citealt:*{} \citealp:*[]{} \citeauthor:*{} 494 | \Citet:*[][]{} \Citep:*[][]{} \Citealt:*{} \Citealp:*[]{} \Citeauthor:{} 495 | \citetext:{} \citeyear:*{} \citeyearpar:{} 496 | # tipa which uses " 497 | \textipa:{} 498 | } 499 | 500 | ##################################################################### 501 | # 502 | # These environments contain material which will be typeset as 503 | # mathematics by LaTeX. This turns on/off some warnings. 504 | # 505 | # We will automagically append a * to each keyword. 506 | # 507 | 508 | MathEnvir 509 | { 510 | displaymath math eqnarray array equation 511 | align alignat gather flalign multline 512 | } 513 | 514 | ##################################################################### 515 | # 516 | # These commands contain material which will be typeset as mathematics 517 | # by LaTeX. The commands are assumed to have one mandatory argument 518 | # which is in math mode. This turns on/off some warnings. 519 | # 520 | 521 | MathCmd 522 | { 523 | \ensuremath 524 | } 525 | 526 | ##################################################################### 527 | # 528 | # These commands contain material which will _not_ be typeset as 529 | # mathematics by LaTeX even if it would otherwise be in mathmode. The 530 | # commands are assumed to have one mandatory argument which is in text 531 | # mode. This turns on/off some warnings. 532 | # 533 | 534 | TextCmd 535 | { 536 | \text \intertext \shortintertext \mbox 537 | } 538 | 539 | ##################################################################### 540 | # 541 | # These environments contains material which contents should be 542 | # ignored. 543 | # 544 | # We will automagically append a * to each keyword. 545 | # 546 | 547 | VerbEnvir 548 | { 549 | verbatim comment listing verbatimtab rawhtml errexam picture texdraw 550 | filecontents pgfpicture tikzpicture minted lstlisting IPA 551 | } 552 | 553 | ##################################################################### 554 | # 555 | # ChkTeX does automagically catch most abbreviations; the ones we 556 | # need to list here, are those which are most likely to be followed 557 | # by a word with an upper-case letter (that is not the beginning of a 558 | # new sentence). 559 | # 560 | # The case-insensitive abbreviations are not really case-insensitive, 561 | # it seems to be more practical to only let the first character be 562 | # case-insensitive, while the remaining are case-sensitive. 563 | # 564 | # To speed up the searching process somewhat, we require that these 565 | # end in a `.', this should not be a problem. 566 | # 567 | # Much of this work (both the abbreviations below, and the regexps 568 | # necessary to catch the remaining automatically) have been provided 569 | # by Russ Bubley, . 570 | # 571 | 572 | Abbrev 573 | { 574 | # Ordinals 575 | 1st. 2nd. 3rd. 4th. 576 | # Titles 577 | Mr. Mrs. Miss. Ms. Dr. Prof. St. 578 | 579 | # 580 | # Days 581 | # Mon. Tue. Wed. Thu. Fri. Sat. Sun. 582 | # 583 | # Months 584 | # Jan. Feb. Mar. Apr. May. Jun. Jul. Aug. Sep. Oct. Nov. Dec. 585 | # 586 | # Letters 587 | # Kt. Jr. 588 | # 589 | # Corporate 590 | # Co. Ltd. 591 | # 592 | # Addresses 593 | # Rd. Dr. St. Ave. Cres. Gdns. Sq. Circ. Terr. Pl. Arc. La. Clo. Ho. Est. Gn. 594 | # 595 | # Misc. 596 | # oe. pbab. ps. rsvp. Tx. 597 | } 598 | [ 599 | ### 600 | # 601 | # The first letter is case-insensitive in the abbrevs in this 602 | # list. Due to the nature of the checking algorithm used for 603 | # this, entries consisting of only one character will be 604 | # silently ignored. 605 | # 606 | ## 607 | 608 | # Latin 609 | # cf. "et al." etc. qed. qv. viz. 610 | # 611 | # Corporate 612 | # inc. plc. 613 | # 614 | # Misc 615 | # fax. pcs. qty. tel. misc. 616 | ] 617 | 618 | ##################################################################### 619 | # 620 | # Commands which accent characters, meaning that \i or \j (\imath and 621 | # \jmath in mathmode) should be used instead of `i' and `j' 622 | # 623 | 624 | IJAccent 625 | { 626 | \hat \check \breve \acute \grave \tilde \bar \vec \dot \ddot 627 | 628 | \' \` \^ \" \~ \= \. \u \v \H \t 629 | 630 | ### 631 | # 632 | # The remaining accent commands (\c,\d,\b) put their accent _under_ 633 | # the character, not above, and should thus be used with normal i's 634 | # and j's. 635 | # 636 | ### 637 | 638 | } 639 | 640 | ##################################################################### 641 | # 642 | # Commands which, when the group is terminated, needs italic 643 | # correction. 644 | # 645 | 646 | Italic 647 | { 648 | \it \em \sl 649 | \itshape \slshape 650 | } 651 | 652 | ##################################################################### 653 | # 654 | # Commands which makes the font non-italic. 655 | # 656 | 657 | NonItalic 658 | { 659 | \bf \rm \sf \tt \sc 660 | \upshape 661 | } 662 | 663 | ##################################################################### 664 | # 665 | # Commands which put their argument into italic (and thus possibly 666 | # needs italic correction in the end). 667 | # 668 | # This is currently empty, since \textit, \textsl and \emph do that 669 | # automatically. 670 | # 671 | 672 | ItalCmd 673 | { 674 | } 675 | 676 | ##################################################################### 677 | # 678 | # These commands all have in common that a pagebreak right in front 679 | # of them is highly undesirable; thus there should be no space in 680 | # front of them. 681 | # 682 | 683 | PostLink 684 | { 685 | \index \label 686 | } 687 | 688 | ##################################################################### 689 | # 690 | # These commands should not have a space in front of them for various 691 | # reasons. I.e. much the same as POSTLINK, but produces another 692 | # warning. 693 | # 694 | 695 | NotPreSpaced 696 | { 697 | \footnote \footnotemark \/ 698 | } 699 | 700 | ##################################################################### 701 | # 702 | # The commands listed here, should be prepended with a `~', as in 703 | # "look in table~\ref{foo}", to avoid the references being split 704 | # across lines. 705 | # 706 | 707 | Linker 708 | { 709 | \ref \vref \pageref \eqref \cite 710 | } 711 | 712 | ##################################################################### 713 | # 714 | # Commands/characters which should have \cdots in between, e.g. 715 | # $1+2+3+\cdots+n$. 716 | # 717 | 718 | CenterDots 719 | { 720 | = + - \cdot \div & \times \geq \leq < > 721 | } 722 | 723 | ##################################################################### 724 | # 725 | # Commands/characters which should have \ldots in between, e.g. 726 | # $1,2,3,\ldots,n$. 727 | # 728 | 729 | LowDots 730 | { 731 | . , ; 732 | } 733 | 734 | ##################################################################### 735 | # 736 | # In maths mode, there are certain aliases for mathematical operators 737 | # like sin, cos, etc. Ignore the leading backslash in the commands, 738 | # and so forth. You should list these below. 739 | # 740 | 741 | MathRoman 742 | { 743 | log lg ln lim limsup liminf sin arcsin sinh cos arccos cosh tan 744 | arctan tanh cot coth sec csc max min sup inf arg ker dim hom det 745 | exp Pr gcd deg bmod pmod mod 746 | } 747 | 748 | ##################################################################### 749 | # 750 | # These TeX commands have become unnecessary, as there are LaTeX 751 | # commands that does the same. Purists should thus avoid these in 752 | # their code. 753 | # 754 | # (These are a spell-corrected version of those lacheck uses). 755 | # 756 | 757 | Primitives 758 | { 759 | \above \advance \catcode \chardef \closein \closeout \copy \count 760 | \countdef \cr \crcr \csname \delcode \dimendef \dimen \divide 761 | \expandafter \font \hskip \vskip \openout 762 | } 763 | 764 | ##################################################################### 765 | # 766 | # Format: \command:characters 767 | # 768 | # We'll emit a warning if any of characters are found after the 769 | # command. 770 | # 771 | 772 | NoCharNext 773 | { 774 | \left:{}$ \right:{}$ 775 | } 776 | 777 | ##################################################################### 778 | # 779 | # We're killing \verb@...@ commands and the arguments of the commands 780 | # listed above in WipeArg by overwriting them with a string or a 781 | # single character. 782 | # 783 | # This should not contain an alphabetic character (in case the user 784 | # writes (\foo\verb@bar@), neither should it contain be one of 785 | # LaTeX's reserved characters (`#$%&~_^\{}'), or any parenthesis 786 | # character ('()[]{}'). If possible, don't use a punctuation 787 | # character, either, or any spacing character. 788 | # 789 | # The asterisk is also unsuitable, as some commands behave in another 790 | # way if they are appended with an asterisk. Which more or less 791 | # leaves us with the pipe. 792 | # 793 | # Please note that this may also be a _string_, which will be 794 | # repeated until the proper length is reached. 795 | # 796 | 797 | VerbClear = "|" 798 | 799 | # 800 | # All for now - have fun. 801 | # 802 | ##################################################################### 803 | -------------------------------------------------------------------------------- /conforg/dotfiles/imported/dircolors.ansi-dark: -------------------------------------------------------------------------------- 1 | # Exact Solarized Dark color theme for the color GNU ls utility. 2 | # Designed for dircolors (GNU coreutils) 5.97 3 | # 4 | # This simple theme was simultaneously designed for these terminal color schemes: 5 | # - Solarized dark (best) 6 | # - Solarized light 7 | # - default dark 8 | # - default light 9 | # with a slight optimization for Solarized Dark. 10 | # 11 | # How the colors were selected: 12 | # - Terminal emulators often have an option typically enabled by default that makes 13 | # bold a different color. It is important to leave this option enabled so that 14 | # you can access the entire 16-color Solarized palette, and not just 8 colors. 15 | # - We favor universality over a greater number of colors. So we limit the number 16 | # of colors so that this theme will work out of the box in all terminals, 17 | # Solarized or not, dark or light. 18 | # - We choose to have the following category of files: 19 | # NORMAL & FILE, DIR, LINK, EXEC and 20 | # editable text including source, unimportant text, binary docs & multimedia source 21 | # files, viewable multimedia, archived/compressed, and unimportant non-text 22 | # - For uniqueness, we stay away from the Solarized foreground colors are -- either 23 | # base00 (brightyellow) or base0 (brightblue). However, they can be used if 24 | # you know what the bg/fg colors of your terminal are, in order to optimize the display. 25 | # - 3 different options are provided: universal, solarized dark, and solarized light. 26 | # The only difference between the universal scheme and one that's optimized for 27 | # dark/light is the color of "unimportant" files, which should blend more with the 28 | # background 29 | # - We note that blue is the hardest color to see on dark bg and yellow is the hardest 30 | # color to see on light bg (with blue being particularly bad). So we choose yellow 31 | # for multimedia files which are usually accessed in a GUI folder browser anyway. 32 | # And blue is kept for custom use of this scheme's user. 33 | # - See table below to see the assignments. 34 | 35 | 36 | # Installation instructions: 37 | # This file goes in the /etc directory, and must be world readable. 38 | # You can copy this file to .dir_colors in your $HOME directory to override 39 | # the system defaults. 40 | 41 | # COLOR needs one of these arguments: 'tty' colorizes output to ttys, but not 42 | # pipes. 'all' adds color characters to all output. 'none' shuts colorization 43 | # off. 44 | COLOR tty 45 | 46 | # Below, there should be one TERM entry for each termtype that is colorizable 47 | TERM alacritty 48 | TERM ansi 49 | TERM color_xterm 50 | TERM color-xterm 51 | TERM con132x25 52 | TERM con132x30 53 | TERM con132x43 54 | TERM con132x60 55 | TERM con80x25 56 | TERM con80x28 57 | TERM con80x30 58 | TERM con80x43 59 | TERM con80x50 60 | TERM con80x60 61 | TERM cons25 62 | TERM console 63 | TERM cygwin 64 | TERM dtterm 65 | TERM dvtm 66 | TERM dvtm-256color 67 | TERM Eterm 68 | TERM eterm-color 69 | TERM fbterm 70 | TERM gnome 71 | TERM gnome-256color 72 | TERM jfbterm 73 | TERM konsole 74 | TERM konsole-256color 75 | TERM kterm 76 | TERM linux 77 | TERM linux-c 78 | TERM mach-color 79 | TERM mlterm 80 | TERM nxterm 81 | TERM putty 82 | TERM putty-256color 83 | TERM rxvt 84 | TERM rxvt-256color 85 | TERM rxvt-cygwin 86 | TERM rxvt-cygwin-native 87 | TERM rxvt-unicode 88 | TERM rxvt-unicode256 89 | TERM rxvt-unicode-256color 90 | TERM screen 91 | TERM screen-16color 92 | TERM screen-16color-bce 93 | TERM screen-16color-s 94 | TERM screen-16color-bce-s 95 | TERM screen-256color 96 | TERM screen-256color-bce 97 | TERM screen-256color-s 98 | TERM screen-256color-bce-s 99 | TERM screen-256color-italic 100 | TERM screen-bce 101 | TERM screen-w 102 | TERM screen.linux 103 | TERM screen.xterm-256color 104 | TERM screen.xterm-new 105 | TERM st 106 | TERM st-meta 107 | TERM st-256color 108 | TERM st-meta-256color 109 | TERM tmux 110 | TERM tmux-256color 111 | TERM vt100 112 | TERM xterm 113 | TERM xterm-new 114 | TERM xterm-16color 115 | TERM xterm-256color 116 | TERM xterm-256color-italic 117 | TERM xterm-88color 118 | TERM xterm-color 119 | TERM xterm-debian 120 | TERM xterm-termite 121 | 122 | # EIGHTBIT, followed by '1' for on, '0' for off. (8-bit output) 123 | EIGHTBIT 1 124 | 125 | ############################################################################# 126 | # Below are the color init strings for the basic file types. A color init 127 | # string consists of one or more of the following numeric codes: 128 | # 129 | # Attribute codes: 130 | # 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed 131 | # Text color codes: 132 | # 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white 133 | # Background color codes: 134 | # 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white 135 | # 136 | # NOTES: 137 | # - See http://www.oreilly.com/catalog/wdnut/excerpt/color_names.html 138 | # - Color combinations 139 | # ANSI Color code Solarized Notes Universal SolDark SolLight 140 | # ~~~~~~~~~~~~~~~ ~~~~~~~~~ ~~~~~ ~~~~~~~~~ ~~~~~~~ ~~~~~~~~ 141 | # 00 none NORMAL, FILE 142 | # 30 black base02 143 | # 01;30 bright black base03 bg of SolDark 144 | # 31 red red docs & mm src 145 | # 01;31 bright red orange EXEC 146 | # 32 green green editable text 147 | # 01;32 bright green base01 unimportant text 148 | # 33 yellow yellow unclear in light bg multimedia 149 | # 01;33 bright yellow base00 fg of SolLight unimportant non-text 150 | # 34 blue blue unclear in dark bg user customized 151 | # 01;34 bright blue base0 fg in SolDark unimportant text 152 | # 35 magenta magenta LINK 153 | # 01;35 bright magenta violet archive/compressed 154 | # 36 cyan cyan DIR 155 | # 01;36 bright cyan base1 unimportant non-text 156 | # 37 white base2 157 | # 01;37 bright white base3 bg in SolLight 158 | # 05;37;41 unclear in Putty dark 159 | 160 | 161 | ### By file type 162 | 163 | # global default 164 | NORMAL 00 165 | # normal file 166 | FILE 00 167 | # directory 168 | DIR 34 169 | # 777 directory 170 | OTHER_WRITABLE 34;40 171 | # symbolic link 172 | LINK 35 173 | 174 | # pipe, socket, block device, character device (blue bg) 175 | FIFO 30;44 176 | SOCK 35;44 177 | DOOR 35;44 # Solaris 2.5 and later 178 | BLK 33;44 179 | CHR 37;44 180 | 181 | 182 | ############################################################################# 183 | ### By file attributes 184 | 185 | # Orphaned symlinks (blinking white on red) 186 | # Blink may or may not work (works on iTerm dark or light, and Putty dark) 187 | ORPHAN 05;37;41 188 | # ... and the files that orphaned symlinks point to (blinking white on red) 189 | MISSING 05;37;41 190 | 191 | # files with execute permission 192 | EXEC 01;31 # Unix 193 | .cmd 01;31 # Win 194 | .exe 01;31 # Win 195 | .com 01;31 # Win 196 | .bat 01;31 # Win 197 | .reg 01;31 # Win 198 | .app 01;31 # OSX 199 | 200 | ############################################################################# 201 | ### By extension 202 | 203 | # List any file extensions like '.gz' or '.tar' that you would like ls 204 | # to colorize below. Put the extension, a space, and the color init string. 205 | # (and any comments you want to add after a '#') 206 | 207 | ### Text formats 208 | 209 | # Text that we can edit with a regular editor 210 | .txt 32 211 | .org 32 212 | .md 32 213 | .mkd 32 214 | 215 | # Source text 216 | .h 32 217 | .hpp 32 218 | .c 32 219 | .C 32 220 | .cc 32 221 | .cpp 32 222 | .cxx 32 223 | .objc 32 224 | .cl 32 225 | .sh 32 226 | .bash 32 227 | .csh 32 228 | .zsh 32 229 | .el 32 230 | .vim 32 231 | .java 32 232 | .pl 32 233 | .pm 32 234 | .py 32 235 | .rb 32 236 | .hs 32 237 | .php 32 238 | .htm 32 239 | .html 32 240 | .shtml 32 241 | .erb 32 242 | .haml 32 243 | .xml 32 244 | .rdf 32 245 | .css 32 246 | .sass 32 247 | .scss 32 248 | .less 32 249 | .js 32 250 | .coffee 32 251 | .man 32 252 | .0 32 253 | .1 32 254 | .2 32 255 | .3 32 256 | .4 32 257 | .5 32 258 | .6 32 259 | .7 32 260 | .8 32 261 | .9 32 262 | .l 32 263 | .n 32 264 | .p 32 265 | .pod 32 266 | .tex 32 267 | .go 32 268 | .sql 32 269 | .csv 32 270 | .sv 32 271 | .svh 32 272 | .v 32 273 | .vh 32 274 | .vhd 32 275 | 276 | ### Multimedia formats 277 | 278 | # Image 279 | .bmp 33 280 | .cgm 33 281 | .dl 33 282 | .dvi 33 283 | .emf 33 284 | .eps 33 285 | .gif 33 286 | .jpeg 33 287 | .jpg 33 288 | .JPG 33 289 | .mng 33 290 | .pbm 33 291 | .pcx 33 292 | .pdf 33 293 | .pgm 33 294 | .png 33 295 | .PNG 33 296 | .ppm 33 297 | .pps 33 298 | .ppsx 33 299 | .ps 33 300 | .svg 33 301 | .svgz 33 302 | .tga 33 303 | .tif 33 304 | .tiff 33 305 | .xbm 33 306 | .xcf 33 307 | .xpm 33 308 | .xwd 33 309 | .xwd 33 310 | .yuv 33 311 | .nef 33 # Nikon RAW format 312 | .NEF 33 313 | 314 | # Audio 315 | .aac 33 316 | .au 33 317 | .flac 33 318 | .m4a 33 319 | .mid 33 320 | .midi 33 321 | .mka 33 322 | .mp3 33 323 | .mpa 33 324 | .mpeg 33 325 | .mpg 33 326 | .ogg 33 327 | .opus 33 328 | .ra 33 329 | .wav 33 330 | 331 | # Video 332 | .anx 33 333 | .asf 33 334 | .avi 33 335 | .axv 33 336 | .flc 33 337 | .fli 33 338 | .flv 33 339 | .gl 33 340 | .m2v 33 341 | .m4v 33 342 | .mkv 33 343 | .mov 33 344 | .MOV 33 345 | .mp4 33 346 | .mp4v 33 347 | .mpeg 33 348 | .mpg 33 349 | .nuv 33 350 | .ogm 33 351 | .ogv 33 352 | .ogx 33 353 | .qt 33 354 | .rm 33 355 | .rmvb 33 356 | .swf 33 357 | .vob 33 358 | .webm 33 359 | .wmv 33 360 | 361 | ### Misc 362 | 363 | # Binary document formats and multimedia source 364 | .doc 31 365 | .docx 31 366 | .rtf 31 367 | .odt 31 368 | .dot 31 369 | .dotx 31 370 | .ott 31 371 | .xls 31 372 | .xlsx 31 373 | .ods 31 374 | .ots 31 375 | .ppt 31 376 | .pptx 31 377 | .odp 31 378 | .otp 31 379 | .fla 31 380 | .psd 31 381 | 382 | # Archives, compressed 383 | .7z 1;35 384 | .apk 1;35 385 | .arj 1;35 386 | .bin 1;35 387 | .bz 1;35 388 | .bz2 1;35 389 | .cab 1;35 # Win 390 | .deb 1;35 391 | .dmg 1;35 # OSX 392 | .gem 1;35 393 | .gz 1;35 394 | .iso 1;35 395 | .jar 1;35 396 | .msi 1;35 # Win 397 | .rar 1;35 398 | .rpm 1;35 399 | .tar 1;35 400 | .tbz 1;35 401 | .tbz2 1;35 402 | .tgz 1;35 403 | .tx 1;35 404 | .war 1;35 405 | .xpi 1;35 406 | .xz 1;35 407 | .z 1;35 408 | .Z 1;35 409 | .zip 1;35 410 | .zst 1;35 411 | 412 | # For testing 413 | .ANSI-30-black 30 414 | .ANSI-01;30-brblack 01;30 415 | .ANSI-31-red 31 416 | .ANSI-01;31-brred 01;31 417 | .ANSI-32-green 32 418 | .ANSI-01;32-brgreen 01;32 419 | .ANSI-33-yellow 33 420 | .ANSI-01;33-bryellow 01;33 421 | .ANSI-34-blue 34 422 | .ANSI-01;34-brblue 01;34 423 | .ANSI-35-magenta 35 424 | .ANSI-01;35-brmagenta 01;35 425 | .ANSI-36-cyan 36 426 | .ANSI-01;36-brcyan 01;36 427 | .ANSI-37-white 37 428 | .ANSI-01;37-brwhite 01;37 429 | 430 | ############################################################################# 431 | # Your customizations 432 | 433 | # Unimportant text files 434 | # For universal scheme, use brightgreen 01;32 435 | # For optimal on light bg (but too prominent on dark bg), use white 01;34 436 | .log 01;32 437 | *~ 01;32 438 | *# 01;32 439 | #.log 01;34 440 | #*~ 01;34 441 | #*# 01;34 442 | 443 | # Unimportant non-text files 444 | # For universal scheme, use brightcyan 01;36 445 | # For optimal on dark bg (but too prominent on light bg), change to 01;33 446 | #.bak 01;36 447 | #.BAK 01;36 448 | #.old 01;36 449 | #.OLD 01;36 450 | #.org_archive 01;36 451 | #.off 01;36 452 | #.OFF 01;36 453 | #.dist 01;36 454 | #.DIST 01;36 455 | #.orig 01;36 456 | #.ORIG 01;36 457 | #.swp 01;36 458 | #.swo 01;36 459 | #*.v 01;36 460 | .bak 01;33 461 | .BAK 01;33 462 | .old 01;33 463 | .OLD 01;33 464 | .org_archive 01;33 465 | .off 01;33 466 | .OFF 01;33 467 | .dist 01;33 468 | .DIST 01;33 469 | .orig 01;33 470 | .ORIG 01;33 471 | .swp 01;33 472 | .swo 01;33 473 | *.v 01;33 474 | 475 | # The brightmagenta (Solarized: purple) color is free for you to use for your 476 | # custom file type 477 | .gpg 34 478 | .gpg 34 479 | .pgp 34 480 | .asc 34 481 | .3des 34 482 | .aes 34 483 | .enc 34 484 | .sqlite 34 485 | 486 | DIR 00;38;5;33 487 | -------------------------------------------------------------------------------- /conforg/dotfiles/link-dotfiles.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cd "$(dirname "$0")" 3 | # echo "PWD is " $(pwd) 4 | 5 | for dir in mine imported; do 6 | echo $dir 7 | cd $dir 8 | for file in *; do 9 | echo " " $file 10 | rm -f ~/.${file} 11 | ln -s ~/conforg/dotfiles/${dir}/${file} ~/.${file} 12 | done 13 | cd .. 14 | done 15 | 16 | rm ~/.profile 17 | ln -s ~/.bash_profile ~/.profile 18 | -------------------------------------------------------------------------------- /conforg/dotfiles/mine/Rprofile: -------------------------------------------------------------------------------- 1 | r <- getOption("repos") 2 | r["CRAN"] <- c("https://mirror.csclub.uwaterloo.ca/CRAN/") 3 | options(repos = r) 4 | rm(r) 5 | 6 | Sys.setenv(R_HISTSIZE = '0') 7 | ## sink(file = paste('~/R/history/r-log-', strftime(Sys.time(), '%F %H:%M:%OS9'), sep = ''), split=T) 8 | 9 | options(stringsAsFactors = FALSE) 10 | 11 | q <- function (save="no", ...) { 12 | quit(save=save, ...) 13 | } 14 | 15 | options(menu.graphics = FALSE) 16 | 17 | utils::rc.settings(ipck = TRUE) 18 | 19 | ## options(prompt="ℝ> ") 20 | 21 | options(lintr.linter_file="~/.lintr") 22 | -------------------------------------------------------------------------------- /conforg/dotfiles/mine/XCompose: -------------------------------------------------------------------------------- 1 | include "%L" 2 | -------------------------------------------------------------------------------- /conforg/dotfiles/mine/abcde.conf: -------------------------------------------------------------------------------- 1 | LOWDISK=y 2 | 3 | CDDBMETHOD=musicbrainz 4 | 5 | CDDBCOPYLOCAL="y" 6 | CDDBLOCALDIR="$HOME/.cddb" 7 | CDDBLOCALRECURSIVE="y" 8 | CDDBUSELOCAL="y" 9 | 10 | FLACENCODERSYNTAX=flac 11 | 12 | FLAC=flac 13 | 14 | # FLACOPTS='-s -e -V -8' 15 | FLACOPTS='--silent --exhaustive-model-search --verify --compression-level-8' 16 | 17 | OUTPUTTYPE="flac" 18 | 19 | CDROMREADERSYNTAX=cdparanoia 20 | 21 | CDPARANOIA=cdparanoia 22 | CDPARANOIAOPTS="--never-skip=40" 23 | 24 | CDDISCID=cd-discid 25 | 26 | OUTPUTDIR="$HOME/Music" 27 | 28 | ACTIONS=cddb,playlist,read,encode,tag,move,clean 29 | 30 | OUTPUTFORMAT='${OUTPUT}/${ARTISTFILE}-${ALBUMFILE}/${TRACKNUM}.${TRACKFILE}' 31 | VAOUTPUTFORMAT='${OUTPUT}/Various-${ALBUMFILE}/${TRACKNUM}.${ARTISTFILE}-${TRACKFILE}' 32 | 33 | ONETRACKOUTPUTFORMAT='${OUTPUT}/${ARTISTFILE}-${ALBUMFILE}/${ALBUMFILE}' 34 | VAONETRACKOUTPUTFORMAT='${OUTPUT}/Various-${ALBUMFILE}/${ALBUMFILE}' 35 | 36 | PLAYLISTFORMAT='${OUTPUT}/${ARTISTFILE}-${ALBUMFILE}/${ALBUMFILE}.m3u' 37 | VAPLAYLISTFORMAT='${OUTPUT}/Various-${ALBUMFILE}/${ALBUMFILE}.m3u' 38 | 39 | mungefilename () 40 | { 41 | echo "$@" | sed -e 's/^\.*//' | tr -d ":><|*/\"'?[:cntrl:]" 42 | } 43 | 44 | MAXPROCS=2 45 | 46 | PADTRACKS=y 47 | 48 | EXTRAVERBOSE=1 49 | 50 | COMMENT="" 51 | 52 | EJECTCD=y 53 | -------------------------------------------------------------------------------- /conforg/dotfiles/mine/bash_logout: -------------------------------------------------------------------------------- 1 | if [ "$SHLVL" = 1 ]; then 2 | [ -x /usr/bin/clear_console ] && /usr/bin/clear_console -q 3 | fi 4 | -------------------------------------------------------------------------------- /conforg/dotfiles/mine/bash_profile: -------------------------------------------------------------------------------- 1 | export LANG=en_CA.UTF-8 2 | export LC_ALL=en_CA.UTF-8 3 | 4 | source ~/.bashrc 5 | 6 | if [ -f ~/.profile."$HOSTNAME" ] ; then 7 | . ~/.profile.$HOSTNAME 8 | fi 9 | -------------------------------------------------------------------------------- /conforg/dotfiles/mine/bashrc: -------------------------------------------------------------------------------- 1 | umask 0022 2 | 3 | export EDITOR=nano 4 | export VISUAL=nano 5 | 6 | export WWW_HOME=https://duckduckgo.com/ 7 | 8 | HISTCONTROL=ignoreboth 9 | 10 | HISTIGNORE="cd:df:pwd:[bf]g:exit:history" 11 | 12 | HISTSIZE=10000 13 | HISTFILESIZE=1000000 14 | 15 | shopt -s histappend 16 | 17 | PROMPT_COMMAND="history -a; history -n" 18 | 19 | shopt -s checkwinsize 20 | 21 | if [ "$TERM" = 'xterm' ] || [ "$TERM" = 'rxvt' ] || [ "$TERM" = 'xterm-256color' ] 22 | then 23 | export PROMPT_COMMAND='echo -ne "\033]2;"`whoami`@`hostname -s`"\007"' 24 | fi 25 | 26 | if command -v dircolors > /dev/null 2>&1 27 | then 28 | eval "$(dircolors ~/.dircolors.ansi-dark)" 29 | fi 30 | 31 | RED="\[\033[0;31m\]" 32 | # LIGHT_RED="\[\033[1;31m\]" 33 | # YELLOW="\[\033[1;33m\]" 34 | GREEN="\[\033[0;32m\]" 35 | # LIGHT_GREEN="\[\033[1;32m\]" 36 | # CYAN="\[\033[0;36m\]" 37 | # LIGHT_CYAN="\[\033[1;36m\]" 38 | BLUE="\[\033[0;34m\]" 39 | # LIGHT_BLUE="\[\033[1;34m\]" 40 | PURPLE="\[\033[0;35m\]" 41 | OCHRE="\e[38;2;204;119;34m\]" ## RGB (204, 119, 34), see https://stackoverflow.com/a/26665998 42 | 43 | # WHITE='\e[0;37m' 44 | # LIGHT_GRAY="\[\033[0;37m\]" 45 | # GRAY="\[\033[1;30m\]" 46 | # BLACK="\[\033[0;30m\]" 47 | 48 | NO_COLOUR="\[\033[0m\]" 49 | 50 | case $HOSTNAME in 51 | marcus) 52 | PROMPT_COLOUR=$BLUE 53 | ;; 54 | shell3) 55 | PROMPT_COLOUR=$GREEN 56 | ;; 57 | ochre) 58 | PROMPT_COLOUR=$OCHRE 59 | ;; 60 | *) 61 | PROMPT_COLOUR=$RED 62 | esac 63 | 64 | if [[ ${EUID} == 0 ]] ; then 65 | PROMPT_COLOUR=$PURPLE 66 | fi 67 | 68 | PROMPT="┌─[\h]─[\w]\n└─\\$ " 69 | 70 | PS1="${PROMPT_COLOUR}${PROMPT}${NO_COLOUR}" 71 | 72 | PS1="\[\033[G\]$PS1" 73 | 74 | if [[ "$TERM" == "dumb" ]] ; then 75 | PS1="$ " 76 | fi 77 | 78 | PS2="${PROMPT_COLOUR}\342\224\224> ${NO_COLOUR}" 79 | 80 | export GREP_COLORS='mt=1;37;44' 81 | alias grep='grep --color=auto' 82 | 83 | alias ag='\ag --pager=less' 84 | 85 | alias o='libreoffice' 86 | 87 | alias pi='alpine -i' 88 | 89 | alias please='sudo' 90 | 91 | alias rm="rm" 92 | 93 | alias scp="scp -p" 94 | 95 | alias ww="curl https://wttr.in/yyz" 96 | 97 | alias x='xdg-open' 98 | 99 | alias df='df -x "squashfs"' 100 | 101 | alias fd='fdfind' 102 | 103 | export BLOCKSIZE=1024 104 | 105 | if [[ $(uname) == "FreeBSD" ]] ; then 106 | alias ls='ls -F -G' 107 | else # Presumably Linux 108 | alias ls='ls --classify --color --quoting-style=literal' 109 | fi 110 | 111 | alias l='ls' 112 | alias la='l --all' 113 | alias ll='l -l' 114 | alias lla='l -l --all' 115 | alias lsort='l -l -S --reverse' 116 | 117 | export PROCPS_FROMLEN=40 118 | export PROCPS_USERLEN=12 119 | 120 | alias more='less' 121 | alias mroe='more' 122 | export PAGER=less 123 | 124 | export LESS='--quit-if-one-screen --ignore-case --status-column --LONG-PROMPT --RAW-CONTROL-CHARS --HILITE-UNREAD --tabs=4 --no-init --window=-4' 125 | 126 | if command -v lessfile > /dev/null 2>&1; then 127 | eval "$(lessfile)" 128 | # This sets LESSOPEN and will pick up on ~/.lessfilter. 129 | else 130 | # Fall back to do the best we can. 131 | export LESSOPEN="| ~/.lessfilter %s" 132 | fi 133 | 134 | if command -v pygmentize > /dev/null 2>&1; then 135 | export LESSCOLOURIZER="pygmentize -f terminal" 136 | elif command -v source-highlight > /dev/null 2>&1; then 137 | export LESSCOLOURIZER="source-highlight --failsafe --infer-lang -f esc --style-file=esc.style -i" 138 | fi 139 | 140 | function tree() { 141 | find "${1:-.}" -type d -print | sed -e 's:[ ]*/:|____:g;s:____|: |:g' 142 | } 143 | 144 | alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"' 145 | 146 | function swap() { 147 | local TMPFILE=tmp.$$ 148 | mv "$1" $TMPFILE 149 | mv "$2" "$1" 150 | mv $TMPFILE "$2" 151 | } 152 | 153 | function monitor() { 154 | while true ; do 155 | clear 156 | tail "$1" 157 | sleep 10 158 | done 159 | } 160 | 161 | function order() { 162 | sort | uniq -c | sort -rn 163 | } 164 | 165 | function wipe_image() { 166 | for FILE in "$@"; do 167 | exiftool -all= "$FILE" 168 | done 169 | } 170 | 171 | function wipe_pdf() { 172 | for FILE in "$@"; do 173 | exiftool -all= "$FILE" 174 | qpdf --linearize --replace-input "$FILE" 175 | done 176 | } 177 | 178 | function colsum { 179 | paste -s -d+ | bc -- 180 | } 181 | 182 | function get { 183 | rsync --archive --progress --human-readable "$@" . 184 | } 185 | 186 | function repeat(){ 187 | for ((i=0; i < $1; i++)); do 188 | eval ${*:2} 189 | done 190 | } 191 | 192 | source ~/.git-completion.bash 193 | 194 | if [ -f /etc/bash_completion ] && ! shopt -oq posix; then 195 | source /etc/bash_completion 196 | fi 197 | 198 | PATH=/usr/local/bin:$PATH 199 | 200 | PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin 201 | 202 | PATH=/usr/local/src/emacs/src:$PATH 203 | alias emacsclient="/usr/local/src/emacs/lib-src/emacsclient" 204 | alias e="emacsclient --no-wait" 205 | 206 | if [ -f /usr/local/src/R/R ] ; then 207 | PATH=/usr/local/src/R:$PATH 208 | fi 209 | 210 | alias zotero="/usr/local/src/zotero/Zotero_linux-x86_64/zotero" 211 | 212 | PATH=$PATH:~/.irc/ 213 | 214 | if [ -d ~/.rbenv/ ] ; then 215 | PATH=$HOME/.rbenv/bin:$PATH 216 | eval "$(rbenv init -)" 217 | fi 218 | 219 | export GOPATH=~/.gopath 220 | PATH=$PATH:$GOPATH/bin/ 221 | 222 | PATH=$PATH:~/.local/bin/ 223 | 224 | PATH=$PATH:~/.cargo/bin/ 225 | 226 | PATH=$PATH:~/bin/:. 227 | 228 | if [ -f ~/.bash."$HOSTNAME".rc ] ; then 229 | . ~/.bash.$HOSTNAME.rc 230 | fi 231 | -------------------------------------------------------------------------------- /conforg/dotfiles/mine/gemrc: -------------------------------------------------------------------------------- 1 | --- 2 | :verbose: true 3 | :benchmark: false 4 | :bulk_threshold: 1000 5 | :update_sources: true 6 | :backtrace: false 7 | gem: --no-document 8 | -------------------------------------------------------------------------------- /conforg/dotfiles/mine/gitattributes: -------------------------------------------------------------------------------- 1 | *.lisp diff=lisp 2 | *.el diff=lisp 3 | *.org diff=org 4 | -------------------------------------------------------------------------------- /conforg/dotfiles/mine/gitconfig: -------------------------------------------------------------------------------- 1 | [include] 2 | path = ~/.gitconfig.local 3 | [color] 4 | ui = auto 5 | pager = true 6 | [column] 7 | ui = auto 8 | [core] 9 | editor = emacsclient 10 | [user] 11 | name = William Denton 12 | email = william@williamdenton.org 13 | [push] 14 | default = current 15 | [init] 16 | defaultBranch = main 17 | [alias] 18 | hist = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all 19 | -------------------------------------------------------------------------------- /conforg/dotfiles/mine/lessfilter: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | if [ -v LESSCOLOURIZER ]; then 3 | case "$1" in 4 | .bash_|*.bat|*.bib|*.c|Changelog|*.diff|Gemfile|*.gemspec|*.h|*.html|*.ini|*.js|*.json|*.jsonld|\ 5 | Makefile|*.md|*.patch|*.php|*.pl|*.pm|*.py|Rakefile|*.rake|*.rb|*.R|*.Rprofile|*.rss|*.sh|*.sql|*.xsl|*.tex|*.toc|*.yaml|*.yml) 6 | $LESSCOLOURIZER "$1" ;; 7 | *.pdf) 8 | if command -v pdftotext > /dev/null 2>&1 ; then pdftotext -layout "$1" - 9 | else echo "No pdftotext available; try installing poppler-utils"; fi ;; 10 | *) 11 | # Pass through to lessfile 12 | exit 1 13 | esac; 14 | fi 15 | 16 | exit 1 17 | -------------------------------------------------------------------------------- /conforg/dotfiles/mine/lintr: -------------------------------------------------------------------------------- 1 | linters: linters_with_defaults( 2 | indentation_linter = indentation_linter(4L) 3 | ) 4 | encoding: "UTF-8" 5 | -------------------------------------------------------------------------------- /conforg/dotfiles/mine/nanorc: -------------------------------------------------------------------------------- 1 | set fill -8 2 | set nonewlines 3 | set nowrap 4 | set softwrap 5 | -------------------------------------------------------------------------------- /conforg/dotfiles/mine/pryrc: -------------------------------------------------------------------------------- 1 | require "awesome_print" 2 | AwesomePrint.pry! 3 | -------------------------------------------------------------------------------- /conforg/dotfiles/mine/rubocop.yml: -------------------------------------------------------------------------------- 1 | Style/StringLiterals: 2 | EnforcedStyle: double_quotes 3 | SupportedStyles: 4 | - single_quotes 5 | - double_quotes 6 | 7 | AllCops: 8 | NewCops: enable 9 | -------------------------------------------------------------------------------- /conforg/dotfiles/mine/shellcheckrc: -------------------------------------------------------------------------------- 1 | disable=SC2086 2 | -------------------------------------------------------------------------------- /conforg/dotfiles/mine/signature: -------------------------------------------------------------------------------- 1 | -- 2 | William Denton 3 | https://www.miskatonic.org/ 4 | Librarian, artist and licensed private investigator. 5 | Toronto, Canada 6 | -------------------------------------------------------------------------------- /conforg/dotfiles/mine/signature.work: -------------------------------------------------------------------------------- 1 | William Denton (he/him) 2 | Associate Librarian: Scholarly Analytics / Mathematics & Statistics 3 | York University (Toronto, Canada) https://www.library.yorku.ca/ 4 | -------------------------------------------------------------------------------- /conforg/dotfiles/mine/sqliterc: -------------------------------------------------------------------------------- 1 | .headers on 2 | .mode column 3 | -------------------------------------------------------------------------------- /conforg/dotfiles/mine/tmux.conf: -------------------------------------------------------------------------------- 1 | set -g base-index 1 2 | 3 | set -g status-left-length 20 4 | set -g status-left "" 5 | set -g status-right "[Session: #S]" 6 | set -g status-justify centre 7 | 8 | set -g default-terminal "screen-256color" 9 | 10 | set-option -g status-bg black 11 | set-option -g status-fg yellow 12 | 13 | set-option -g display-panes-active-colour blue 14 | set-option -g display-panes-colour brightred 15 | 16 | set-window-option -g clock-mode-colour green 17 | 18 | set-window-option -g window-status-bell-style fg=black,bg=red 19 | -------------------------------------------------------------------------------- /conforg/dotfiles/mine/xmodmaprc: -------------------------------------------------------------------------------- 1 | keysym Home = Insert 2 | keysym End = Insert 3 | -------------------------------------------------------------------------------- /conforg/scripts/emacs-install-personal.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cd /usr/local/src/ 3 | git clone https://git.savannah.gnu.org/git/emacs.git 4 | cd emacs 5 | ./autogen.sh 6 | ./configure --with-pgtk --with-tree-sitter && make -j 7 | 8 | cd /usr/local/src/ 9 | git clone https://git.savannah.gnu.org/git/emacs/org-mode.git 10 | cd org-mode 11 | make -j 12 | 13 | cd 14 | git clone git@github.com:wdenton/.emacs.d.git 15 | # Or if you don't want to use a GitHub account: 16 | # git clone https://github.com/wdenton/.emacs.d.git 17 | echo "Now run emacs, and say no when asked about a location for abbrev_defs." 18 | -------------------------------------------------------------------------------- /conforg/scripts/emacs-install-requirements.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo apt-get build-dep emacs 3 | sudo apt-get install libjansson-dev valgrind fonts-firacode libgccjit0 libgccjit-11-dev libgtk-3-dev 4 | ## On Linux Mint, at least, these are not installed when the above is done. Curious. 5 | ## On other systems, it can't hurt. 6 | sudo apt-get install texinfo libxpm-dev libjpeg-dev libgif-dev libtiff-dev libtinfo-dev libtree-sitter-dev 7 | -------------------------------------------------------------------------------- /conforg/scripts/emacs-update.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cd /usr/local/src/emacs/ 3 | git pull 4 | ./configure --with-pgtk --with-tree-sitter && make -j && cd ../org-mode/ && make -j update 5 | -------------------------------------------------------------------------------- /conforg/scripts/initialize.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo mkdir -p /usr/local/src/ 3 | sudo chown $USER:$USER /usr/local/src 4 | -------------------------------------------------------------------------------- /conforg/scripts/r-install-packages.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | package_list="RCurl RSQLite arules arulesViz cluster dbplyr devtools docopt flexdashboard fpc fs geonames geosphere GGally ggrepel ggridges ggvis gmp gtools hms igraph knitr lintr lubridate mapproj maps maptools MESS openxlsx osmdata primes readODS readxl remotes rgeos roxygen2 seriation sf shiny skimr testthat tidyverse tm topicmodels usethis xlsx" 3 | for pkg in $package_list 4 | do 5 | Rscript --vanilla -e "install.packages('$pkg', repos=c('https://mirror.csclub.uwaterloo.ca/CRAN/'))" 6 | done 7 | Rscript --vanilla -e "devtools::install_github('yorkulibraries/yulr')" 8 | -------------------------------------------------------------------------------- /conforg/scripts/r-install-personal.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | unset R_VERSION 3 | declare -a R_VERSION=( '4.4.2' ) 4 | cd $(dirname "$0") 5 | SCRIPTS_DIR=$(pwd) 6 | MIRROR="https://mirror.csclub.uwaterloo.ca/CRAN/" 7 | cd /usr/local/src/R 8 | if [ -d "/usr/local/src/R/R-${R_VERSION}" ]; then 9 | echo "Removing old source directory ..." 10 | rm -r R-${R_VERSION} 11 | fi 12 | if ! [ -f "R-${R_VERSION}.tar.gz" ]; then 13 | echo "Downloading R-${R_VERSION} tarball ..." 14 | R_MAJOR=${R_VERSION:0:1} 15 | curl -O $MIRROR/src/base/R-${R_MAJOR}/R-${R_VERSION}.tar.gz 16 | else 17 | echo "Using existing R-${R_VERSION} tarball ..." 18 | fi 19 | echo "Uncompressing ..." 20 | tar xzvf R-$R_VERSION.tar.gz 21 | 22 | echo "Compiling ..." 23 | cd R-$R_VERSION 24 | ./configure --enable-R-shlib 25 | make -j && make -j check 26 | 27 | unset R_VERSION 28 | declare -a R_VERSION=( '4.4.2' ) 29 | cd /usr/local/src/R/ 30 | rm -f R Rscript 31 | ln -s R-${R_VERSION}/bin/R R 32 | ln -s R-${R_VERSION}/bin/Rscript Rscript 33 | 34 | source ~/.bashrc 35 | 36 | unset R_VERSION 37 | declare -a R_VERSION=( '4.4.2' ) 38 | cd $SCRIPTS_DIR 39 | ./r-install-packages.sh 40 | -------------------------------------------------------------------------------- /conforg/scripts/r-install-requirements.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo apt install libbz2-dev liblzma-dev libxml2-dev libpcre2-dev libpcre3-dev fonts-inconsolata 3 | sudo apt install xorg-dev gfortran libreadline-dev libcurl4-openssl-dev libssl-dev libgsl-dev curl libcurl4-openssl-dev libudunits2-dev libgdal-dev 4 | sudo apt build-dep r-base 5 | mkdir -p ~/R/history/ 6 | mkdir -p ~/.R/lintr_cache/ 7 | mkdir -p /usr/local/src/R 8 | -------------------------------------------------------------------------------- /conforg/scripts/r-install-system.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | unset R_VERSION 3 | declare -a R_VERSION=( '4.4.2' ) 4 | cd $(dirname "$0") 5 | SCRIPTS_DIR=$(pwd) 6 | MIRROR="https://mirror.csclub.uwaterloo.ca/CRAN/" 7 | cd /usr/local/src/R 8 | if [ -d "/usr/local/src/R/R-${R_VERSION}" ]; then 9 | echo "Removing old source directory ..." 10 | rm -r R-${R_VERSION} 11 | fi 12 | if ! [ -f "R-${R_VERSION}.tar.gz" ]; then 13 | echo "Downloading R-${R_VERSION} tarball ..." 14 | R_MAJOR=${R_VERSION:0:1} 15 | curl -O $MIRROR/src/base/R-${R_MAJOR}/R-${R_VERSION}.tar.gz 16 | else 17 | echo "Using existing R-${R_VERSION} tarball ..." 18 | fi 19 | echo "Uncompressing ..." 20 | tar xzvf R-$R_VERSION.tar.gz 21 | 22 | echo "Compiling ..." 23 | cd R-$R_VERSION 24 | ./configure --enable-R-shlib 25 | make -j && make -j check 26 | sudo make install 27 | 28 | sudo su - -c "cd $SCRIPTS_DIR; ./r-install-packages.sh" 29 | -------------------------------------------------------------------------------- /conforg/scripts/ruby-install-gems.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | GEM_LIST="awesome_print bundler docopt http marc nokogiri pry pry-doc rubocop rubyul sqlite3" 3 | for gem in $GEM_LIST 4 | do 5 | gem install $gem 6 | done 7 | -------------------------------------------------------------------------------- /conforg/scripts/ruby-install-personal.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | unset RUBY_VERSION 3 | declare -a RUBY_VERSION=( '3.4.1' ) 4 | rbenv install --verbose $RUBY_VERSION 5 | rbenv global $RUBY_VERSION 6 | ~/conforg/scripts/ruby-install-gems.sh 7 | echo "Now run bundle install where needed (and perhaps bundle update --bundler)." 8 | -------------------------------------------------------------------------------- /conforg/scripts/ruby-install-requirements.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo apt-get build-dep ruby 3 | sudo apt-get install libreadline-dev libsqlite3-dev libyaml-dev libssl-dev libxslt1-dev 4 | -------------------------------------------------------------------------------- /conforg/scripts/ruby-install-system.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | unset RUBY_VERSION 3 | declare -a RUBY_VERSION=( '3.4.1' ) 4 | mkdir -p /usr/local/src/ruby 5 | cd /usr/local/src/ruby 6 | 7 | # The 3.0.2.tar.gz tarball is in the 3.0/ directory, for example. 8 | MINOR_VERSION=$(echo ${RUBY_VERSION} | sed 's/\.[[:digit:]]$//') 9 | 10 | curl --location --remote-name https://cache.ruby-lang.org/pub/ruby/${MINOR_VERSION}/ruby-${RUBY_VERSION}.tar.gz 11 | tar xzvf ruby-${RUBY_VERSION}.tar.gz 12 | cd ruby-${RUBY_VERSION} 13 | 14 | ./configure 15 | make 16 | 17 | sudo make install 18 | sudo ~/conforg/scripts/ruby-install-gems.sh 19 | 20 | echo "Now run bundle install where needed (and perhaps bundle update --bundler)." 21 | -------------------------------------------------------------------------------- /conforg/scripts/ruby-rbenv.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | if [[ -d ~/.rbenv ]]; then 3 | echo "Upgrade if possible" 4 | cd ~/.rbenv/ 5 | git pull 6 | cd plugins/ruby-build 7 | git pull 8 | else 9 | echo "Installing" 10 | git clone https://github.com/rbenv/rbenv.git ~/.rbenv 11 | git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build 12 | source ~/.bashrc 13 | fi 14 | -------------------------------------------------------------------------------- /conforg/scripts/tor-install-requirements.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo apt install build-essential 3 | sudo apt install libevent-dev libssl-dev libcap-dev liblzma-dev libzstd-dev libseccomp-dev libscrypt-dev zlib1g zlib1g-dev 4 | sudo apt install speedometer tmux vnstat 5 | mkdir -p /usr/local/src/tor/ /usr/local/src/tor/log/ 6 | -------------------------------------------------------------------------------- /conforg/scripts/tor-install-system.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | unset TOR_VERSION 3 | declare -a TOR_VERSION=( '0.4.8.13' ) 4 | cd /usr/local/src/tor/ 5 | curl --location --remote-name https://dist.torproject.org/tor-${TOR_VERSION}.tar.gz 6 | tar --extract --verbose --gunzip --file tor-${TOR_VERSION}.tar.gz 7 | cd tor-${TOR_VERSION} 8 | ./configure && make && sudo make install 9 | echo "Now run ~/conforg/scripts/tor-run.sh" 10 | -------------------------------------------------------------------------------- /conforg/scripts/tor-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | if tmux has-session -t tor 3 | then 4 | echo "Session tor exists; killing it nicely ..." 5 | tmux send-keys -t tor:1 "C-c" 6 | tmux send-keys -t tor:2 "C-c" 7 | tmux send-keys -t tor:3 "C-c" 8 | tmux send-keys -t tor:4 "C-c" 9 | sleep 35 10 | tmux kill-window -t tor:1 11 | tmux kill-window -t tor:2 12 | tmux kill-window -t tor:3 13 | tmux kill-window -t tor:4 14 | fi 15 | 16 | echo "Starting tor session ..." 17 | 18 | tmux new-session -d -s "tor" 19 | 20 | if [[ -z $TOR_IFACE ]]; then 21 | TOR_IFACE=wlan0 22 | fi 23 | 24 | tmux new-window -t tor:2 25 | tmux new-window -t tor:3 26 | tmux new-window -t tor:4 27 | 28 | tmux send-keys -t tor:3 "speedometer -t ${TOR_IFACE} -r ${TOR_IFACE} -l -m 1048576" "C-m" 29 | 30 | tmux select-window -t 1 31 | tmux send-keys -t tor:1 "tor" "C-m" 32 | 33 | tmux send-keys -t tor:2 "tail -f /usr/local/src/tor/log/notices.log" "C-m" 34 | 35 | tmux send-keys -t tor:4 "vnstat -d --iface ${TOR_IFACE}" "C-m" 36 | -------------------------------------------------------------------------------- /conforguration.org: -------------------------------------------------------------------------------- 1 | #+TITLE: Conforguration 2 | #+AUTHOR: William Denton 3 | #+EMAIL: william@williamdenton.org 4 | 5 | #+STARTUP: content entitiespretty inlineimages 6 | #+OPTIONS: toc:nil ^:nil 7 | 8 | # These variables are hardcoded now. Could maybe abstract them out later. 9 | # +PROPERTY: header-args :var script_dir="conforguration_scripts" :var dotfiles_dir="dotfiles" 10 | 11 | If you're looking at this on GitHub, the BEGIN and END source block wrappers are hidden, so you can't see the parameters. Look at the raw version of the file, or clone the repository and load it into Emacs, to read it properly. 12 | 13 | * Tangle everything 14 | 15 | Before anything else, make sure that everything has been tangled, so all the dot files and install scripts are up to date. 16 | 17 | There are three ways to do it: 18 | 19 | + Hit the keystroke =C-c C-v t=; 20 | + Run =M-x org-babel-tangle=; 21 | + Or hit =C-c C-c= on the following code block: 22 | 23 | #+begin_src elisp :results silent 24 | (org-babel-tangle) 25 | #+end_src 26 | They all do the same thing. 27 | 28 | * Initialize 29 | 30 | This only needs to be done once per machine, to create =/usr/local/src/= and make it owned by oneself. This is where all source code will be downloaded and compiled. 31 | 32 | #+begin_src shell :tangle conforg/scripts/initialize.sh :shebang "#!/bin/bash" 33 | sudo mkdir -p /usr/local/src/ 34 | sudo chown $USER:$USER /usr/local/src 35 | #+end_src 36 | 37 | * Installing 38 | 39 | ** Copy the dot files and scripts into place 40 | 41 | Everything in the =conforg= directory needs to be copied to $HOME. The easiest way to do this is with =rsync=, which will create any directories necessary. To make sure no old cruft accumulates, delete anything in the target directory that shouldn't be there. 42 | 43 | #+begin_src shell :tangle install/install.sh :shebang "#!/bin/bash" 44 | rsync --archive --delete ~/src/conforguration/conforg/ ${HOME}/conforg/ 45 | #+end_src 46 | 47 | #+RESULTS: 48 | 49 | ** Script to create symlinks for the dot files 50 | 51 | Once all the dot files are in =~/conforg/dotfiles/=, we need a script to set them up in the home directory. This is done by making symlinks. 52 | 53 | First, to be safe, move into the directory where the script is run. 54 | 55 | #+begin_src shell :tangle conforg/dotfiles/link-dotfiles.sh :shebang "#!/bin/bash" :eval no 56 | cd "$(dirname "$0")" 57 | # echo "PWD is " $(pwd) 58 | #+end_src 59 | 60 | The dot files are in two directories: =mine= and =imported=. Go into each directory and make a symbolic link (specifying the full path) to =file= from =~/.file=. In other words, =~/.bashrc= is a symlink to the =mine/bashrc= here. 61 | 62 | (To be absolutely safe, all the filenames should be in double quotes, but there are no spaces or strange characters in my filenames, so I'm going to leave that out.) 63 | 64 | #+begin_src shell :tangle conforg/dotfiles/link-dotfiles.sh :shebang "#!/bin/bash" :eval no 65 | for dir in mine imported; do 66 | echo $dir 67 | cd $dir 68 | for file in *; do 69 | echo " " $file 70 | rm -f ~/.${file} 71 | ln -s ~/conforg/dotfiles/${dir}/${file} ~/.${file} 72 | done 73 | cd .. 74 | done 75 | #+end_src 76 | 77 | Finally, make sure that the =.bash_profile= is the real =.profile=, so no errant leftover =.profile= can get in the way. 78 | 79 | #+begin_src shell :tangle conforg/dotfiles/link-dotfiles.sh :shebang "#!/bin/bash" :eval no 80 | rm ~/.profile 81 | ln -s ~/.bash_profile ~/.profile 82 | #+end_src 83 | 84 | Once this is run you need to open up a new shell, or =source ~/.bashrc=, to see any changes. 85 | 86 | ** Install 87 | 88 | Add a line to the install script to call the above linking script. This =install.sh= script can be run when Conforguration is pulled down fresh from GitHub on a new machine, and will put everything in place. To update and refresh dot files and scripts locally within Emacs, you should use the localhost section below. 89 | 90 | #+begin_src shell :tangle install/install.sh 91 | ~/conforg/dotfiles/link-dotfiles.sh 92 | #+end_src 93 | 94 | ** Noweb for installing remotely 95 | 96 | TODO: Explain. 97 | 98 | #+NAME: install-conforg-remotely 99 | #+begin_src shell 100 | rsync --archive --compress --delete ~/src/conforguration/conforg/ ${hostname}:conforg/ 101 | ssh ${hostname} "conforg/dotfiles/link-dotfiles.sh" 102 | #+end_src 103 | 104 | * Dot files 105 | 106 | ** Introduction 107 | 108 | Almost all of my "dot files" ([[https://en.wikipedia.org/wiki/Run_commands][run command files]], containing configuration instructions for different programs) are in this Org file. Most lines have a comment explaining what they are for, and when I've cribbed something from some web page or another's dot file (which is frequent), I've credited it where possible. 109 | 110 | There are two kinds of dot files: "mine" and "imported." Most are "mine," and are handled completely in this Org file. The "imported" ones are copied completely from elsewhere, usually some software distribution that has one particular file I need. Right now there are only three imported files: one is a script that does completion for Git in bash, one makes ls listings be in colour, and the third, which configures a LaTeX linter, really should be under "mine" but it's so long I can't be bothered right now. 111 | 112 | The files that are "mine" are all tangled from this Org file. The "imported" ones are copied as is. 113 | 114 | If you need some special environment variables on a machine, put them in ~.bash.$HOSTNAME.rc~, as described at the bottom of ~.bashrc~. That's one way of setting up private environment variables that hold passwords or API tokens. 115 | 116 | A note about languages specified in the source blocks: the language setting is required, but it doesn't have to be a known and supported language. So in order for the =.tmuxrc= to be tangled, for example, I say it has the language "tmux," which doesn't exist but makes it work. 117 | 118 | ** Abcde 119 | 120 | *** Config (=.abcde.conf=) 121 | :PROPERTIES: 122 | :header-args: :tangle conforg/dotfiles/mine/abcde.conf 123 | :END: 124 | 125 | Abcde is [[https://abcde.einval.com/wiki/][A Better CD Encoder]]. With one program I can digitize a CD all in one go, and with luck get some metadata from [[https://musicbrainz.org/][MusicBrainz]]. This configuration I [[https://www.andrews-corner.org/abcde/][lifted from Andrew's Corner]] and left alone. All I want to do is turn the CD into FLAC files, and with this all I have to do is run =abcde= without any options. Then I use [[https://wiki.gnome.org/Apps/EasyTAG][EasyTAG]] to clean up the metadata. 126 | 127 | LOWDISK "conserves disk space by encoding tracks immediately after reading them" (I quote from the man page) which may not be too big a deal, but: "Note that this option may also help when reading a CD with errors. This is because on a scratchy disk reading is quite timing sensitive and this option reduces the background load on the system which allows the ripping program more precise control." That's useful. 128 | 129 | #+begin_src abcde 130 | LOWDISK=y 131 | #+end_src 132 | 133 | Where to retrieve track information. 134 | 135 | #+begin_src abcde 136 | CDDBMETHOD=musicbrainz 137 | #+end_src 138 | 139 | Make a local cache of CDDB entries and then volunteer to use these entries when and if they match the CD. 140 | 141 | #+begin_src abcde 142 | CDDBCOPYLOCAL="y" 143 | CDDBLOCALDIR="$HOME/.cddb" 144 | CDDBLOCALRECURSIVE="y" 145 | CDDBUSELOCAL="y" 146 | #+end_src 147 | 148 | Specify the encoder to use for FLAC. In this case flac is the only choice. 149 | 150 | #+begin_src abcde 151 | FLACENCODERSYNTAX=flac 152 | #+end_src 153 | 154 | Specify the path to the selected encoder. It's in my PATH so I don't need to specify a full path. 155 | 156 | #+begin_src abcde 157 | FLAC=flac 158 | #+end_src 159 | 160 | Specify your required encoding options here. Multiple options can be selected as '--best --another-option' etc. Overall bitrate is about 880 kbs/s with level 8. 161 | 162 | #+begin_src abcde 163 | # FLACOPTS='-s -e -V -8' 164 | FLACOPTS='--silent --exhaustive-model-search --verify --compression-level-8' 165 | #+end_src 166 | 167 | Output type for FLAC. 168 | 169 | #+begin_src abcde 170 | OUTPUTTYPE="flac" 171 | #+end_src 172 | 173 | The CD ripping program to use. There are a few choices here: cdda2wav, dagrab, cddafs (Mac OS X only) and flac. 174 | 175 | #+begin_src abcde 176 | CDROMREADERSYNTAX=cdparanoia 177 | #+end_src 178 | 179 | Specify the location of the ripping program and pass any extra options. 180 | 181 | #+begin_src abcde 182 | CDPARANOIA=cdparanoia 183 | CDPARANOIAOPTS="--never-skip=40" 184 | #+end_src 185 | 186 | Path to the CD identification program. 187 | 188 | #+begin_src abcde 189 | CDDISCID=cd-discid 190 | #+end_src 191 | 192 | The base location for the encoded music files. 193 | 194 | #+begin_src abcde 195 | OUTPUTDIR="$HOME/Music" 196 | #+end_src 197 | 198 | Default actions that abcde will take. 199 | 200 | #+begin_src abcde 201 | ACTIONS=cddb,playlist,read,encode,tag,move,clean 202 | #+end_src 203 | 204 | Decide here how you want the tracks labelled for a standard 'single-artist', multi-track encode and also for a multi-track, 'various-artist' encode: 205 | 206 | #+begin_src abcde 207 | OUTPUTFORMAT='${OUTPUT}/${ARTISTFILE}-${ALBUMFILE}/${TRACKNUM}.${TRACKFILE}' 208 | VAOUTPUTFORMAT='${OUTPUT}/Various-${ALBUMFILE}/${TRACKNUM}.${ARTISTFILE}-${TRACKFILE}' 209 | #+end_src 210 | 211 | Decide here how you want the tracks labelled for a standard 'single-artist', single-track encode and also for a single-track 'various-artist' encode. (Create a single-track encode with 'abcde -1' from the command line.) 212 | 213 | #+begin_src abcde 214 | ONETRACKOUTPUTFORMAT='${OUTPUT}/${ARTISTFILE}-${ALBUMFILE}/${ALBUMFILE}' 215 | VAONETRACKOUTPUTFORMAT='${OUTPUT}/Various-${ALBUMFILE}/${ALBUMFILE}' 216 | #+end_src 217 | 218 | Create playlists for single and various-artist encodes. 219 | 220 | #+begin_src abcde 221 | PLAYLISTFORMAT='${OUTPUT}/${ARTISTFILE}-${ALBUMFILE}/${ALBUMFILE}.m3u' 222 | VAPLAYLISTFORMAT='${OUTPUT}/Various-${ALBUMFILE}/${ALBUMFILE}.m3u' 223 | #+end_src 224 | 225 | The man page says, "mungefilename() is an abcde shell function that can be overridden via abcde.conf. It takes CDDB data as $1 and outputs the resulting filename on stdout." This one takes out dots preceding the album name, and removes other difficult characters. 226 | 227 | #+begin_src abcde 228 | mungefilename () 229 | { 230 | echo "$@" | sed -e 's/^\.*//' | tr -d ":><|*/\"'?[:cntrl:]" 231 | } 232 | #+end_src 233 | 234 | Use two encoders simultaneously. 235 | 236 | #+begin_src abcde 237 | MAXPROCS=2 238 | #+end_src 239 | 240 | Number tracks as 01 and 02, not 1 and 2. 241 | 242 | #+begin_src abcde 243 | PADTRACKS=y 244 | #+end_src 245 | 246 | Make output more verbose. Most verbose is 2. 247 | 248 | #+begin_src abcde 249 | EXTRAVERBOSE=1 250 | #+end_src 251 | 252 | Add a comment? No. 253 | 254 | #+begin_src abcde 255 | COMMENT="" 256 | #+end_src 257 | 258 | Finally, eject the CD when done. 259 | 260 | #+begin_src abcde 261 | EJECTCD=y 262 | #+end_src 263 | 264 | 265 | ** Bash 266 | 267 | My shell is [[https://www.gnu.org/software/bash/][Bash]]. I've looked at other ones, and some do fancy impressive things, but my shell needs are fairly simple. 268 | 269 | I've forgotten the intricacies of when a =.profile= is used and how interactive and non-interactive shells handle things differently, but what I have works for me. 270 | 271 | *** Profile (=.bash_profile=) 272 | :PROPERTIES: 273 | :header-args: :tangle conforg/dotfiles/mine/bash_profile 274 | :END: 275 | 276 | First, I set [[https://www.gnu.org/software/gettext/manual/html_node/Locale-Environment-Variables.html#Locale-Environment-Variables][locale environment variables]] to say I want to use English, specifically Canadian English. 277 | 278 | #+begin_src shell 279 | export LANG=en_CA.UTF-8 280 | export LC_ALL=en_CA.UTF-8 281 | #+end_src 282 | 283 | If these locales aren't available---perhaps because this is running on a new machine---then I need to run these to configure it. This is only necessary once. 284 | 285 | #+begin_src shell :tangle no 286 | sudo locale-gen en_CA.UTF-8 287 | sudo update-locale LANG=en_CA.UTF-8 288 | #+end_src 289 | 290 | Then the =.bashrc= is processed. 291 | 292 | #+begin_src shell 293 | source ~/.bashrc 294 | #+end_src 295 | 296 | There are some settings or commands (like calling =ssh-add= for a particular host) that I use on a particular machine, and this makes that possible. If the machine is named =dartagnan=, put commands in =~/.profile.dartagnan= (similar to the =.bashrc=) for them just to be run in login shells there. 297 | 298 | #+begin_src shell 299 | if [ -f ~/.profile."$HOSTNAME" ] ; then 300 | . ~/.profile.$HOSTNAME 301 | fi 302 | #+end_src 303 | 304 | *** Config (=.bashrc=) 305 | :PROPERTIES: 306 | :header-args: :tangle conforg/dotfiles/mine/bashrc 307 | :END: 308 | 309 | **** File permissions 310 | 311 | Set the default "user file-created mask" to 0022, so that by default regular files are created 644 (=-rw-r--r--=) and executables 755 (=-rwxr-xr-x=) 312 | 313 | #+begin_src shell 314 | umask 0022 315 | #+end_src 316 | 317 | **** Editing 318 | 319 | My preferred editor is Emacs (of course) but I define these so that if someone pops up an editor it doesn't use vi. 320 | 321 | #+begin_src shell 322 | export EDITOR=nano 323 | export VISUAL=nano 324 | #+end_src 325 | 326 | **** Web 327 | 328 | The only thing I ever use that pays attention to =WWW_HOME= is lynx, I think, but [[https://duckduckgo.com/][DuckDuckGo]] is a good default first page to load if something is going to try. 329 | 330 | #+begin_src shell 331 | export WWW_HOME=https://duckduckgo.com/ 332 | #+end_src 333 | 334 | **** History 335 | 336 | Don't put duplicate lines or lines starting with space in the history. 337 | 338 | #+begin_src shell 339 | HISTCONTROL=ignoreboth 340 | #+end_src 341 | 342 | The commands listed here will be ignored by history. If I run =cd= and then hit , =cd= doesn't reappear. 343 | 344 | #+begin_src shell 345 | HISTIGNORE="cd:df:pwd:[bf]g:exit:history" 346 | #+end_src 347 | 348 | Set the number of commands to remember, and the file size of =.bash_history=. 349 | 350 | #+begin_src shell 351 | HISTSIZE=10000 352 | HISTFILESIZE=1000000 353 | #+end_src 354 | 355 | Append to the history file, don't overwrite it. 356 | 357 | #+begin_src shell 358 | shopt -s histappend 359 | #+end_src 360 | 361 | Append and reload the history after each command, so the full history is available in all shells simultaneously. But watch out! If I'm being active in different shells at the same time then I need to be careful about which command reappears with . 362 | 363 | #+begin_src shell 364 | PROMPT_COMMAND="history -a; history -n" 365 | #+end_src 366 | 367 | **** Terminals 368 | 369 | Check the terminal window size after each command and, if necessary, update the values of LINES and COLUMNS. 370 | 371 | #+begin_src shell 372 | shopt -s checkwinsize 373 | #+end_src 374 | 375 | Puts wtd@hostname (or whatever) in the title bar of the terminal window. For it to change when you login to another machine, it needs to be in your =.bashrc= there too. Very handy when using tabs. 376 | 377 | #+begin_src shell 378 | if [ "$TERM" = 'xterm' ] || [ "$TERM" = 'rxvt' ] || [ "$TERM" = 'xterm-256color' ] 379 | then 380 | export PROMPT_COMMAND='echo -ne "\033]2;"`whoami`@`hostname -s`"\007"' 381 | fi 382 | #+end_src 383 | 384 | **** Solarized theme 385 | 386 | Apply a [[https://ethanschoonover.com/solarized/][Solarized]] theme to color ls listings. Taken from [[https://github.com/seebi/dircolors-solarized][dircolors-solarized]]. I'm using =dircolors.ansi-dark=. 387 | 388 | #+begin_src shell 389 | if command -v dircolors > /dev/null 2>&1 390 | then 391 | eval "$(dircolors ~/.dircolors.ansi-dark)" 392 | fi 393 | #+end_src 394 | 395 | # Also use solarized theme in GNOME terminal 396 | # See https://github.com/sigurdga/gnome-terminal-colors-solarized 397 | 398 | **** Prompt 399 | 400 | The [[https://xta.github.io/HalloweenBash/][Bash Profile Generator]] is very useful here. For colours, see also [[https://tldp.org/HOWTO/Bash-Prompt-HOWTO/x329.html][the colours section]] from this ancient [[https://tldp.org/HOWTO/Bash-Prompt-HOWTO/][Bash Prompt HOWTO]]. 401 | 402 | First, set a bunch of colours, some of which I don't use. 403 | 404 | #+begin_src shell 405 | RED="\[\033[0;31m\]" 406 | # LIGHT_RED="\[\033[1;31m\]" 407 | # YELLOW="\[\033[1;33m\]" 408 | GREEN="\[\033[0;32m\]" 409 | # LIGHT_GREEN="\[\033[1;32m\]" 410 | # CYAN="\[\033[0;36m\]" 411 | # LIGHT_CYAN="\[\033[1;36m\]" 412 | BLUE="\[\033[0;34m\]" 413 | # LIGHT_BLUE="\[\033[1;34m\]" 414 | PURPLE="\[\033[0;35m\]" 415 | OCHRE="\e[38;2;204;119;34m\]" ## RGB (204, 119, 34), see https://stackoverflow.com/a/26665998 416 | 417 | # WHITE='\e[0;37m' 418 | # LIGHT_GRAY="\[\033[0;37m\]" 419 | # GRAY="\[\033[1;30m\]" 420 | # BLACK="\[\033[0;30m\]" 421 | 422 | NO_COLOUR="\[\033[0m\]" 423 | #+end_src 424 | 425 | I use a blue prompt on my home machine(s), green on my hosted shell server, and red elsewhere. 426 | 427 | #+begin_src shell 428 | case $HOSTNAME in 429 | marcus) 430 | PROMPT_COLOUR=$BLUE 431 | ;; 432 | shell3) 433 | PROMPT_COLOUR=$GREEN 434 | ;; 435 | ochre) 436 | PROMPT_COLOUR=$OCHRE 437 | ;; 438 | ,*) 439 | PROMPT_COLOUR=$RED 440 | esac 441 | #+end_src 442 | 443 | Root is purple. 444 | 445 | #+begin_src shell 446 | if [[ ${EUID} == 0 ]] ; then 447 | PROMPT_COLOUR=$PURPLE 448 | fi 449 | #+end_src 450 | 451 | Now I can define the actual prompt. Note that =\$= is # if root, $ otherwise; it needs to be escaped. 452 | 453 | First a prompt I don't use, but it's good to keep as a reference. 454 | 455 | #+begin_example 456 | ┌─[07:47 PM]─[wtd@marcus:~] 457 | └─> $ 458 | #+end_example 459 | 460 | #+begin_src shell :tangle no 461 | export PS1="\342\224\214\342\224\200[\@]\342\224\200[\u@\h:\w]\n\342\224\224\342\224\200> \\$ " 462 | #+end_example 463 | 464 | Then the prompt I was using until I move this into Org. 465 | 466 | #+begin_example 467 | ┌─[marcus]─[~/src/conforguration/dotfiles] 468 | └─> $ 469 | #+end_example 470 | 471 | #+begin_src shell :tangle no 472 | PS1="\342\224\214\342\224\200[\h]\342\224\200[\w]\n\342\224\224\342\224\200> \\$ " 473 | #+end_src 474 | 475 | I simplified it a bit and discovered I can use Unicode characters instead of those ugly escape characters! 476 | 477 | #+begin_example 478 | ┌─[marcus]─[~/src/conforguration/dotfiles] 479 | └─$ 480 | #+end_example 481 | 482 | #+begin_src shell 483 | PROMPT="┌─[\h]─[\w]\n└─\\$ " 484 | #+end_src 485 | 486 | Set the prompt to be the colour I want. 487 | 488 | #+begin_src shell 489 | PS1="${PROMPT_COLOUR}${PROMPT}${NO_COLOUR}" 490 | #+end_src 491 | 492 | Glue the prompt to always go to the first column ([[https://jonisalonen.com/2012/your-bash-prompt-needs-this/][source]]). 493 | 494 | #+begin_src shell 495 | PS1="\[\033[G\]$PS1" 496 | #+end_src 497 | 498 | If I'm in a dumb terminal (when does that happen?) then use a very basic prompt. 499 | 500 | #+begin_src shell 501 | if [[ "$TERM" == "dumb" ]] ; then 502 | PS1="$ " 503 | fi 504 | #+end_src 505 | 506 | Do I ever see a secondary prompt? I'm not sure. 507 | 508 | #+begin_src shell 509 | PS2="${PROMPT_COLOUR}\342\224\224> ${NO_COLOUR}" 510 | #+end_src 511 | 512 | **** Key remapping 513 | 514 | I used to need to remap some keys on my Lenovo X240, but whatever the problem was, I figured it out some other way, so this isn't needed. 515 | 516 | #+begin_src shell :tangle no 517 | if [ -f ~/.Xmodmap ]; then 518 | xmodmap ~/.Xmodmap 519 | fi 520 | #+end_src 521 | 522 | **** Command aliases 523 | 524 | Use colours when grepping. 525 | 526 | #+begin_src shell 527 | export GREP_COLORS='mt=1;37;44' 528 | alias grep='grep --color=auto' 529 | #+end_src 530 | 531 | Automatically page results from ~ag~ with ~less~ (see its options for how it works). 532 | 533 | #+begin_src shell 534 | alias ag='\ag --pager=less' 535 | #+end_src 536 | 537 | Call up LibreOffice with just =o file=. 538 | 539 | #+begin_src shell 540 | alias o='libreoffice' 541 | #+end_src 542 | 543 | Open up [[https://alpine.x10host.com/][Alpine]] and go right to the inbox. 544 | 545 | #+begin_src shell 546 | alias pi='alpine -i' 547 | #+end_src 548 | 549 | Be polite. 550 | 551 | #+begin_src shell 552 | alias please='sudo' 553 | #+end_src 554 | 555 | In case =rm -i= is set system-wide. 556 | 557 | #+begin_src shell 558 | alias rm="rm" 559 | #+end_src 560 | 561 | Always preserve timestamps when using =scp=. 562 | 563 | #+begin_src shell 564 | alias scp="scp -p" 565 | #+end_src 566 | 567 | Get the weather with [[https://github.com/chubin/wttr.in][wttr.in]]. 568 | 569 | #+begin_src shell 570 | alias ww="curl https://wttr.in/yyz" 571 | #+end_src 572 | 573 | Open any file in the default application with just =x file=. 574 | 575 | #+begin_src shell 576 | alias x='xdg-open' 577 | #+end_src 578 | 579 | Don't show snaps in =df= listings. They use a particular file system, which can be excluded. 580 | 581 | #+begin_src shell 582 | alias df='df -x "squashfs"' 583 | #+end_src 584 | 585 | Set up =fd= (which on Ubuntu is used by another application) for [[https://github.com/sharkdp/fd][fd]] the replacement for =find=. 586 | 587 | #+begin_src shell 588 | alias fd='fdfind' 589 | #+end_src 590 | 591 | **** ls 592 | 593 | Count in proper kilobytes. 594 | 595 | #+begin_src shell 596 | export BLOCKSIZE=1024 597 | #+end_src 598 | 599 | Generally I'm on Linux machines, but if I'm on a FreeBSD box it has a different ls with different options, so I need to use a different alias to get colours. 600 | 601 | On the Linux boxes: 602 | 603 | + classify: "append indicator (one of */=>@|) to entries" (to indicate directories, symlinks, etc.) 604 | + color: make the output in color (always) 605 | + quoting-style: show filenames as they are, so =File One.txt=, not ='File One.txt'= or =File\ One.txt=. I'll put things in quotes if needed. 606 | 607 | #+begin_src shell 608 | if [[ $(uname) == "FreeBSD" ]] ; then 609 | alias ls='ls -F -G' 610 | else # Presumably Linux 611 | alias ls='ls --classify --color --quoting-style=literal' 612 | fi 613 | #+end_src 614 | 615 | Various short forms so I never have to actually type both letters of =ls=. 616 | 617 | #+begin_src shell 618 | alias l='ls' 619 | alias la='l --all' 620 | alias ll='l -l' 621 | alias lla='l -l --all' 622 | alias lsort='l -l -S --reverse' 623 | #+end_src 624 | 625 | **** w 626 | 627 | Make =w= columns wider (very useful for hostnames). 628 | 629 | #+begin_src shell 630 | export PROCPS_FROMLEN=40 631 | export PROCPS_USERLEN=12 632 | #+end_src 633 | 634 | **** More or less 635 | 636 | I always want to use =less=, but I'm used to typing =more=. 637 | 638 | #+begin_src shell 639 | alias more='less' 640 | alias mroe='more' 641 | export PAGER=less 642 | #+end_src 643 | 644 | There is no =.lessrc=, so settings go in the =LESS= environment variable. ([[https://www.topbug.net/blog/2016/09/27/make-gnu-less-more-powerful/][Source]].) 645 | 646 | + quit-if-one-screen: if it all fits on screen, just show it and quit 647 | + ignore-case: search are case-insensitive unless a capital letter is used 648 | + status-column: show matches or where paging happened 649 | + LONG_PROMPT: more verbose prompt 650 | + RAW-CONTROL-CHARS: pass through raw ANSI colour escape sequences so colourizing can work 651 | + HILITE-UNREAD: indicate first unread line after scrolling 652 | + tabs=4: show a tab as four spaces 653 | + no-init: don't clear screen after exiting; quit-if-one-screen needs this to be set 654 | + window=-4: scroll by window size minus 4 lines, so there's overlap when scrolling 655 | 656 | Pass through raw ANSI colour escape sequences. In other words, make colourizing work. 657 | 658 | #+begin_src shell 659 | export LESS='--quit-if-one-screen --ignore-case --status-column --LONG-PROMPT --RAW-CONTROL-CHARS --HILITE-UNREAD --tabs=4 --no-init --window=-4' 660 | #+end_src 661 | 662 | =Lessfile= lets =less= open up tarred and gzipped files and so on and show what's inside. If it's not installed, fall back to a script I wrote myself (see Lessfilter section below). 663 | 664 | #+begin_src shell 665 | if command -v lessfile > /dev/null 2>&1; then 666 | eval "$(lessfile)" 667 | # This sets LESSOPEN and will pick up on ~/.lessfilter. 668 | else 669 | # Fall back to do the best we can. 670 | export LESSOPEN="| ~/.lessfilter %s" 671 | fi 672 | #+end_src 673 | 674 | If any syntax highlighters are available, use them. =Pygmentize= does more, but =source-highlight= is still good. 675 | 676 | #+begin_src shell 677 | if command -v pygmentize > /dev/null 2>&1; then 678 | export LESSCOLOURIZER="pygmentize -f terminal" 679 | elif command -v source-highlight > /dev/null 2>&1; then 680 | export LESSCOLOURIZER="source-highlight --failsafe --infer-lang -f esc --style-file=esc.style -i" 681 | fi 682 | #+end_src 683 | 684 | **** Small functions and helpers 685 | 686 | Pretty-print directory tree. I never use this, but it could be useful as a reference. 687 | 688 | #+begin_src shell 689 | function tree() { 690 | find "${1:-.}" -type d -print | sed -e 's:[ ]*/:|____:g;s:____|: |:g' 691 | } 692 | #+end_src 693 | 694 | Set an "alert" alias for long running commands. Use like this: =sleep 10; alert=. 695 | 696 | #+begin_src shell 697 | alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"' 698 | #+end_src 699 | 700 | Swap file $1 with $2. 701 | 702 | #+begin_src shell 703 | function swap() { 704 | local TMPFILE=tmp.$$ 705 | mv "$1" $TMPFILE 706 | mv "$2" "$1" 707 | mv $TMPFILE "$2" 708 | } 709 | #+end_src 710 | 711 | Handy way to watch a file grow 712 | 713 | #+begin_src shell 714 | function monitor() { 715 | while true ; do 716 | clear 717 | tail "$1" 718 | sleep 10 719 | done 720 | } 721 | #+end_src 722 | 723 | "| order" is very handy for counting duplicated lines in a file or listing. 724 | 725 | #+begin_src shell 726 | function order() { 727 | sort | uniq -c | sort -rn 728 | } 729 | #+end_src 730 | 731 | Wipe all metadata from one or more images. 732 | 733 | #+begin_src shell 734 | function wipe_image() { 735 | for FILE in "$@"; do 736 | exiftool -all= "$FILE" 737 | done 738 | } 739 | #+end_src 740 | 741 | Wipe all metadata from one or more PDFs. 742 | 743 | #+begin_src shell 744 | function wipe_pdf() { 745 | for FILE in "$@"; do 746 | exiftool -all= "$FILE" 747 | qpdf --linearize --replace-input "$FILE" 748 | done 749 | } 750 | #+end_src 751 | 752 | Sum a list of numbers. 753 | 754 | #+begin_src shell 755 | function colsum { 756 | paste -s -d+ | bc -- 757 | } 758 | #+end_src 759 | 760 | #+begin_example 761 | $ (echo 1; echo 3; echo 5) | colsum 762 | 9 763 | #+end_example 764 | 765 | Copy files from somewhere to here, preserving all metadata (timestamp and such) as is. 766 | 767 | #+begin_src shell 768 | function get { 769 | rsync --archive --progress --human-readable "$@" . 770 | } 771 | #+end_src 772 | 773 | Repeat a command n times, for example ~repeat 5 echo "Hello"~ . When repeating multiple commands use quoting to make sure parts don't get lost, for example ~repeat 5 echo "Hello" ";" echo "Goodbye"~. 774 | 775 | #+begin_src shell 776 | function repeat(){ 777 | for ((i=0; i < $1; i++)); do 778 | eval ${*:2} 779 | done 780 | } 781 | #+end_src 782 | 783 | **** Completions 784 | 785 | Git. Can be found as part of Git source. 786 | 787 | #+begin_src shell 788 | source ~/.git-completion.bash 789 | #+end_src 790 | 791 | Bash. Requires bash-completion package. 792 | 793 | #+begin_src shell 794 | if [ -f /etc/bash_completion ] && ! shopt -oq posix; then 795 | source /etc/bash_completion 796 | fi 797 | #+end_src 798 | 799 | **** PATH 800 | 801 | Here I build up the PATH bit by bit. Put =/usr/local/bin= first (ahead of whatever is inherited from the system setting). 802 | 803 | #+begin_src shell 804 | PATH=/usr/local/bin:$PATH 805 | #+end_src 806 | 807 | Make sure the rootly paths are there. 808 | 809 | #+begin_src shell 810 | PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin 811 | #+end_src 812 | 813 | Emacs is run from source in =/usr/local/src/emacs=. 814 | 815 | #+begin_src shell 816 | PATH=/usr/local/src/emacs/src:$PATH 817 | alias emacsclient="/usr/local/src/emacs/lib-src/emacsclient" 818 | alias e="emacsclient --no-wait" 819 | #+end_src 820 | 821 | I run R from source in =/usr/local/src/R=. 822 | 823 | #+begin_src shell 824 | if [ -f /usr/local/src/R/R ] ; then 825 | PATH=/usr/local/src/R:$PATH 826 | fi 827 | #+end_src 828 | 829 | Zotero needs to be [[https://www.zotero.org/support/installation][installed]] by hand. 830 | 831 | #+begin_src shell 832 | alias zotero="/usr/local/src/zotero/Zotero_linux-x86_64/zotero" 833 | #+end_src 834 | 835 | I put ircii's irc in ~/.irc/. 836 | 837 | #+begin_src shell 838 | PATH=$PATH:~/.irc/ 839 | #+end_src 840 | 841 | Ruby: I use [[https://github.com/rbenv/rbenv][rbenv]] to handle Ruby. If rbenv isn't there, it will default to the system Ruby. 842 | 843 | #+begin_src shell 844 | if [ -d ~/.rbenv/ ] ; then 845 | PATH=$HOME/.rbenv/bin:$PATH 846 | eval "$(rbenv init -)" 847 | fi 848 | #+end_src 849 | 850 | Go (=go help gopath=). 851 | 852 | #+begin_src shell 853 | export GOPATH=~/.gopath 854 | PATH=$PATH:$GOPATH/bin/ 855 | #+end_src 856 | 857 | Pip (from Python). 858 | 859 | #+begin_src shell 860 | PATH=$PATH:~/.local/bin/ 861 | #+end_src 862 | 863 | Rust. 864 | 865 | #+begin_src shell 866 | PATH=$PATH:~/.cargo/bin/ 867 | #+end_src 868 | 869 | My own scripts, and finally, the current directory. 870 | 871 | #+begin_src shell 872 | PATH=$PATH:~/bin/:. 873 | #+end_src 874 | 875 | **** Local settings 876 | 877 | There are some settings that I want just on a particular machine, and this makes that possible. If the machine is named =dartagnan=, put machine-specific environment variables and settings in =~/.bash.dartagnan.rc=. 878 | 879 | #+begin_src shell 880 | if [ -f ~/.bash."$HOSTNAME".rc ] ; then 881 | . ~/.bash.$HOSTNAME.rc 882 | fi 883 | #+end_src 884 | 885 | *** Dircolors (=dircolors.ansi-dark=) (imported) 886 | 887 | https://github.com/seebi/dircolors-solarized/blob/master/dircolors.ansi-dark 888 | 889 | "Solarized Color Theme for GNU ls (as setup by GNU dircolors)" 890 | 891 | https://github.com/seebi/dircolors-solarized 892 | 893 | Raw source: [[https://raw.githubusercontent.com/seebi/dircolors-solarized/master/dircolors.ansi-dark][dircolors.ansi-dark]]. 894 | 895 | I added a line at the bottom to make directories lighter: =DIR 00;38;5;33=. 896 | 897 | Imported copy: [[file:conforg/dotfiles/imported/dircolors.ansi-dark][conforg/dotfiles/imported/dircolors.ansi-dark]]. 898 | 899 | *** Logout (=.bash_logout=) 900 | :PROPERTIES: 901 | :header-args: :tangle conforg/dotfiles/mine/bash_logout 902 | :END: 903 | 904 | "When an interactive login shell exits, or a non-interactive login shell executes the exit builtin command, bash reads and executes commands 905 | from the file =~/.bash_logout=, if it exists," says the =bash= man page. 906 | 907 | The only command I have here is one I pasted in from I don't know where. It clears the console when I log out, for privacy. It's been years since I logged in through a console to run X, but who knows. 908 | 909 | =SHLVL= is "incremented by one each time an instance of =bash= is started," so this runs if the shell being exited is not a sub-shell of another. 910 | 911 | #+begin_src shell 912 | if [ "$SHLVL" = 1 ]; then 913 | [ -x /usr/bin/clear_console ] && /usr/bin/clear_console -q 914 | fi 915 | #+end_src 916 | 917 | *** ShellCheck (=.shellcheckrc=) 918 | :PROPERTIES: 919 | :header-args: :tangle conforg/dotfiles/mine/shellcheckrc 920 | :END: 921 | 922 | There is one directive I want to [[https://github.com/koalaman/shellcheck/wiki/Ignore][ignore]] when [[https://www.shellcheck.net/][ShellCheck]] runs on a script: "Double quote to prevent globbing and word splitting" (SC2086). That's because syntax highlighting in Emacs treats =$VAR= as a variable and colours it nicely, but ="$VAR"= is handled differently and not coloured, so I leave variables unquoted as much as possible, but I have to be careful about whitespace. 923 | 924 | #+begin_src shell 925 | disable=SC2086 926 | #+end_src 927 | 928 | ** Git 929 | 930 | *** Completion (imported) 931 | 932 | https://github.com/git/git/blob/master/contrib/completion/git-completion.bash 933 | 934 | *** Config (=.gitconfig=) 935 | :PROPERTIES: 936 | :header-args: :tangle conforg/dotfiles/mine/gitconfig 937 | :END: 938 | 939 | TODO: Expand on what all this means. Find a better way to handle the editor for cases where I'm on a remote server without Emacs running. 940 | 941 | #+begin_src gitconfig 942 | [include] 943 | path = ~/.gitconfig.local 944 | [color] 945 | ui = auto 946 | pager = true 947 | [column] 948 | ui = auto 949 | [core] 950 | editor = emacsclient 951 | [user] 952 | name = William Denton 953 | email = william@williamdenton.org 954 | [push] 955 | default = current 956 | [init] 957 | defaultBranch = main 958 | [alias] 959 | hist = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all 960 | #+end_src 961 | 962 | ** LaTeX 963 | 964 | *** ChkTeX (=.chktexrc=) (imported) 965 | 966 | [[https://www.nongnu.org/chktex/][ChkTex]] is linter for LaTeX. I think it complained about not having a configuration file when I first ran it, so I copied the default. 967 | 968 | TODO: did i tweak anything? investigate. for now, since it's so long and complicated, just leave it here. 969 | 970 | Raw source: [[http://git.savannah.nongnu.org/cgit/chktex.git/plain/chktex/chktexrc][chktexrc]]. 971 | 972 | Imported copy: [[file:conforg/dotfiles/imported/chktexrc][conforg/dotfiles/imported/chktexrc]]. 973 | 974 | ** Less 975 | 976 | *** Lessfilter (=.lessfilter=) 977 | :PROPERTIES: 978 | :header-args: :tangle conforg/dotfiles/mine/lessfilter :shebang "#!/bin/bash" 979 | :END: 980 | 981 | See [[*More or less][More or less]] above for where this fits in to the =less= configuration. This short script enables pre-processing of files before =less= displays them, which allows syntax highlighting and even extracting text from PDFs. It's pretty amazing when you can run =less foo.pdf= and see what's in the PDF as plain text. 982 | 983 | There are some requirements for this to work: 984 | 985 | + [[https://pygments.org/][Pygments]] (see what it can handle with =pygmentize -L lexers=) 986 | + [[https://www.gnu.org/software/src-highlite/][GNU source-highlight]] 987 | + [[https://poppler.freedesktop.org/][Poppler]] (for =pdftotext=) 988 | 989 | To install them on Ubuntu, run this: 990 | 991 | #+begin_src shell :tangle no 992 | sudo apt install python-pygments source-highlight poppler-utils 993 | #+end_src 994 | 995 | =LESSCOLOURIZER= is defined in =.bashrc=. It will be either =pygmentize= (preferred) or =source-highlight= (fallback, if it's installed). Whichever is available, use it for everything except PDFs, where we use =pdftotext=. 996 | 997 | This case statement defines which program handles which file types. Pygmentize can handle many more than are here; this is just the ones I want. My =.bashrc= doesn't get processed correctly, maybe because of escape sequences, so I left it out. 998 | 999 | #+begin_src shell 1000 | if [ -v LESSCOLOURIZER ]; then 1001 | case "$1" in 1002 | .bash_|*.bat|*.bib|*.c|Changelog|*.diff|Gemfile|*.gemspec|*.h|*.html|*.ini|*.js|*.json|*.jsonld|\ 1003 | Makefile|*.md|*.patch|*.php|*.pl|*.pm|*.py|Rakefile|*.rake|*.rb|*.R|*.Rprofile|*.rss|*.sh|*.sql|*.xsl|*.tex|*.toc|*.yaml|*.yml) 1004 | $LESSCOLOURIZER "$1" ;; 1005 | ,*.pdf) 1006 | if command -v pdftotext > /dev/null 2>&1 ; then pdftotext -layout "$1" - 1007 | else echo "No pdftotext available; try installing poppler-utils"; fi ;; 1008 | ,*) 1009 | # Pass through to lessfile 1010 | exit 1 1011 | esac; 1012 | fi 1013 | #+end_src 1014 | 1015 | Finally, if =LESSCOLOURIZER= is not set, hand off to =lessfile=. 1016 | 1017 | #+begin_src shell 1018 | exit 1 1019 | #+end_src 1020 | 1021 | ** Nano 1022 | 1023 | *** Config (=.nanorc=) 1024 | :PROPERTIES: 1025 | :header-args: :tangle conforg/dotfiles/mine/nanorc 1026 | :END: 1027 | 1028 | #+begin_src nano 1029 | set fill -8 1030 | set nonewlines 1031 | set nowrap 1032 | set softwrap 1033 | #+end_src 1034 | 1035 | ** R 1036 | 1037 | [[https://www.r-project.org/][R]]'s web site says it "is a free software environment for statistical computing and graphics," which doesn't adequately describe how awesome it is. I mainly use R through Emacs, but there are some settings that apply just to how R works that I want defined however R is run. 1038 | 1039 | *** Rprofile (=.Rprofile=) 1040 | :PROPERTIES: 1041 | :header-args: :tangle conforg/dotfiles/mine/Rprofile 1042 | :END: 1043 | 1044 | See also [[https://stackoverflow.com/q/1189759/854346][Expert R users, what's in your .Rprofile?]] from Stack Overflow. 1045 | 1046 | First, hard code a nearby (to me) repo for [[https://cran.r-project.org/][CRAN]] packages. 1047 | 1048 | TODO: The mirror is also used in [[file:~/src/conforguration/conforguration.org::*Setup: R][Setup: R]] ... maybe I could put it into a bash environment variable in one place and get all the mentions from there? 1049 | 1050 | #+begin_src R 1051 | r <- getOption("repos") 1052 | r["CRAN"] <- c("https://mirror.csclub.uwaterloo.ca/CRAN/") 1053 | options(repos = r) 1054 | rm(r) 1055 | #+end_src 1056 | 1057 | I don't need to keep histories of everything. I used to log everything to history files but never looked at them and discovered after a while that the directory was filled with 0-byte files. I'll leave in the command to do that in case it's useful again one day. 1058 | 1059 | #+begin_src R 1060 | Sys.setenv(R_HISTSIZE = '0') 1061 | ## sink(file = paste('~/R/history/r-log-', strftime(Sys.time(), '%F %H:%M:%OS9'), sep = ''), split=T) 1062 | #+end_src 1063 | 1064 | Should R automatically convert strings to factor variables in a data.frame? No! This is the default in 4.0 and up, but I'll leave it in for now. 1065 | 1066 | #+begin_src R 1067 | options(stringsAsFactors = FALSE) 1068 | #+end_src 1069 | 1070 | Override =q()= to not save by default. Same as saying =q("no")=. 1071 | 1072 | #+begin_src R 1073 | q <- function (save="no", ...) { 1074 | quit(save=save, ...) 1075 | } 1076 | #+end_src 1077 | 1078 | No menu popups: use the console. 1079 | 1080 | #+begin_src R 1081 | options(menu.graphics = FALSE) 1082 | #+end_src 1083 | 1084 | Tab completion on =library()= and =require()=. 1085 | 1086 | #+begin_src R 1087 | utils::rc.settings(ipck = TRUE) 1088 | #+end_src 1089 | 1090 | Set the prompt? I used to use a fancy "ℝ", but now just the default simple ">". But I'll leave this here in case I want to go back. 1091 | 1092 | #+begin_src R 1093 | ## options(prompt="ℝ> ") 1094 | #+end_src 1095 | 1096 | Specify the precise location of lintr configuration file. It should look in my home directory by default, but it wasn't. 1097 | 1098 | #+begin_src R 1099 | options(lintr.linter_file="~/.lintr") 1100 | #+end_src 1101 | 1102 | *** lintr (=.lintr=) 1103 | :PROPERTIES: 1104 | :header-args: :tangle conforg/dotfiles/mine/lintr 1105 | :END: 1106 | 1107 | In my world tabs are four spaces, so I need to specify this for [[https://github.com/r-lib/lintr][lintr]], which thinks they should be two (!?). 1108 | 1109 | #+begin_src R 1110 | linters: linters_with_defaults( 1111 | indentation_linter = indentation_linter(4L) 1112 | ) 1113 | encoding: "UTF-8" 1114 | #+end_src 1115 | 1116 | ** Ruby 1117 | 1118 | *** Gems (=.gemrc=) 1119 | :PROPERTIES: 1120 | :header-args: :tangle conforg/dotfiles/mine/gemrc 1121 | :END: 1122 | 1123 | #+begin_src yaml 1124 | --- 1125 | :verbose: true 1126 | :benchmark: false 1127 | :bulk_threshold: 1000 1128 | :update_sources: true 1129 | :backtrace: false 1130 | gem: --no-document 1131 | #+end_src 1132 | 1133 | *** Pry (=.pryrc=) 1134 | :PROPERTIES: 1135 | :header-args: :tangle conforg/dotfiles/mine/pryrc 1136 | :END: 1137 | 1138 | [[https://pry.github.io/][Pry]] "is a powerful alternative to the standard IRB shell for Ruby. It features syntax highlighting, a flexible plugin architecture, runtime invocation and source and documentation browsing." See also the [[https://github.com/pry/pry/wiki/Pry-rc][pryrc documentation]]. 1139 | 1140 | The only setting here is to hook in [[https://github.com/awesome-print/awesome_print][awesome_print]] so that by default everything is nicely pretty-printed. 1141 | 1142 | #+begin_src ruby 1143 | require "awesome_print" 1144 | AwesomePrint.pry! 1145 | #+end_src 1146 | 1147 | *** Rubocop (=.rubocop.yml=) 1148 | :PROPERTIES: 1149 | :header-args: :tangle conforg/dotfiles/mine/rubocop.yml 1150 | :END: 1151 | 1152 | [[https://github.com/rubocop/rubocop/][Rubocop]] "is a Ruby static code analyzer (a.k.a. linter) and code formatter." 1153 | 1154 | I prefer using "double quotes" when quoting. Everything else I leave as is. When needed I can turn off a warning in the code itself. 1155 | 1156 | #+begin_src yaml 1157 | Style/StringLiterals: 1158 | EnforcedStyle: double_quotes 1159 | SupportedStyles: 1160 | - single_quotes 1161 | - double_quotes 1162 | 1163 | AllCops: 1164 | NewCops: enable 1165 | #+end_src 1166 | 1167 | ** Signature 1168 | 1169 | *** Personal (=.signature=) 1170 | :PROPERTIES: 1171 | :header-args: :tangle conforg/dotfiles/mine/signature 1172 | :END: 1173 | 1174 | This is my personal sig. 1175 | 1176 | #+begin_src text 1177 | -- 1178 | William Denton 1179 | https://www.miskatonic.org/ 1180 | Librarian, artist and licensed private investigator. 1181 | Toronto, Canada 1182 | #+end_src 1183 | 1184 | *** Work (=.signature.work=) 1185 | :PROPERTIES: 1186 | :header-args: :tangle conforg/dotfiles/mine/signature.work 1187 | :END: 1188 | 1189 | This is the sig I use at work. 1190 | 1191 | #+begin_src text 1192 | William Denton (he/him) 1193 | Associate Librarian: Scholarly Analytics / Mathematics & Statistics 1194 | York University (Toronto, Canada) https://www.library.yorku.ca/ 1195 | #+end_src 1196 | 1197 | ** SQLite 1198 | 1199 | *** Config (=.sqliterc=) 1200 | :PROPERTIES: 1201 | :header-args: :tangle conforg/dotfiles/mine/sqliterc 1202 | :END: 1203 | 1204 | #+begin_src sqlite 1205 | .headers on 1206 | .mode column 1207 | #+end_src 1208 | 1209 | ** Tmux 1210 | 1211 | *** Config (=.tmux.conf=) 1212 | :PROPERTIES: 1213 | :header-args: :tangle conforg/dotfiles/mine/tmux.conf 1214 | :END: 1215 | 1216 | Start window numbering at 1. 1217 | 1218 | #+begin_src tmux 1219 | set -g base-index 1 1220 | #+end_src 1221 | 1222 | Status bar formatting. 1223 | 1224 | #+begin_src tmux 1225 | set -g status-left-length 20 1226 | set -g status-left "" 1227 | set -g status-right "[Session: #S]" 1228 | set -g status-justify centre 1229 | #+end_src 1230 | 1231 | Colours, taken from [[https://github.com/seebi/tmux-colors-solarized][tmux-colors-solarized]]. First, set the terminal type. 1232 | 1233 | #+begin_src tmux 1234 | set -g default-terminal "screen-256color" 1235 | #+end_src 1236 | 1237 | Default statusbar colors. 1238 | 1239 | #+begin_src tmux 1240 | set-option -g status-bg black 1241 | set-option -g status-fg yellow 1242 | #+end_src 1243 | 1244 | Pane number display. 1245 | 1246 | #+begin_src tmux 1247 | set-option -g display-panes-active-colour blue 1248 | set-option -g display-panes-colour brightred 1249 | #+end_src 1250 | 1251 | Clock. 1252 | 1253 | #+begin_src tmux 1254 | set-window-option -g clock-mode-colour green 1255 | #+end_src 1256 | Bell. 1257 | 1258 | #+begin_src tmux 1259 | set-window-option -g window-status-bell-style fg=black,bg=red 1260 | #+end_src 1261 | 1262 | ** X 1263 | 1264 | *** XCompose (=.XCompose=) 1265 | :PROPERTIES: 1266 | :header-args: :tangle conforg/dotfiles/mine/XCompose 1267 | :END: 1268 | 1269 | This allows the Compose key (for me Left-Ctrl, because I use CapLock as the Control key) to be used in Emacs. 1270 | 1271 | #+begin_src XCompose 1272 | include "%L" 1273 | #+end_src 1274 | 1275 | (See also this [[https://github.com/kragen/xcompose][xcompose]] project at GitHub that has a massive .XCompose file with and an enormous set of key combinations. More than I need right now, but maybe one day.) 1276 | 1277 | *** Xmodmap (=.xmodmaprc=) 1278 | :PROPERTIES: 1279 | :header-args: :tangle conforg/dotfiles/mine/xmodmaprc 1280 | :END: 1281 | 1282 | Do I actually need this? I'm not loading it in. Is it being caught automatically? 1283 | 1284 | TODO: Try disabling it and see what happens. 1285 | 1286 | #+begin_src xmodmap 1287 | keysym Home = Insert 1288 | keysym End = Insert 1289 | #+end_src 1290 | 1291 | * Emacs 1292 | 1293 | ** Requirements 1294 | 1295 | You can't build anything from source without making sure all the necessary utilities and libraries are there first. Once done, this will never need to be run again. (Unless the version of GCC changes, in which case a new =libgccjit-xx-dev= will be needed. Check the current version with ~gcc --version~.) These requirements go beyond the bare minimum in order to make native compilation work (on Ubuntu 22.04). 1296 | 1297 | #+begin_src shell :tangle conforg/scripts/emacs-install-requirements.sh :shebang "#!/bin/bash" 1298 | sudo apt-get build-dep emacs 1299 | sudo apt-get install libjansson-dev valgrind fonts-firacode libgccjit0 libgccjit-11-dev libgtk-3-dev 1300 | ## On Linux Mint, at least, these are not installed when the above is done. Curious. 1301 | ## On other systems, it can't hurt. 1302 | sudo apt-get install texinfo libxpm-dev libjpeg-dev libgif-dev libtiff-dev libtinfo-dev libtree-sitter-dev 1303 | #+end_src 1304 | 1305 | # In 2022 I made this note, but I don't know why. 1306 | # $ sudo apt install libgccjit0 libgccjit-10-dev gcc-10 g++-10 1307 | 1308 | ** Install for personal use 1309 | 1310 | First get the source for Emacs and compile it. 1311 | 1312 | #+begin_src shell :tangle conforg/scripts/emacs-install-personal.sh :shebang "#!/bin/bash" 1313 | cd /usr/local/src/ 1314 | git clone https://git.savannah.gnu.org/git/emacs.git 1315 | cd emacs 1316 | ./autogen.sh 1317 | ./configure --with-pgtk --with-tree-sitter && make -j 1318 | #+end_src 1319 | 1320 | Then do the same for Org. 1321 | 1322 | #+begin_src shell :tangle conforg/scripts/emacs-install-personal.sh :shebang "#!/bin/bash" 1323 | cd /usr/local/src/ 1324 | git clone https://git.savannah.gnu.org/git/emacs/org-mode.git 1325 | cd org-mode 1326 | make -j 1327 | #+end_src 1328 | 1329 | Finally, get my Emacs configuration (which is not here in Conforguration). It will be cloned into =~/.emacs.d/=. (Requires a GitHub account when done this way.) 1330 | 1331 | #+begin_src shell :tangle conforg/scripts/emacs-install-personal.sh :shebang "#!/bin/bash" 1332 | cd 1333 | git clone git@github.com:wdenton/.emacs.d.git 1334 | # Or if you don't want to use a GitHub account: 1335 | # git clone https://github.com/wdenton/.emacs.d.git 1336 | echo "Now run emacs, and say no when asked about a location for abbrev_defs." 1337 | #+end_src 1338 | 1339 | Running ~emacs~ the first time will download and install all the packages needed, but some setting about =abbrevs= is misordered so it will ask a question it doesn't need to ask. Saying no makes everything work. 1340 | 1341 | It's probably best to quit Emacs and restart after this, but you don't actually need to. 1342 | 1343 | ** Update 1344 | 1345 | This is a simple script that pulls down the updated source for Emacs and Org and compiles them. If something goes wrong with the Emacs compile you might need to do ~make clean~ or ~make distclean~ or ~make extraclean~ and then try again. 1346 | 1347 | If there are compilation problems then running ~make maintainer-clean~ in the Emacs source directory will probably fix it by resetting everything. I find I need to do this every few months. 1348 | 1349 | #+begin_src shell :tangle conforg/scripts/emacs-update.sh :shebang "#!/bin/bash" 1350 | cd /usr/local/src/emacs/ 1351 | git pull 1352 | ./configure --with-pgtk --with-tree-sitter && make -j && cd ../org-mode/ && make -j update 1353 | #+end_src 1354 | 1355 | * R 1356 | 1357 | For running a personal version of R, ~PATH~ needs to include ~/usr/local/src/R~, but my bashrc will set that up if it's there. 1358 | 1359 | Change the version number as needed, then tangle and run the install script again. 1360 | 1361 | #+NAME: R_VERSION 1362 | | 4.4.2 | 1363 | 1364 | ** Requirements 1365 | 1366 | The first line of requirements may be needed for R 3.3. The ~topicmodels~ package requires the GNU Scientific Library. Once done, this doesn't need to be run again. Sync and run the script on machines as necessary. 1367 | 1368 | #+begin_src shell :tangle conforg/scripts/r-install-requirements.sh :shebang "#!/bin/bash" 1369 | sudo apt install libbz2-dev liblzma-dev libxml2-dev libpcre2-dev libpcre3-dev fonts-inconsolata 1370 | sudo apt install xorg-dev gfortran libreadline-dev libcurl4-openssl-dev libssl-dev libgsl-dev curl libcurl4-openssl-dev libudunits2-dev libgdal-dev 1371 | sudo apt build-dep r-base 1372 | mkdir -p ~/R/history/ 1373 | mkdir -p ~/.R/lintr_cache/ 1374 | mkdir -p /usr/local/src/R 1375 | #+end_src 1376 | 1377 | ** Noweb setup 1378 | 1379 | Whether R is being installed system-wide or just for personal use, this code will be run. 1380 | 1381 | #+begin_src shell :noweb-ref r_source_code_present_and_compiled 1382 | cd $(dirname "$0") 1383 | SCRIPTS_DIR=$(pwd) 1384 | MIRROR="https://mirror.csclub.uwaterloo.ca/CRAN/" 1385 | cd /usr/local/src/R 1386 | #+end_src 1387 | 1388 | If the source has been untarred already, wipe that directory because we want to start fresh. 1389 | 1390 | #+begin_src shell :noweb-ref r_source_code_present_and_compiled 1391 | if [ -d "/usr/local/src/R/R-${R_VERSION}" ]; then 1392 | echo "Removing old source directory ..." 1393 | rm -r R-${R_VERSION} 1394 | fi 1395 | #+end_src 1396 | 1397 | If the source tarball is there, use it, otherwise download. The =R_MAJOR= variable is there because we need to know the major version number, so we can get to e.g. base/R-4 to download 4.0.4. 1398 | 1399 | #+begin_src shell :noweb-ref r_source_code_present_and_compiled 1400 | if ! [ -f "R-${R_VERSION}.tar.gz" ]; then 1401 | echo "Downloading R-${R_VERSION} tarball ..." 1402 | R_MAJOR=${R_VERSION:0:1} 1403 | curl -O $MIRROR/src/base/R-${R_MAJOR}/R-${R_VERSION}.tar.gz 1404 | else 1405 | echo "Using existing R-${R_VERSION} tarball ..." 1406 | fi 1407 | #+end_src 1408 | 1409 | Now uncompress, configure and compile. This could take a while. 1410 | 1411 | #+begin_src shell :noweb-ref r_source_code_present_and_compiled 1412 | echo "Uncompressing ..." 1413 | tar xzvf R-$R_VERSION.tar.gz 1414 | 1415 | echo "Compiling ..." 1416 | cd R-$R_VERSION 1417 | ./configure --enable-R-shlib 1418 | make -j && make -j check 1419 | #+end_src 1420 | 1421 | ** Install for personal use 1422 | 1423 | Here we set up symlinks to point to the ~R~ and ~Rscript~ executables, then source ~.bashrc~ to refresh ~$PATH~ to notice them and put that ~Rscript~ first, which makes the package installation work. 1424 | 1425 | First, get R downloaded and compiled. 1426 | 1427 | #+begin_src shell :tangle conforg/scripts/r-install-personal.sh :shebang "#!/bin/bash" :noweb yes :var R_VERSION=R_VERSION 1428 | <> 1429 | #+end_src 1430 | 1431 | Next, set up the aliases for it in =/usr/local/src/R/=. To be sure they work, reload bash to pick up on the PATH. 1432 | 1433 | #+begin_src shell :tangle conforg/scripts/r-install-personal.sh :shebang "#!/bin/bash" :noweb yes :var R_VERSION=R_VERSION 1434 | cd /usr/local/src/R/ 1435 | rm -f R Rscript 1436 | ln -s R-${R_VERSION}/bin/R R 1437 | ln -s R-${R_VERSION}/bin/Rscript Rscript 1438 | 1439 | source ~/.bashrc 1440 | #+end_src 1441 | 1442 | Finally, install the packages. 1443 | 1444 | #+begin_src shell :tangle conforg/scripts/r-install-personal.sh :shebang "#!/bin/bash" :noweb yes :var R_VERSION=R_VERSION 1445 | cd $SCRIPTS_DIR 1446 | ./r-install-packages.sh 1447 | #+end_src 1448 | 1449 | ** Install system-wide 1450 | 1451 | R packages need to be installed in a full root login. There's probably a way to do this with ~sudo -i~, but I can't figure it out, so I do it this convoluted way. It works, but if there's a better way, please let me know. Here we become root, then get back to the directory where the package installation script is so we can run it. 1452 | 1453 | #+begin_src shell :tangle conforg/scripts/r-install-system.sh :shebang "#!/bin/bash" :noweb yes :var R_VERSION=R_VERSION 1454 | <> 1455 | sudo make install 1456 | 1457 | sudo su - -c "cd $SCRIPTS_DIR; ./r-install-packages.sh" 1458 | #+end_src 1459 | 1460 | ** Packages 1461 | 1462 | There are quite a few R packages I want installed by default, including of course the [[https://www.tidyverse.org/][Tidyverse]], which I greatly admire. The packages are all in this next table. Add to (and resort) as needed. 1463 | 1464 | # TODO: Catch any errors that come up when installing the packages, and bail out with a warning. 1465 | # The problem could be that a dependency is missing (for example for GIS packages, which use 1466 | # programs and libraries installed on the system) 1467 | # See "How do I make install.packages return an error if an R package cannot be installed?" (https://stackoverflow.com/q/26244530) 1468 | 1469 | #+NAME: r_packages 1470 | | RCurl | 1471 | | RSQLite | 1472 | | arules | 1473 | | arulesViz | 1474 | | cluster | 1475 | | dbplyr | 1476 | | devtools | 1477 | | docopt | 1478 | | flexdashboard | 1479 | | fpc | 1480 | | fs | 1481 | | geonames | 1482 | | geosphere | 1483 | | GGally | 1484 | | ggrepel | 1485 | | ggridges | 1486 | | ggvis | 1487 | | gmp | 1488 | | gtools | 1489 | | hms | 1490 | | igraph | 1491 | | knitr | 1492 | | lintr | 1493 | | lubridate | 1494 | | mapproj | 1495 | | maps | 1496 | | maptools | 1497 | | MESS | 1498 | | openxlsx | 1499 | | osmdata | 1500 | | primes | 1501 | | readODS | 1502 | | readxl | 1503 | | remotes | 1504 | | rgeos | 1505 | | roxygen2 | 1506 | | seriation | 1507 | | sf | 1508 | | shiny | 1509 | | skimr | 1510 | | testthat | 1511 | | tidyverse | 1512 | | tm | 1513 | | topicmodels | 1514 | | usethis | 1515 | | xlsx | 1516 | 1517 | Now we need to transform that list into some shell commands. First, we're going to turn the list into a shell variable, =package_list=, with a neat [[https://stackoverflow.com/a/9429887/854346][array join tip]] I saw on Stack Overflow. This code block sets up the variable in another code block. (Make sure the name =packages-list-variable= is set or the noweb tangling won't work.) 1518 | 1519 | #+begin_src shell :results output :var pkgs=r_packages :results code 1520 | echo -n 'package_list="' 1521 | IFS=" " ; echo -n "${pkgs[*]}" 1522 | echo -n '"' 1523 | #+end_src 1524 | 1525 | #+NAME: packages-list-variable 1526 | #+RESULTS: 1527 | #+begin_src shell 1528 | package_list="RCurl RSQLite arules arulesViz cluster dbplyr devtools docopt flexdashboard fpc fs geonames geosphere GGally ggrepel ggridges ggvis gmp gtools hms igraph knitr lintr lubridate mapproj maps maptools MESS openxlsx osmdata primes readODS readxl remotes rgeos roxygen2 seriation sf shiny skimr testthat tidyverse tm topicmodels usethis xlsx" 1529 | #+end_src 1530 | 1531 | #+RESULTS: packages-list-variable 1532 | 1533 | And the above code block is included in the one below with noweb. 1534 | 1535 | #+begin_src shell :tangle conforg/scripts/r-install-packages.sh :shebang "#!/bin/bash" :noweb yes 1536 | <> 1537 | for pkg in $package_list 1538 | do 1539 | Rscript --vanilla -e "install.packages('$pkg', repos=c('https://mirror.csclub.uwaterloo.ca/CRAN/'))" 1540 | done 1541 | Rscript --vanilla -e "devtools::install_github('yorkulibraries/yulr')" 1542 | #+end_src 1543 | 1544 | When tangled, the script will have the full =package_list= definition with all the packages, and it loops through them all, installing one by one (with dependencies, where required). There are a lot of packages, so this will take a while. 1545 | 1546 | * Ruby 1547 | 1548 | #+NAME: RUBY_VERSION 1549 | | 3.4.1 | 1550 | 1551 | ** Requirements 1552 | 1553 | Make sure some necessities are in place before trying to build from source. 1554 | 1555 | #+begin_src shell :tangle conforg/scripts/ruby-install-requirements.sh :shebang "#!/bin/bash" 1556 | sudo apt-get build-dep ruby 1557 | sudo apt-get install libreadline-dev libsqlite3-dev libyaml-dev libssl-dev libxslt1-dev 1558 | #+end_src 1559 | 1560 | ** Install (or upgrade) rbenv 1561 | 1562 | This script installs [[https://github.com/rbenv/rbenv][rbenv]] if it isn't already in place; if it is, it updates it. It checks to see if =~/.rbenv/= exists; if it does, =rbenv= is installed, so it just tries to update it; if not, it installs it. 1563 | 1564 | #+begin_src shell :tangle conforg/scripts/ruby-rbenv.sh :shebang "#!/bin/bash" 1565 | if [[ -d ~/.rbenv ]]; then 1566 | echo "Upgrade if possible" 1567 | cd ~/.rbenv/ 1568 | git pull 1569 | cd plugins/ruby-build 1570 | git pull 1571 | else 1572 | echo "Installing" 1573 | git clone https://github.com/rbenv/rbenv.git ~/.rbenv 1574 | git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build 1575 | source ~/.bashrc 1576 | fi 1577 | #+end_src 1578 | 1579 | This can be called with noweb by source blocks below to install =rbenv= on a remote machine. 1580 | 1581 | #+NAME: ruby-rbenv-remotely 1582 | #+begin_src shell 1583 | ssh ${hostname} "conforg/scripts/ruby-rbenv.sh" 1584 | #+end_src 1585 | 1586 | ** Install with rbenv for personal use 1587 | 1588 | #+begin_src shell :tangle conforg/scripts/ruby-install-personal.sh :shebang "#!/bin/bash" :var RUBY_VERSION=RUBY_VERSION 1589 | rbenv install --verbose $RUBY_VERSION 1590 | rbenv global $RUBY_VERSION 1591 | ~/conforg/scripts/ruby-install-gems.sh 1592 | echo "Now run bundle install where needed (and perhaps bundle update --bundler)." 1593 | #+end_src 1594 | 1595 | #+NAME: ruby-install-personal-remotely 1596 | #+begin_src shell 1597 | ssh ${hostname} "conforg/scripts/ruby-install-personal.sh" 1598 | #+end_src 1599 | 1600 | ** Install system-wide 1601 | 1602 | #+begin_src shell :tangle conforg/scripts/ruby-install-system.sh :shebang "#!/bin/bash" :var RUBY_VERSION=RUBY_VERSION 1603 | mkdir -p /usr/local/src/ruby 1604 | cd /usr/local/src/ruby 1605 | 1606 | # The 3.0.2.tar.gz tarball is in the 3.0/ directory, for example. 1607 | MINOR_VERSION=$(echo ${RUBY_VERSION} | sed 's/\.[[:digit:]]$//') 1608 | 1609 | curl --location --remote-name https://cache.ruby-lang.org/pub/ruby/${MINOR_VERSION}/ruby-${RUBY_VERSION}.tar.gz 1610 | tar xzvf ruby-${RUBY_VERSION}.tar.gz 1611 | cd ruby-${RUBY_VERSION} 1612 | 1613 | ./configure 1614 | make 1615 | 1616 | sudo make install 1617 | sudo ~/conforg/scripts/ruby-install-gems.sh 1618 | 1619 | echo "Now run bundle install where needed (and perhaps bundle update --bundler)." 1620 | #+end_src 1621 | 1622 | #+NAME: ruby-install-system-remotely 1623 | #+begin_src shell 1624 | ssh ${hostname} "conforg/scripts/ruby-install-system.sh" 1625 | #+end_src 1626 | 1627 | ** Install gems 1628 | 1629 | This works like the R packages do. First, a list of gems I want installed by default. 1630 | 1631 | #+NAME: ruby_gems 1632 | | awesome_print | 1633 | | bundler | 1634 | | docopt | 1635 | | http | 1636 | | marc | 1637 | | nokogiri | 1638 | | pry | 1639 | | pry-doc | 1640 | | rubocop | 1641 | | rubyul | 1642 | | sqlite3 | 1643 | 1644 | Now transform that list into some shell commands into a shell variable, GEM_LIST. This code block generates the next one. 1645 | 1646 | #+begin_src shell :results output :var gems=ruby_gems :results code 1647 | echo -n 'GEM_LIST="' 1648 | IFS=" " ; echo -n "${gems[*]}" 1649 | echo -n '"' 1650 | #+end_src 1651 | 1652 | #+NAME: gem-list-variable 1653 | #+RESULTS: 1654 | #+begin_src shell 1655 | GEM_LIST="awesome_print bundler docopt http marc nokogiri pry pry-doc rubocop rubyul sqlite3" 1656 | #+end_src 1657 | 1658 | And the above code block is included in the one below with noweb. 1659 | 1660 | #+begin_src shell :tangle conforg/scripts/ruby-install-gems.sh :shebang "#!/bin/bash" :noweb yes 1661 | <> 1662 | for gem in $GEM_LIST 1663 | do 1664 | gem install $gem 1665 | done 1666 | #+end_src 1667 | 1668 | * Tor 1669 | 1670 | #+NAME: TOR_VERSION 1671 | | 0.4.8.13 | 1672 | 1673 | I run two [[https://www.torproject.org/][Tor]] relays (not exit points). These scripts let me update and run them—see my post [[https://www.miskatonic.org/2024/04/07/how-i-set-up-a-tor-bridge/][How I set up a Tor bridge]] for more. The necessary =torrc= is not covered here; it requires special care to configure. 1674 | 1675 | ** Requirements 1676 | 1677 | Make sure some necessities are in place before trying to build from source. 1678 | 1679 | #+begin_src shell :tangle conforg/scripts/tor-install-requirements.sh :shebang "#!/bin/bash" 1680 | sudo apt install build-essential 1681 | sudo apt install libevent-dev libssl-dev libcap-dev liblzma-dev libzstd-dev libseccomp-dev libscrypt-dev zlib1g zlib1g-dev 1682 | sudo apt install speedometer tmux vnstat 1683 | mkdir -p /usr/local/src/tor/ /usr/local/src/tor/log/ 1684 | #+end_src 1685 | 1686 | ** Install 1687 | 1688 | #+begin_src shell :tangle conforg/scripts/tor-install-system.sh :shebang "#!/bin/bash" :var TOR_VERSION=TOR_VERSION 1689 | cd /usr/local/src/tor/ 1690 | curl --location --remote-name https://dist.torproject.org/tor-${TOR_VERSION}.tar.gz 1691 | tar --extract --verbose --gunzip --file tor-${TOR_VERSION}.tar.gz 1692 | cd tor-${TOR_VERSION} 1693 | ./configure && make && sudo make install 1694 | echo "Now run ~/conforg/scripts/tor-run.sh" 1695 | #+end_src 1696 | 1697 | #+NAME: tor-install-system-remotely 1698 | #+begin_src shell 1699 | ssh ${hostname} "conforg/scripts/tor-install-system.sh" 1700 | #+end_src 1701 | 1702 | ** Script to run and monitor Tor 1703 | 1704 | This runs Tor in a [[https://github.com/tmux/tmux/wiki][Tmux]] session with a window where the =speedometer= program is showing how much bandwidth is in use. Logging in and running ~tmux attach -t tor~ shows what's going on, then ~C-b d~ detaches but leaves everything running. 1705 | 1706 | First, if one of these is already running, kill it and everything inside. We need to wait at least thirty seconds for Tor to shut down nicely. 1707 | 1708 | #+begin_src shell :tangle conforg/scripts/tor-run.sh :shebang "#!/bin/bash" 1709 | if tmux has-session -t tor 1710 | then 1711 | echo "Session tor exists; killing it nicely ..." 1712 | tmux send-keys -t tor:1 "C-c" 1713 | tmux send-keys -t tor:2 "C-c" 1714 | tmux send-keys -t tor:3 "C-c" 1715 | tmux send-keys -t tor:4 "C-c" 1716 | sleep 35 1717 | tmux kill-window -t tor:1 1718 | tmux kill-window -t tor:2 1719 | tmux kill-window -t tor:3 1720 | tmux kill-window -t tor:4 1721 | fi 1722 | #+end_src 1723 | 1724 | Now start a new session with four windows in it: Tor; bandwidth notices in the log file; the =speedometer= visualization; and a shell for ~vnstat~ for traffic reports. Being able to script Tmux like this makes it very powerful. 1725 | 1726 | By default, =speedometer= will show traffic on the =wlan0= interface. To use another one, set the =TOR_IFACE= environment variable in =~/.bash.${HOSTNAME}.rc=, like so: =export TOR_IFACE=ens160=. 1727 | 1728 | #+begin_src shell :tangle conforg/scripts/tor-run.sh 1729 | echo "Starting tor session ..." 1730 | 1731 | tmux new-session -d -s "tor" 1732 | 1733 | if [[ -z $TOR_IFACE ]]; then 1734 | TOR_IFACE=wlan0 1735 | fi 1736 | 1737 | tmux new-window -t tor:2 1738 | tmux new-window -t tor:3 1739 | tmux new-window -t tor:4 1740 | 1741 | tmux send-keys -t tor:3 "speedometer -t ${TOR_IFACE} -r ${TOR_IFACE} -l -m 1048576" "C-m" 1742 | 1743 | tmux select-window -t 1 1744 | tmux send-keys -t tor:1 "tor" "C-m" 1745 | 1746 | tmux send-keys -t tor:2 "tail -f /usr/local/src/tor/log/notices.log" "C-m" 1747 | 1748 | tmux send-keys -t tor:4 "vnstat -d --iface ${TOR_IFACE}" "C-m" 1749 | #+end_src 1750 | 1751 | Put this in the crontab to bring up Tor automatically when the machine reboots: 1752 | 1753 | #+begin_example 1754 | @reboot ~/conforg/scripts/tor-run.sh 1755 | #+end_example 1756 | 1757 | If you defined =TOR_IFACE= specially, do this: 1758 | 1759 | #+begin_example 1760 | @reboot source ~/.bash.${HOSTNAME}.rc; ~/conforg/scripts/tor-run.sh 1761 | #+end_example 1762 | 1763 | * Machines 1764 | 1765 | ** localhost 1766 | 1767 | #+begin_src shell :results output 1768 | install/install.sh 1769 | #+end_src 1770 | 1771 | #+RESULTS: 1772 | #+begin_example 1773 | mine 1774 | abcde.conf 1775 | bash_logout 1776 | bash_profile 1777 | bashrc 1778 | gemrc 1779 | gitattributes 1780 | gitconfig 1781 | lessfilter 1782 | lintr 1783 | nanorc 1784 | pryrc 1785 | Rprofile 1786 | rubocop.yml 1787 | shellcheckrc 1788 | signature 1789 | signature.work 1790 | sqliterc 1791 | tmux.conf 1792 | XCompose 1793 | xmodmaprc 1794 | imported 1795 | chktexrc 1796 | dircolors.ansi-dark 1797 | git-completion.bash 1798 | #+end_example 1799 | 1800 | ** music 1801 | :PROPERTIES: 1802 | :header-args: :var hostname="music" 1803 | :END: 1804 | 1805 | #+begin_src shell :results silent :noweb yes 1806 | <> 1807 | #+end_src 1808 | 1809 | *** Install Emacs remotely one way 1810 | 1811 | #+begin_src shell :dir /scp:wtd@music:conforg/scripts/ :results silent 1812 | # ./emacs-install-requirements.sh 1813 | ./emacs-install-personal.sh 1814 | #+end_src 1815 | 1816 | *** Install Ruby remotely the other way 1817 | 1818 | #+begin_src shell :results silent :noweb yes 1819 | <> 1820 | #+end_src 1821 | 1822 | #+begin_src shell :results silent :noweb yes 1823 | <> 1824 | #+end_src 1825 | 1826 | Or log in to the machine itself and run the scripts there. 1827 | 1828 | ** tor 1829 | :PROPERTIES: 1830 | :header-args: :var hostname="tor" 1831 | :END: 1832 | 1833 | #+begin_src shell :results silent :noweb yes 1834 | <> 1835 | #+end_src 1836 | 1837 | ** pair 1838 | :PROPERTIES: 1839 | :header-args: :var hostname="pair" 1840 | :END: 1841 | 1842 | #+begin_src shell :results silent :noweb yes 1843 | <> 1844 | #+end_src 1845 | 1846 | ** shell4 1847 | :PROPERTIES: 1848 | :header-args: :var hostname="shell4" 1849 | :END: 1850 | 1851 | #+begin_src shell :results silent :noweb yes 1852 | <> 1853 | #+end_src 1854 | 1855 | ** orez 1856 | :PROPERTIES: 1857 | :header-args: :var hostname="orez" 1858 | :END: 1859 | 1860 | #+begin_src shell :results silent :noweb yes 1861 | <> 1862 | #+end_src 1863 | -------------------------------------------------------------------------------- /install/copy-dotfiles.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cd "$(dirname "$0")" 3 | 4 | cd ../conforg/ 5 | cp -pr dotfiles/* ~/conforg/dotfiles/ 6 | -------------------------------------------------------------------------------- /install/copy-scripts.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cd "$(dirname "$0")" 3 | 4 | cd ../conforg/ 5 | cp -p scripts/* ~/conforg/scripts/ 6 | -------------------------------------------------------------------------------- /install/install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | rsync --archive --delete ~/src/conforguration/conforg/ ${HOME}/conforg/ 3 | 4 | ~/conforg/dotfiles/link-dotfiles.sh 5 | --------------------------------------------------------------------------------