├── .gitignore ├── README.md ├── Vagrantfile ├── files ├── LICENSE ├── README.md ├── apache2.conf ├── default ├── encontent.sh ├── hostapd ├── hostapd.conf ├── hostapd_RTL8188CUS ├── hostapd_realtek.conf ├── hostname ├── hosts ├── ifupdown.sh ├── info │ └── pi64EN-running-services.txt ├── init-functions ├── init-kiwix-service ├── init-service ├── init-systemd-conf ├── interfaces ├── kiwix-sample-library.xml ├── kiwix-sample.zim ├── my.cnf ├── mysql.sh ├── powering-potential.modules ├── rachel-kiwix-start.pl ├── rachelpios ├── realtek.sh ├── realtek.txt ├── sysctl.conf ├── udhcpd └── udhcpd.conf └── installer.py /.gitignore: -------------------------------------------------------------------------------- 1 | .vagrant* 2 | sources.list -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | rachelpiOS 2 | --------------- 3 | 4 | *NOTE: This install is tested to work with `2016-05-27-raspbian-jessie` and is known to have problems with newer versions* 5 | 6 | To install is easy: 7 | 8 | Expand your microSD card partition 9 | `sudo raspi-config` 10 | `sudo reboot` 11 | 12 | NOTE: for WIFI to ever work on the unit, you must have the WIFI USB dongle inserted 13 | during installation so that the install script can configure it properly. 14 | 15 | paste in the following command after reboot. 16 | 17 | `curl -fsS https://raw.githubusercontent.com/rachelproject/rachelpiOS/master/installer.py | python` 18 | 19 | Please note that this will change the 'pi' user's password to: rachel 20 | 21 | All default username and passwords will be rachel/rachel unless noted differently. 22 | 23 | Additional Details 24 | --------------- 25 | Please check out the Wiki: https://github.com/rachelproject/rachelpiOS/wiki 26 | -------------------------------------------------------------------------------- /Vagrantfile: -------------------------------------------------------------------------------- 1 | # -*- mode: ruby -*- 2 | # vi: set ft=ruby : 3 | 4 | # All Vagrant configuration is done below. The "2" in Vagrant.configure 5 | # configures the configuration version (we support older styles for 6 | # backwards compatibility). Please don't change it unless you know what 7 | # you're doing. 8 | Vagrant.configure(2) do |config| 9 | # The most common configuration options are documented and commented below. 10 | # For a complete reference, please see the online documentation at 11 | # https://docs.vagrantup.com. 12 | 13 | # Every Vagrant development environment requires a box. You can search for 14 | # boxes at https://atlas.hashicorp.com/search. 15 | config.vm.box = "debian/jessie64" 16 | config.vm.box_version = "8.2.1" 17 | 18 | # Disable automatic box update checking. If you disable this, then 19 | # boxes will only be checked for updates when the user runs 20 | # `vagrant box outdated`. This is not recommended. 21 | # config.vm.box_check_update = false 22 | 23 | # Create a forwarded port mapping which allows access to a specific port 24 | # within the machine from a port on the host machine. In the example below, 25 | # accessing "localhost:8080" will access port 80 on the guest machine. 26 | config.vm.network "forwarded_port", guest: 80, host: 8080 27 | config.vm.network "forwarded_port", guest: 8008, host: 8008 28 | 29 | # Create a private network, which allows host-only access to the machine 30 | # using a specific IP. 31 | # config.vm.network "private_network", ip: "192.168.33.10" 32 | 33 | # Create a public network, which generally matched to bridged network. 34 | # Bridged networks make the machine appear as another physical device on 35 | # your network. 36 | # config.vm.network "public_network" 37 | 38 | # Share an additional folder to the guest VM. The first argument is 39 | # the path on the host to the actual folder. The second argument is 40 | # the path on the guest to mount the folder. And the optional third 41 | # argument is a set of non-required options. 42 | # config.vm.synced_folder "../data", "/vagrant_data" 43 | 44 | # Provider-specific configuration so you can fine-tune various 45 | # backing providers for Vagrant. These expose provider-specific options. 46 | # Example for VirtualBox: 47 | # 48 | # config.vm.provider "virtualbox" do |vb| 49 | # # Display the VirtualBox GUI when booting the machine 50 | # vb.gui = true 51 | # 52 | # # Customize the amount of memory on the VM: 53 | # vb.memory = "1024" 54 | # end 55 | # 56 | # View the documentation for the provider you are using for more 57 | # information on available options. 58 | 59 | # Define a Vagrant Push strategy for pushing to Atlas. Other push strategies 60 | # such as FTP and Heroku are also available. See the documentation at 61 | # https://docs.vagrantup.com/v2/push/atlas.html for more information. 62 | # config.push.define "atlas" do |push| 63 | # push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME" 64 | # end 65 | 66 | # Enable provisioning with a shell script. Additional provisioners such as 67 | # Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the 68 | # documentation for more information about their specific syntax and use. 69 | # config.vm.provision "shell", inline: <<-SHELL 70 | # sudo apt-get update 71 | # sudo apt-get install -y apache2 72 | # SHELL 73 | config.vm.provision "shell", inline: "touch /etc/is_vagrant_vm" 74 | #config.vm.provision "shell", path: "./installer.py" 75 | end 76 | -------------------------------------------------------------------------------- /files/LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | {one line to give the program's name and a brief idea of what it does.} 635 | Copyright (C) {year} {name of author} 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | {project} Copyright (C) {year} {fullname} 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | 676 | -------------------------------------------------------------------------------- /files/README.md: -------------------------------------------------------------------------------- 1 | rachelpiOS 2 | ========== 3 | 4 | all raspberry pi configuration files for RACHEL os 5 | -------------------------------------------------------------------------------- /files/apache2.conf: -------------------------------------------------------------------------------- 1 | # This is the main Apache server configuration file. It contains the 2 | # configuration directives that give the server its instructions. 3 | # See http://httpd.apache.org/docs/2.2/ for detailed information about 4 | # the directives and /usr/share/doc/apache2-common/README.Debian.gz about 5 | # Debian specific hints. 6 | # 7 | # 8 | # Summary of how the Apache 2 configuration works in Debian: 9 | # The Apache 2 web server configuration in Debian is quite different to 10 | # upstream's suggested way to configure the web server. This is because Debian's 11 | # default Apache2 installation attempts to make adding and removing modules, 12 | # virtual hosts, and extra configuration directives as flexible as possible, in 13 | # order to make automating the changes and administering the server as easy as 14 | # possible. 15 | 16 | # It is split into several files forming the configuration hierarchy outlined 17 | # below, all located in the /etc/apache2/ directory: 18 | # 19 | # /etc/apache2/ 20 | # |-- apache2.conf 21 | # | `-- ports.conf 22 | # |-- mods-enabled 23 | # | |-- *.load 24 | # | `-- *.conf 25 | # |-- conf.d 26 | # | `-- * 27 | # `-- sites-enabled 28 | # `-- * 29 | # 30 | # 31 | # * apache2.conf is the main configuration file (this file). It puts the pieces 32 | # together by including all remaining configuration files when starting up the 33 | # web server. 34 | # 35 | # In order to avoid conflicts with backup files, the Include directive is 36 | # adapted to ignore files that: 37 | # - do not begin with a letter or number 38 | # - contain a character that is neither letter nor number nor _-:. 39 | # - contain .dpkg 40 | # 41 | # Yet we strongly suggest that all configuration files either end with a 42 | # .conf or .load suffix in the file name. The next Debian release will 43 | # ignore files not ending with .conf (or .load for mods-enabled). 44 | # 45 | # * ports.conf is always included from the main configuration file. It is 46 | # supposed to determine listening ports for incoming connections, and which 47 | # of these ports are used for name based virtual hosts. 48 | # 49 | # * Configuration files in the mods-enabled/ and sites-enabled/ directories 50 | # contain particular configuration snippets which manage modules or virtual 51 | # host configurations, respectively. 52 | # 53 | # They are activated by symlinking available configuration files from their 54 | # respective *-available/ counterparts. These should be managed by using our 55 | # helpers a2enmod/a2dismod, a2ensite/a2dissite. See 56 | # their respective man pages for detailed information. 57 | # 58 | # * Configuration files in the conf.d directory are either provided by other 59 | # packages or may be added by the local administrator. Local additions 60 | # should start with local- or end with .local.conf to avoid name clashes. All 61 | # files in conf.d are considered (excluding the exceptions noted above) by 62 | # the Apache 2 web server. 63 | # 64 | # * The binary is called apache2. Due to the use of environment variables, in 65 | # the default configuration, apache2 needs to be started/stopped with 66 | # /etc/init.d/apache2 or apache2ctl. Calling /usr/bin/apache2 directly will not 67 | # work with the default configuration. 68 | 69 | 70 | # Global configuration 71 | # 72 | 73 | # 74 | # ServerRoot: The top of the directory tree under which the server's 75 | # configuration, error, and log files are kept. 76 | # 77 | # NOTE! If you intend to place this on an NFS (or otherwise network) 78 | # mounted filesystem then please read the LockFile documentation (available 79 | # at ); 80 | # you will save yourself a lot of trouble. 81 | # 82 | # Do NOT add a slash at the end of the directory path. 83 | # 84 | #ServerRoot "/etc/apache2" 85 | 86 | # 87 | # The accept serialization lock file MUST BE STORED ON A LOCAL DISK. 88 | # 89 | LockFile ${APACHE_LOCK_DIR}/accept.lock 90 | 91 | # 92 | # PidFile: The file in which the server should record its process 93 | # identification number when it starts. 94 | # This needs to be set in /etc/apache2/envvars 95 | # 96 | PidFile ${APACHE_PID_FILE} 97 | 98 | # 99 | # Timeout: The number of seconds before receives and sends time out. 100 | # 101 | Timeout 300 102 | 103 | # 104 | # KeepAlive: Whether or not to allow persistent connections (more than 105 | # one request per connection). Set to "Off" to deactivate. 106 | # 107 | KeepAlive On 108 | 109 | # 110 | # MaxKeepAliveRequests: The maximum number of requests to allow 111 | # during a persistent connection. Set to 0 to allow an unlimited amount. 112 | # We recommend you leave this number high, for maximum performance. 113 | # 114 | MaxKeepAliveRequests 100 115 | 116 | # 117 | # KeepAliveTimeout: Number of seconds to wait for the next request from the 118 | # same client on the same connection. 119 | # 120 | KeepAliveTimeout 5 121 | 122 | ## 123 | ## Server-Pool Size Regulation (MPM specific) 124 | ## 125 | 126 | # prefork MPM 127 | # StartServers: number of server processes to start 128 | # MinSpareServers: minimum number of server processes which are kept spare 129 | # MaxSpareServers: maximum number of server processes which are kept spare 130 | # MaxClients: maximum number of server processes allowed to start 131 | # MaxRequestsPerChild: maximum number of requests a server process serves 132 | 133 | StartServers 5 134 | MinSpareServers 5 135 | MaxSpareServers 10 136 | MaxClients 150 137 | MaxRequestsPerChild 0 138 | 139 | 140 | # worker MPM 141 | # StartServers: initial number of server processes to start 142 | # MinSpareThreads: minimum number of worker threads which are kept spare 143 | # MaxSpareThreads: maximum number of worker threads which are kept spare 144 | # ThreadLimit: ThreadsPerChild can be changed to this maximum value during a 145 | # graceful restart. ThreadLimit can only be changed by stopping 146 | # and starting Apache. 147 | # ThreadsPerChild: constant number of worker threads in each server process 148 | # MaxClients: maximum number of simultaneous client connections 149 | # MaxRequestsPerChild: maximum number of requests a server process serves 150 | 151 | StartServers 2 152 | MinSpareThreads 25 153 | MaxSpareThreads 75 154 | ThreadLimit 64 155 | ThreadsPerChild 25 156 | MaxClients 150 157 | MaxRequestsPerChild 0 158 | 159 | 160 | # event MPM 161 | # StartServers: initial number of server processes to start 162 | # MinSpareThreads: minimum number of worker threads which are kept spare 163 | # MaxSpareThreads: maximum number of worker threads which are kept spare 164 | # ThreadsPerChild: constant number of worker threads in each server process 165 | # MaxClients: maximum number of simultaneous client connections 166 | # MaxRequestsPerChild: maximum number of requests a server process serves 167 | 168 | StartServers 2 169 | MinSpareThreads 25 170 | MaxSpareThreads 75 171 | ThreadLimit 64 172 | ThreadsPerChild 25 173 | MaxClients 150 174 | MaxRequestsPerChild 0 175 | 176 | 177 | # These need to be set in /etc/apache2/envvars 178 | User ${APACHE_RUN_USER} 179 | Group ${APACHE_RUN_GROUP} 180 | 181 | # 182 | # AccessFileName: The name of the file to look for in each directory 183 | # for additional configuration directives. See also the AllowOverride 184 | # directive. 185 | # 186 | 187 | AccessFileName .htaccess 188 | 189 | # 190 | # The following lines prevent .htaccess and .htpasswd files from being 191 | # viewed by Web clients. 192 | # 193 | 194 | Order allow,deny 195 | Deny from all 196 | Satisfy all 197 | 198 | 199 | # 200 | # DefaultType is the default MIME type the server will use for a document 201 | # if it cannot otherwise determine one, such as from filename extensions. 202 | # If your server contains mostly text or HTML documents, "text/plain" is 203 | # a good value. If most of your content is binary, such as applications 204 | # or images, you may want to use "application/octet-stream" instead to 205 | # keep browsers from trying to display binary files as though they are 206 | # text. 207 | # 208 | # It is also possible to omit any default MIME type and let the 209 | # client's browser guess an appropriate action instead. Typically the 210 | # browser will decide based on the file's extension then. In cases 211 | # where no good assumption can be made, letting the default MIME type 212 | # unset is suggested instead of forcing the browser to accept 213 | # incorrect metadata. 214 | # 215 | DefaultType None 216 | 217 | 218 | # 219 | # HostnameLookups: Log the names of clients or just their IP addresses 220 | # e.g., www.apache.org (on) or 204.62.129.132 (off). 221 | # The default is off because it'd be overall better for the net if people 222 | # had to knowingly turn this feature on, since enabling it means that 223 | # each client request will result in AT LEAST one lookup request to the 224 | # nameserver. 225 | # 226 | HostnameLookups Off 227 | 228 | # ErrorLog: The location of the error log file. 229 | # If you do not specify an ErrorLog directive within a 230 | # container, error messages relating to that virtual host will be 231 | # logged here. If you *do* define an error logfile for a 232 | # container, that host's errors will be logged there and not here. 233 | # 234 | ErrorLog ${APACHE_LOG_DIR}/error.log 235 | 236 | # 237 | # LogLevel: Control the number of messages logged to the error_log. 238 | # Possible values include: debug, info, notice, warn, error, crit, 239 | # alert, emerg. 240 | # 241 | LogLevel warn 242 | 243 | # Include module configuration: 244 | Include mods-enabled/*.load 245 | Include mods-enabled/*.conf 246 | 247 | # Include list of ports to listen on and which to use for name based vhosts 248 | Include ports.conf 249 | 250 | # 251 | # The following directives define some format nicknames for use with 252 | # a CustomLog directive (see below). 253 | # If you are behind a reverse proxy, you might want to change %h into %{X-Forwarded-For}i 254 | # 255 | LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined 256 | LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined 257 | LogFormat "%h %l %u %t \"%r\" %>s %O" common 258 | LogFormat "%{Referer}i -> %U" referer 259 | LogFormat "%{User-agent}i" agent 260 | 261 | # Include of directories ignores editors' and dpkg's backup files, 262 | # see the comments above for details. 263 | 264 | # Include generic snippets of statements 265 | Include conf.d/ 266 | 267 | # Include the virtual host configurations: 268 | Include sites-enabled/ 269 | -------------------------------------------------------------------------------- /files/default: -------------------------------------------------------------------------------- 1 | 2 | ServerAdmin webmaster@localhost 3 | 4 | DocumentRoot /var/www 5 | 6 | Options -Indexes +FollowSymLinks 7 | AllowOverride None 8 | DirectoryIndex index.html index.php /_h5ai/server/php/index.php 9 | 10 | 11 | Options -Indexes +FollowSymLinks +MultiViews 12 | AllowOverride None 13 | Order allow,deny 14 | allow from all 15 | 16 | 17 | ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ 18 | 19 | AllowOverride None 20 | Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch 21 | Order allow,deny 22 | Allow from all 23 | 24 | 25 | ErrorLog ${APACHE_LOG_DIR}/error.log 26 | 27 | # Possible values include: debug, info, notice, warn, error, crit, 28 | # alert, emerg. 29 | LogLevel error 30 | 31 | CustomLog ${APACHE_LOG_DIR}/access.log combined 32 | 33 | ProxyPass /wikipedia_es_all_03_2012 http://localhost:8080/wikipedia_es_all_03_2012/ 34 | ProxyPassReverse /wikipedia_es_all_03_2012 http://localhost:8080/wikipedia_es_all_03_2012/ 35 | ProxyPass /wikipedia http://localhost:8080/wikipedia_es_all_03_2012/ 36 | ProxyPassReverse /wikipedia http://localhost:8080/wikipedia_es_all_03_2012/ 37 | ProxyPass /search http://localhost:8080/search 38 | ProxyPassReverse /search http://localhost:8080/search 39 | ProxyPass /skin http://localhost:8080/skin 40 | ProxyPassReverse /skin http://localhost:8080/skin 41 | ProxyPass /wikipedia_fr_all_11_2013 http://localhost:8080/wikipedia_fr_all_11_2013/ 42 | ProxyPassReverse /wikipedia_fr_all_11_2013 http://localhost:8080/wikipedia_fr_all_11_2013/ 43 | ProxyPass /wikipedia http://localhost:8080/wikipedia_fr_all_11_2013/ 44 | ProxyPassReverse /wikipedia http://localhost:8080/wikipedia_fr_all_11_2013/ 45 | ProxyPass /search http://localhost:8080/search 46 | ProxyPassReverse /search http://localhost:8080/search 47 | ProxyPass /skin http://localhost:8080/skin 48 | ProxyPassReverse /skin http://localhost:8080/skin 49 | 50 | -------------------------------------------------------------------------------- /files/encontent.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DEFAULT_MODULES=( en-ebooks en-hesperian_health en-iicba en-math_expression \ 4 | en-medline_plus en-musictheory en-olpc en-powertyping en-practical_action en-scratch \ 5 | en-understanding_algebra en-wikipedia_for_schools en-rpi_guide en-windows_apps en-asst_medical ) 6 | 7 | DEST_PATH=/var/www/modules 8 | RSYNC_SOURCE=rsync://dev.worldpossible.org/rachelmods/ 9 | FILE_OWNER="www-data" 10 | RSYNC_OPT=() 11 | MODULES=() 12 | 13 | CMDNAME=$0 14 | Usage () { 15 | echo "$CMDNAME [options]" 16 | echo " Options:" 17 | echo " --module Load specified module" 18 | echo " --module-file Read modules to load from provided file" 19 | echo " --dest Path to store downloaded RACHEL content (default '$DEST_PATH')" 20 | echo " --rsh Set rsync shell command" 21 | echo " --source RACHEL content server. (default '$RSYNC_SOURCE')" 22 | echo " --own Keep ownership of copied files" 23 | echo " --owner Set owner of copied files" 24 | echo " --help Display help message" 25 | echo "" 26 | } 27 | 28 | while [ true ]; do 29 | case $1 in 30 | -h | --help | -\?) 31 | Usage 32 | exit 0 33 | ;; 34 | --module) 35 | MODULES+=("$2") 36 | shift 2 37 | ;; 38 | --module-file) 39 | IFS=$'\n' read -d '' -r -a NEW_MODULES < "$2" 40 | MODULES=( "${MODULES[@]}" "${NEW_MODULES[@]}" ) 41 | shift 2 42 | ;; 43 | --source) 44 | RSYNC_SOURCE="$2" 45 | shift 2 46 | ;; 47 | --dest) 48 | DEST_PATH="$2" 49 | shift 2 50 | ;; 51 | --own) 52 | FILE_OWNER="" 53 | shift 1 54 | ;; 55 | --owner) 56 | FILE_OWNER="$2" 57 | shift 2 58 | ;; 59 | --rsh) 60 | RSYNC_OPT=("-e" "$2") 61 | shift 2 62 | ;; 63 | --*) 64 | echo "$CMDNAME: invalid option '$1'" 65 | exit 1 66 | ;; 67 | *) 68 | break 69 | ;; 70 | esac 71 | done 72 | 73 | function copy_file () { 74 | local MODULE="$1" 75 | local DESTDIR="$2" 76 | ${CHOWN_CMD}rsync -rlptvz "${RSYNC_OPT[@]}" "${RSYNC_SOURCE}${MODULE}" "$DEST_PATH/$DESTDIR" 77 | if [ $? -ne 0 ]; then 78 | sleep 1 79 | echo "Copying of $module failed or was aborted. Exiting." 80 | exit 81 | fi 82 | } 83 | 84 | function copy_module () { 85 | local MODULE="$1" 86 | local DESTDIR="$2" 87 | ${CHOWN_CMD}rsync -rlptvz "${RSYNC_OPT[@]}" "${RSYNC_SOURCE}${MODULE}/" "$DEST_PATH/$DESTDIR" 88 | if [ $? -ne 0 ]; then 89 | sleep 1 90 | echo "Copying of $module failed or was aborted. Exiting." 91 | exit 92 | fi 93 | } 94 | 95 | if [ $# -gt 0 ]; then 96 | echo "$CMDNAME: too many arguments" 97 | exit 1 98 | fi 99 | 100 | if [ `id -u` != "0" ] && [ ! -z "$FILE_OWNER" ]; then 101 | echo "$CMDNAME: This script must be run as root" 102 | exit 103 | fi 104 | 105 | if [ ${#MODULES[@]} -eq 0 ]; then 106 | MODULES="${DEFAULT_MODULES[@]}" 107 | fi 108 | 109 | if [ "${RSYNC_SOURCE: -1}" != ":" ] && [ "${RSYNC_SOURCE: -1}" != "/" ]; then 110 | RSYNC_SOURCE="${RSYNC_SOURCE}/" 111 | fi 112 | 113 | if [ -z "$FILE_OWNER" ]; then 114 | CHOWN_CMD="" 115 | else 116 | CHOWN_CMD="sudo -u $FILE_OWNER SSHPASS=$SSHPASS " 117 | fi 118 | 119 | ${CHOWN_CMD}mkdir -p "$DEST_PATH" 120 | 121 | for MODULE in ${MODULES[@]}; do 122 | echo 123 | echo "Syncing $MODULE ..." 124 | DESTDIR="$MODULE" 125 | if [ "$DESTDIR" == "en-khan_health" ]; then 126 | ${CHOWN_CMD}mkdir -p "$DEST_PATH/en-kaos/science/health-and-medicine" 127 | copy_module "en-kaos/science/health-and-medicine" "en-kaos/science/health-and-medicine" 128 | copy_file "en-kaos/style.css" "en-kaos" 129 | copy_file "en-kaos/about.html" "en-kaos" 130 | DESTDIR="en-kaos" 131 | fi 132 | copy_module "${MODULE}" "$DESTDIR" 133 | done 134 | -------------------------------------------------------------------------------- /files/hostapd: -------------------------------------------------------------------------------- 1 | # Defaults for hostapd initscript 2 | # 3 | # See /usr/share/doc/hostapd/README.Debian for information about alternative 4 | # methods of managing hostapd. 5 | # 6 | # Uncomment and set DAEMON_CONF to the absolute path of a hostapd configuration 7 | # file and hostapd will be started during system boot. An example configuration 8 | # file can be found at /usr/share/doc/hostapd/examples/hostapd.conf.gz 9 | # 10 | DAEMON_CONF="/etc/hostapd/hostapd.conf" 11 | 12 | # Additional daemon options to be appended to hostapd command:- 13 | # -d show more debug messages (-dd for even more) 14 | # -K include key data in debug messages 15 | # -t include timestamps in some debug messages 16 | # 17 | # Note that -B (daemon mode) and -P (pidfile) options are automatically 18 | # configured by the init.d script and must not be added to DAEMON_OPTS. 19 | # 20 | #DAEMON_OPTS="" 21 | -------------------------------------------------------------------------------- /files/hostapd.conf: -------------------------------------------------------------------------------- 1 | # Open network setup 2 | 3 | interface=wlan0 4 | driver=nl80211 5 | ssid=RPI 6 | 7 | #sets the mode of wifi, depends upon the devices you will be using. It can be a,b,g,n. Setting to g ensures backward compatiblity. 8 | hw_mode=g 9 | 10 | # Set the wi-fi channel: 11 | channel=4 12 | 13 | #Sets authentication algorithm 14 | #1 - only open system authentication 15 | auth_algs=1 16 | 17 | wmm_enabled=0 18 | -------------------------------------------------------------------------------- /files/hostapd_RTL8188CUS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/worldpossible/rachelpiOS/5489bb2fc9f317ee7ba0470c4ffe3e349f059830/files/hostapd_RTL8188CUS -------------------------------------------------------------------------------- /files/hostapd_realtek.conf: -------------------------------------------------------------------------------- 1 | # Open network setup 2 | 3 | interface=wlan0 4 | driver=rtl871xdrv 5 | ssid=RPI 6 | 7 | #sets the mode of wifi, depends upon the devices you will be using. It can be a,b,g,n. Setting to g ensures backward compatiblity. 8 | hw_mode=g 9 | 10 | # Set the wi-fi channel: 11 | channel=4 12 | 13 | #Sets authentication algorithm 14 | #1 - only open system authentication 15 | auth_algs=1 16 | 17 | wmm_enabled=0 -------------------------------------------------------------------------------- /files/hostname: -------------------------------------------------------------------------------- 1 | rachel 2 | -------------------------------------------------------------------------------- /files/hosts: -------------------------------------------------------------------------------- 1 | 127.0.0.1 localhost 2 | ::1 localhost ip6-localhost ip6-loopback 3 | fe00::0 ip6-localnet 4 | ff00::0 ip6-mcastprefix 5 | ff02::1 ip6-allnodes 6 | ff02::2 ip6-allrouters 7 | 8 | 127.0.1.1 rachel 9 | -------------------------------------------------------------------------------- /files/ifupdown.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Copyright (C) 2006-2009 Debian hostapd maintainers 4 | # Faidon Liambotis 5 | # Kel Modderman 6 | # 7 | # This program is free software; you can redistribute it and/or 8 | # modify it under the terms of the GNU General Public License 9 | # as published by the Free Software Foundation; either version 2 10 | # of the License, or (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU General Public License for more details. 16 | # 17 | # On Debian GNU/Linux systems, the text of the GPL license, 18 | # version 2, can be found in /usr/share/common-licenses/GPL-2. 19 | 20 | # quit if we're called for lo 21 | if [ "$IFACE" = lo ]; then 22 | exit 0 23 | fi 24 | 25 | if [ -n "$IF_HOSTAPD" ]; then 26 | HOSTAPD_CONF="$IF_HOSTAPD" 27 | else 28 | exit 0 29 | fi 30 | 31 | HOSTAPD_BIN="/usr/sbin/hostapd" 32 | HOSTAPD_PNAME="hostapd" 33 | HOSTAPD_PIDFILE="/var/run/hostapd.$IFACE.pid" 34 | HOSTAPD_OMIT_PIDFILE="/run/sendsigs.omit.d/hostapd.$IFACE.pid" 35 | 36 | if [ ! -x "$HOSTAPD_BIN" ]; then 37 | exit 0 38 | fi 39 | 40 | if [ "$VERBOSITY" = "1" ]; then 41 | TO_NULL="/dev/stdout" 42 | else 43 | TO_NULL="/dev/null" 44 | fi 45 | 46 | hostapd_msg () { 47 | case "$1" in 48 | verbose) 49 | shift 50 | echo "$HOSTAPD_PNAME: $@" > "$TO_NULL" 51 | ;; 52 | stderr) 53 | shift 54 | echo "$HOSTAPD_PNAME: $@" > /dev/stderr 55 | ;; 56 | *) 57 | ;; 58 | esac 59 | } 60 | 61 | test_hostapd_pidfile () { 62 | if [ -n "$1" ] && [ -f "$2" ]; then 63 | if start-stop-daemon --stop --quiet --signal 0 \ 64 | --exec "$1" --pidfile "$2"; then 65 | return 0 66 | else 67 | rm -f "$2" 68 | return 1 69 | fi 70 | else 71 | return 1 72 | fi 73 | } 74 | 75 | init_hostapd () { 76 | HOSTAPD_OPTIONS="-B -P $HOSTAPD_PIDFILE $HOSTAPD_CONF" 77 | HOSTAPD_MESSAGE="$HOSTAPD_BIN $HOSTAPD_OPTIONS" 78 | 79 | test_hostapd_pidfile "$HOSTAPD_BIN" "$HOSTAPD_PIDFILE" && return 0 80 | 81 | hostapd_msg verbose "$HOSTAPD_MESSAGE" 82 | start-stop-daemon --start --oknodo --quiet --exec "$HOSTAPD_BIN" \ 83 | --pidfile "$HOSTAPD_PIDFILE" -- $HOSTAPD_OPTIONS > "$TO_NULL" 84 | 85 | if [ "$?" -ne 0 ]; then 86 | return "$?" 87 | fi 88 | 89 | HOSTAPD_PIDFILE_WAIT=0 90 | until [ -s "$HOSTAPD_PIDFILE" ]; do 91 | if [ "$HOSTAPD_PIDFILE_WAIT" -ge 5 ]; then 92 | hostapd_msg stderr \ 93 | "timeout waiting for pid file creation" 94 | return 1 95 | fi 96 | 97 | HOSTAPD_PIDFILE_WAIT=$(($HOSTAPD_PIDFILE_WAIT + 1)) 98 | sleep 1 99 | done 100 | cat "$HOSTAPD_PIDFILE" > "$HOSTAPD_OMIT_PIDFILE" 101 | 102 | return 0 103 | } 104 | 105 | kill_hostapd () { 106 | HOSTAPD_MESSAGE="stopping $HOSTAPD_PNAME via pidfile: $HOSTAPD_PIDFILE" 107 | 108 | test_hostapd_pidfile "$HOSTAPD_BIN" "$HOSTAPD_PIDFILE" || return 0 109 | 110 | hostapd_msg verbose "$HOSTAPD_MESSAGE" 111 | start-stop-daemon --stop --oknodo --quiet --exec "$HOSTAPD_BIN" \ 112 | --pidfile "$HOSTAPD_PIDFILE" > "$TO_NULL" 113 | 114 | [ "$HOSTAPD_OMIT_PIDFILE" ] && rm -f "$HOSTAPD_OMIT_PIDFILE" 115 | } 116 | 117 | case "$MODE" in 118 | start) 119 | case "$PHASE" in 120 | pre-up) 121 | init_hostapd || exit 1 122 | ;; 123 | *) 124 | hostapd_msg stderr "unknown phase: \"$PHASE\"" 125 | exit 1 126 | ;; 127 | esac 128 | ;; 129 | stop) 130 | case "$PHASE" in 131 | post-down) 132 | kill_hostapd 133 | ;; 134 | *) 135 | hostapd_msg stderr "unknown phase: \"$PHASE\"" 136 | exit 1 137 | ;; 138 | esac 139 | ;; 140 | *) 141 | hostapd_msg stderr "unknown mode: \"$MODE\"" 142 | exit 1 143 | ;; 144 | esac 145 | 146 | exit 0 147 | -------------------------------------------------------------------------------- /files/info/pi64EN-running-services.txt: -------------------------------------------------------------------------------- 1 | Apache 2 | /usr/sbin/apache2 -k start 3 | /usr/sbin/apache2 -k start 4 | /usr/sbin/apache2 -k start 5 | /usr/sbin/apache2 -k start 6 | /usr/sbin/apache2 -k start 7 | /usr/sbin/apache2 -k start 8 | 9 | Python-based 10 | /usr/bin/python2 /home/pi/ka-lite/kalitectl.py start 11 | /usr/bin/python2 /home/pi/ka-lite/kalitectl.py start 12 | sudo python /home/pi/picofssd.py 13 | python /home/pi/picofssd.py 14 | -------------------------------------------------------------------------------- /files/init-functions: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ -f /etc/ka-lite/username ] 4 | then 5 | export KALITE_USER=`cat /etc/ka-lite/username` 6 | if [ "$KALITE_USER" = "" ] 7 | then 8 | export KALITE_USER="ka-lite" 9 | fi 10 | else 11 | export KALITE_USER="ka-lite" 12 | fi 13 | 14 | if [ -f /etc/ka-lite/home ] 15 | then 16 | export KALITE_HOME=`cat /etc/ka-lite/home` 17 | fi 18 | 19 | if [ -f /etc/ka-lite/server_options ] 20 | then 21 | export KALITE_OPTS="`cat /etc/ka-lite/server_options | tr '\n' ' '`" 22 | else 23 | export KALITE_OPTS="" 24 | fi 25 | 26 | export KALITE_COMMAND="kalite" 27 | -------------------------------------------------------------------------------- /files/init-kiwix-service: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Author: Jonathan Field - World Possible 4 | # 5 | # /etc/init.d/kiwix 6 | 7 | ### BEGIN INIT INFO 8 | # Provides: kiwix 9 | # Required-Start: $local_fs $remote_fs $network $syslog $named 10 | # Required-Stop: 11 | # Default-Start: 2 3 4 5 12 | # Default-Stop: 0 1 6 13 | # Short-Description: kiwix server, browse installed RACHEL zim files on port 81 14 | ### END INIT INFO 15 | 16 | set -e 17 | 18 | # we let the www user restart kiwix 19 | #if !(whoami | grep "root" -q) 20 | #then 21 | # echo "You need to be root" 22 | # exit 1 23 | #fi 24 | 25 | PATH=/bin:/usr/bin:/sbin:/usr/sbin 26 | 27 | case "$1" in 28 | start) 29 | /var/kiwix/bin/rachel-kiwix-start.pl 30 | ;; 31 | stop) 32 | killall kiwix-serve 33 | ;; 34 | restart) 35 | # it kills the old process itself 36 | /var/kiwix/bin/rachel-kiwix-start.pl 37 | ;; 38 | status) 39 | ps aux | grep kiwix-serve | grep -v grep 40 | ;; 41 | *) 42 | # log_success_msg wasn't working - replaced with echo 43 | echo "Usage: /etc/init.d/kiwix {start|stop|restart|status}" 44 | exit 1 45 | esac 46 | 47 | -------------------------------------------------------------------------------- /files/init-service: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Author: Foundation for Learning Equality 4 | # 5 | # /etc/init.d/kalite 6 | 7 | ### BEGIN INIT INFO 8 | # Provides: kalite 9 | # Required-Start: $local_fs $remote_fs $network $syslog $named 10 | # Required-Stop: 11 | # Default-Start: 2 3 4 5 12 | # Default-Stop: 0 1 6 13 | # Short-Description: ka-lite daemon, a local Khan Academy content server 14 | ### END INIT INFO 15 | 16 | set -e 17 | 18 | if !(whoami | grep "root" -q) 19 | then 20 | echo "You need to be root" 21 | exit 1 22 | fi 23 | 24 | PATH=/bin:/usr/bin:/sbin:/usr/sbin 25 | 26 | . /lib/lsb/init-functions 27 | 28 | . /etc/default/ka-lite 29 | 30 | case "$1" in 31 | start) 32 | # run ka-lite as another user, the one who generated this file 33 | su $KALITE_USER -s /bin/sh -c "$KALITE_COMMAND start $KALITE_OPTS" 34 | ;; 35 | stop) 36 | su $KALITE_USER -s /bin/sh -c "$KALITE_COMMAND stop $KALITE_OPTS" 37 | ;; 38 | restart) 39 | su $KALITE_USER -s /bin/sh -c "$KALITE_COMMAND stop $KALITE_OPTS" 40 | su $KALITE_USER -s /bin/sh -c "$KALITE_COMMAND start $KALITE_OPTS" 41 | ;; 42 | status) 43 | su $KALITE_USER -s /bin/sh -c "$KALITE_COMMAND status $KALILTE_OPTS" 44 | ;; 45 | *) 46 | log_success_msg "Usage: /etc/init.d/kalite {start|stop|restart|status}" 47 | exit 1 48 | esac 49 | 50 | -------------------------------------------------------------------------------- /files/init-systemd-conf: -------------------------------------------------------------------------------- 1 | [Service] 2 | TimeoutStartSec=10min 3 | -------------------------------------------------------------------------------- /files/interfaces: -------------------------------------------------------------------------------- 1 | auto lo 2 | 3 | iface lo inet loopback 4 | iface eth0 inet dhcp 5 | 6 | #allow-hotplug wlan0 7 | #wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf 8 | #iface default inet dhcp 9 | 10 | iface wlan0 inet static 11 | address 10.10.10.10 12 | netmask 255.255.255.0 13 | 14 | up iptables-restore < /etc/iptables.ipv4.nat 15 | 16 | -------------------------------------------------------------------------------- /files/kiwix-sample-library.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /files/kiwix-sample.zim: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/worldpossible/rachelpiOS/5489bb2fc9f317ee7ba0470c4ffe3e349f059830/files/kiwix-sample.zim -------------------------------------------------------------------------------- /files/my.cnf: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## jeremy added back the below which was in original 64gb pi 4 | 5 | # 6 | # The MySQL database server configuration file. 7 | # 8 | # You can copy this to one of: 9 | # - "/etc/mysql/my.cnf" to set global options, 10 | # - "~/.my.cnf" to set user-specific options. 11 | # 12 | # One can use all long options that the program supports. 13 | # Run program with --help to get a list of available options and with 14 | # --print-defaults to see which it would actually understand and use. 15 | # 16 | # For explanations see 17 | # http://dev.mysql.com/doc/mysql/en/server-system-variables.html 18 | 19 | # This will be passed to all mysql clients 20 | # It has been reported that passwords should be enclosed with ticks/quotes 21 | # escpecially if they contain "#" chars... 22 | # Remember to edit /etc/mysql/debian.cnf when changing the socket location. 23 | [client] 24 | port = 3306 25 | socket = /var/run/mysqld/mysqld.sock 26 | 27 | # Here is entries for some specific programs 28 | # The following values assume you have at least 32M ram 29 | 30 | # This was formally known as [safe_mysqld]. Both versions are currently parsed. 31 | [mysqld_safe] 32 | socket = /var/run/mysqld/mysqld.sock 33 | nice = 0 34 | 35 | [mysqld] 36 | # 37 | # * Basic Settings 38 | # 39 | user = mysql 40 | pid-file = /var/run/mysqld/mysqld.pid 41 | socket = /var/run/mysqld/mysqld.sock 42 | port = 3306 43 | basedir = /usr 44 | datadir = /var/lib/mysql 45 | tmpdir = /tmp 46 | lc-messages-dir = /usr/share/mysql 47 | skip-external-locking 48 | # 49 | # Instead of skip-networking the default is now to listen only on 50 | # localhost which is more compatible and is not less secure. 51 | bind-address = 127.0.0.1 52 | # 53 | # * Fine Tuning 54 | # 55 | key_buffer = 16M 56 | max_allowed_packet = 16M 57 | thread_stack = 192K 58 | thread_cache_size = 8 59 | # This replaces the startup script and checks MyISAM tables if needed 60 | # the first time they are touched 61 | myisam-recover = BACKUP 62 | #max_connections = 100 63 | #table_cache = 64 64 | #thread_concurrency = 10 65 | # 66 | # * Query Cache Configuration 67 | # 68 | query_cache_limit = 1M 69 | query_cache_size = 16M 70 | # 71 | # * Logging and Replication 72 | # 73 | # Both location gets rotated by the cronjob. 74 | # Be aware that this log type is a performance killer. 75 | # As of 5.1 you can enable the log at runtime! 76 | #general_log_file = /var/log/mysql/mysql.log 77 | #general_log = 1 78 | # 79 | # Error logging goes to syslog due to /etc/mysql/conf.d/mysqld_safe_syslog.cnf. 80 | # 81 | # Here you can see queries with especially long duration 82 | #log_slow_queries = /var/log/mysql/mysql-slow.log 83 | #long_query_time = 2 84 | #log-queries-not-using-indexes 85 | # 86 | # The following can be used as easy to replay backup logs or for replication. 87 | # note: if you are setting up a replication slave, see README.Debian about 88 | # other settings you may need to change. 89 | #server-id = 1 90 | #log_bin = /var/log/mysql/mysql-bin.log 91 | expire_logs_days = 10 92 | max_binlog_size = 100M 93 | #binlog_do_db = include_database_name 94 | #binlog_ignore_db = include_database_name 95 | # 96 | # * InnoDB 97 | # 98 | # InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/. 99 | # Read the manual for more InnoDB related options. There are many! 100 | # 101 | # * Security Features 102 | # 103 | # Read the manual, too, if you want chroot! 104 | # chroot = /var/lib/mysql/ 105 | # 106 | # For generating SSL certificates I recommend the OpenSSL GUI "tinyca". 107 | # 108 | # ssl-ca=/etc/mysql/cacert.pem 109 | # ssl-cert=/etc/mysql/server-cert.pem 110 | # ssl-key=/etc/mysql/server-key.pem 111 | 112 | 113 | 114 | [mysqldump] 115 | quick 116 | quote-names 117 | max_allowed_packet = 16M 118 | 119 | [mysql] 120 | #no-auto-rehash # faster start of mysql but no tab completition 121 | 122 | [isamchk] 123 | key_buffer = 16M 124 | 125 | # 126 | # * IMPORTANT: Additional settings that can override those from this file! 127 | # The files must end with '.cnf', otherwise they'll be ignored. 128 | # 129 | !includedir /etc/mysql/conf.d/ 130 | -------------------------------------------------------------------------------- /files/mysql.sh: -------------------------------------------------------------------------------- 1 | # from the command prompt - the password may be root, I believe you had to set it during script install. 2 | mysql -u root -prachel 3 | 4 | #if above didn't work 5 | mysql -u root -proot 6 | 7 | #you will enter mysql 8 | CREATE DATABASE sphider_plus; 9 | 10 | #confirm database exists 11 | SHOW DATABASES; 12 | exit 13 | 14 | 15 | #IMPORT MYSQL DATABASE, AFTER LEAVING MYSQL 16 | mysql -u root -prachel sphider_plus < /home/pi/sphider_plus.sql -------------------------------------------------------------------------------- /files/powering-potential.modules: -------------------------------------------------------------------------------- 1 | en-afristory 2 | en-ebooks 3 | en-hesperian_health 4 | en-iicba 5 | en-infonet 6 | en-kalite 7 | en-medline_plus 8 | en-olpc 9 | en-practical_action 10 | en-scratch 11 | en-understanding_algebra 12 | en-wikipedia_for_schools 13 | en-ck12 14 | en-saylor 15 | en-wikivoyage 16 | en-worldmap 17 | en-math_expression 18 | en-musictheory 19 | en-powertyping 20 | 21 | -------------------------------------------------------------------------------- /files/rachel-kiwix-start.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | use strict; 3 | use warnings; 4 | 5 | #------------------------------------------- 6 | # This script is used to refresh the kiwix library upon restart to 7 | # include everything in the rachel modules directory. It is used 8 | # as part of the kiwix init.d script 9 | # 10 | # Author: Jonathan Field 11 | # Date: 2016-03-19 12 | #------------------------------------------- 13 | 14 | # shut down any existing server 15 | `killall kiwix-serve 2>/dev/null`; 16 | 17 | # remove the existing library 18 | unlink("/var/kiwix/library.xml"); 19 | 20 | # check what rachel modules are hidden by the admin 21 | # -- be careful not to create a db file if there isn't one, 22 | # because then the ownership and permissions will be wrong 23 | my %hidden; 24 | my $db = "/var/www/admin.sqlite"; 25 | if (-f "/var/www/admin/admin.sqlite") { 26 | $db = "/var/www/admin/admin.sqlite"; 27 | } 28 | my $sql = "select moddir from modules where hidden = 1"; 29 | if (-e $db) { 30 | foreach my $mod (split /\n/, `/usr/bin/sqlite3 $db '$sql' 2>/dev/null`) { 31 | ++$hidden{$mod}; 32 | } 33 | } 34 | 35 | # find all the zim files in the modules directoy 36 | # then take only the first from each module 37 | my %zimset; 38 | foreach my $file (`ls /var/www/modules/*/data/content/*.zim* 2>/dev/null`) { 39 | 40 | chomp $file; 41 | 42 | # skip anything that was hidden 43 | my ($moddir) = $file =~ /\/var\/www\/modules\/(.+?)\/data\//; 44 | next if $hidden{$moddir}; 45 | 46 | my ($noext) = $file =~ /([^\/]+)\.zim.*$/; 47 | if (not $zimset{$noext}) { 48 | $zimset{$noext} = $file; 49 | } 50 | 51 | } 52 | 53 | # if there are no zim files in the modules directory 54 | # we start up using the sample zim file (so you can at 55 | # least tell kiwix was installed and runs) 56 | if (not %zimset) { 57 | exit system("/var/kiwix/bin/kiwix-serve --daemon --port=81 --library /var/kiwix/sample-library.xml"); 58 | } 59 | 60 | # go through the zim files and add them to the new library 61 | foreach my $noext (keys(%zimset)) { 62 | my $zim = $zimset{$noext}; 63 | my ($moddir) = $zim =~ /(\/var\/www\/modules\/.+?)\/data\//; 64 | my $cmd = "/var/kiwix/bin/kiwix-manage /var/kiwix/library.xml add $zim"; 65 | if (-d "$moddir/data/index/$noext.zim.idx") { 66 | $cmd .= " --indexPath=$moddir/data/index/$noext.zim.idx"; 67 | } 68 | system($cmd) == 0 or die "Couldn't add $zim to library"; 69 | } 70 | 71 | # try to do it right, but it seems kiwix-serve returns true even on failure :/ 72 | exit system("/var/kiwix/bin/kiwix-serve --daemon --port=81 --library /var/kiwix/library.xml"); 73 | 74 | -------------------------------------------------------------------------------- /files/rachelpios: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | export DEBIAN_FRONTEND=noninteractive 4 | 5 | function assert() { 6 | eval $(printf "%q " "$@") 7 | RET=$? 8 | if [ $RET != 0 ]; then 9 | echo "Error while executing command: '$@'" 10 | exit $RET 11 | fi 12 | } 13 | 14 | function exists() { 15 | if [[ -d $@ ]] || [[ -f $@ ]]; then 16 | return 0; 17 | fi 18 | return 1; 19 | } 20 | 21 | function is_vagrant() { 22 | return $(exists /etc/is_vagrant_vm) 23 | } 24 | 25 | if is_vagrant; then 26 | BASEDIR=/vagrant/files 27 | else 28 | BASEDIR=`pwd` 29 | fi 30 | 31 | assert sudo apt-get update 32 | if ! is_vagrant; then 33 | assert sudo rpi-update 34 | fi 35 | assert sudo apt-get -y dist-upgrade 36 | 37 | 38 | #create wifi hotspot 39 | assert sudo apt-get -y install hostapd udhcpd 40 | assert sudo cp $BASEDIR/udhcpd.conf /etc/udhcpd.conf 41 | assert sudo cp $BASEDIR/udhcpd /etc/default/udhcpd 42 | assert sudo cp $BASEDIR/hostapd /etc/default/hostapd 43 | assert sudo cp $BASEDIR/interfaces /etc/network/interfaces 44 | assert sudo cp $BASEDIR/hostapd.conf /etc/hostapd/hostapd.conf 45 | assert sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward" 46 | assert sudo cp $BASEDIR/sysctl.conf /etc/sysctl.conf 47 | assert sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE 48 | assert sudo iptables -A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT 49 | assert sudo iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT 50 | assert sudo sh -c "iptables-save > /etc/iptables.ipv4.nat" 51 | 52 | # this script should be able to run if the wifi is not present 53 | if ! ifconfig wlan0; then 54 | echo "Wifi device not present; skipping." 55 | else 56 | assert sudo ifconfig wlan0 10.10.10.10 57 | assert sudo service hostapd start 58 | assert sudo service udhcpd start 59 | assert sudo update-rc.d hostapd enable 60 | assert sudo update-rc.d udhcpd enable 61 | assert ./ifupdown.sh 62 | fi 63 | 64 | #install apache php mysql 65 | echo mysql-server mysql-server/root_password password rachelpios | sudo debconf-set-selections 66 | echo mysql-server mysql-server/root_password_again password rachelpios | sudo debconf-set-selections 67 | assert sudo apt-get -y install apache2 libapache2-mod-proxy-html libxml2-dev \ 68 | php5-common libapache2-mod-php5 php5-cgi php5 \ 69 | mysql-server mysql-client php5-mysql 70 | assert sudo cp $BASEDIR/default /etc/apache2/sites-enabled/default 71 | assert sudo cp $BASEDIR/my.cnf /etc/mysql/my.cnf 72 | assert sudo a2enmod php5 proxy proxy_html rewrite # TODO: is this all that's needed? 73 | assert sudo service apache2 restart 74 | 75 | #update hostname 76 | assert sudo cp $BASEDIR/hosts /etc/hosts 77 | assert sudo cp $BASEDIR/hostname /etc/hostname 78 | if ! is_vagrant; then 79 | assert sudo /etc/init.d/hostname.sh 80 | fi 81 | 82 | #install shamba share 83 | assert sudo apt-get -y install samba samba-common-bin 84 | assert sudo mkdir -p /var/www/local 85 | assert sudo chmod 777 /var/www/local 86 | assert sudo cp $BASEDIR/smb.conf /etc/samba/smb.conf 87 | # sudo cp $BASEDIR/dhcp.conf /etc/samba/dhcp.conf 88 | assert sudo cp $BASEDIR/gdbcommands /etc/samba/gdbcommands 89 | 90 | #install h5ai 91 | # TODO: figure out how to download package 92 | # mkdir -p /var/www/_h5ai 93 | # sudo cp $BASEDIR/default /etc/apache2/sites-available/default 94 | # sudo apt-get -y install php5-gd ffmpeg zip imagemagick 95 | # sudo chmod 777 -R /var/www/_h5ai/cache/ 96 | 97 | #install base www files 98 | assert sudo rm -fr /var/www/html 99 | assert sudo git clone https://github.com/rachelproject/contentshell /var/www/html 100 | assert sudo chown -R www-data.www-data /var/www/html 101 | #if ! is_vagrant; then 102 | # assert sudo cp -r $BASEDIR/www/* /var/www/ 103 | #fi 104 | 105 | #put realtek drivers in place if needed 106 | if ! is_vagrant; then 107 | assert sudo cp $BASEDIR/hostapd_RTL8188CUS /home/pi/hostapd_RTL 108 | assert sudo cp $BASEDIR/realtek.sh /home/pi/Desktop/realtek.sh 109 | assert sudo cp $BASEDIR/hostapd_realtek.conf /home/pi/hostapd_realtek.conf 110 | fi 111 | 112 | #redo wifi enable for good measure 113 | if ! is_vagrant; then 114 | if ifconfig wlan0; then 115 | sudo ifconfig wlan0 10.10.10.10 116 | sudo service hostapd start 117 | sudo service udhcpd start 118 | sudo update-rc.d hostapd enable 119 | sudo update-rc.d udhcpd enable 120 | fi 121 | fi 122 | 123 | #install kiwix 124 | # download kiwix-server-0.9-rc2-linux-armv5tejl.tar.bz2 125 | # tar -xjvf above file 126 | 127 | echo "Setup complete." 128 | 129 | -------------------------------------------------------------------------------- /files/realtek.sh: -------------------------------------------------------------------------------- 1 | sudo mv /usr/sbin/hostapd /usr/sbin/hostapd.original 2 | sudo ln -sf /home/pi/hostapd_RTL /usr/sbin/hostapd 3 | sudo chown root.root /usr/sbin/hostapd 4 | sudo chmod 755 /usr/sbin/hostapd 5 | 6 | sudo cp /home/pi/hostapd_realtek.conf /etc/hostapd/hostapd.conf 7 | 8 | sudo ifdown wlan0 9 | sudo service hostapd stop 10 | sudo service udhcpd stop 11 | sudo ifconfig wlan0 10.10.10.10 12 | sudo service hostapd start 13 | sudo service udhcpd start 14 | sudo ifconfig wlan0 10.10.10.10 15 | sudo update-rc.d hostapd enable 16 | sudo update-rc.d udhcpd enable -------------------------------------------------------------------------------- /files/realtek.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/worldpossible/rachelpiOS/5489bb2fc9f317ee7ba0470c4ffe3e349f059830/files/realtek.txt -------------------------------------------------------------------------------- /files/sysctl.conf: -------------------------------------------------------------------------------- 1 | # 2 | # /etc/sysctl.conf - Configuration file for setting system variables 3 | # See /etc/sysctl.d/ for additonal system variables 4 | # See sysctl.conf (5) for information. 5 | # 6 | 7 | #kernel.domainname = example.com 8 | 9 | # Uncomment the following to stop low-level messages on console 10 | kernel.printk = 3 4 1 3 11 | 12 | ##############################################################3 13 | # Functions previously found in netbase 14 | # 15 | 16 | # Uncomment the next two lines to enable Spoof protection (reverse-path filter) 17 | # Turn on Source Address Verification in all interfaces to 18 | # prevent some spoofing attacks 19 | #net.ipv4.conf.default.rp_filter=1 20 | #net.ipv4.conf.all.rp_filter=1 21 | 22 | # Uncomment the next line to enable TCP/IP SYN cookies 23 | # See http://lwn.net/Articles/277146/ 24 | # Note: This may impact IPv6 TCP sessions too 25 | #net.ipv4.tcp_syncookies=1 26 | 27 | # Uncomment the next line to enable packet forwarding for IPv4 28 | net.ipv4.ip_forward=1 29 | 30 | # Uncomment the next line to enable packet forwarding for IPv6 31 | # Enabling this option disables Stateless Address Autoconfiguration 32 | # based on Router Advertisements for this host 33 | #net.ipv6.conf.all.forwarding=1 34 | 35 | 36 | ################################################################### 37 | # Additional settings - these settings can improve the network 38 | # security of the host and prevent against some network attacks 39 | # including spoofing attacks and man in the middle attacks through 40 | # redirection. Some network environments, however, require that these 41 | # settings are disabled so review and enable them as needed. 42 | # 43 | # Do not accept ICMP redirects (prevent MITM attacks) 44 | #net.ipv4.conf.all.accept_redirects = 0 45 | #net.ipv6.conf.all.accept_redirects = 0 46 | # _or_ 47 | # Accept ICMP redirects only for gateways listed in our default 48 | # gateway list (enabled by default) 49 | # net.ipv4.conf.all.secure_redirects = 1 50 | # 51 | # Do not send ICMP redirects (we are not a router) 52 | #net.ipv4.conf.all.send_redirects = 0 53 | # 54 | # Do not accept IP source route packets (we are not a router) 55 | #net.ipv4.conf.all.accept_source_route = 0 56 | #net.ipv6.conf.all.accept_source_route = 0 57 | # 58 | # Log Martian Packets 59 | #net.ipv4.conf.all.log_martians = 1 60 | # 61 | 62 | # rpi tweaks 63 | vm.swappiness=1 64 | vm.min_free_kbytes = 8192 65 | -------------------------------------------------------------------------------- /files/udhcpd: -------------------------------------------------------------------------------- 1 | # Comment the following line to enable 2 | #DHCPD_ENABLED="no" 3 | 4 | # Options to pass to busybox' udhcpd. 5 | # 6 | # -S Log to syslog 7 | # -f run in foreground 8 | 9 | DHCPD_OPTS="-S" 10 | -------------------------------------------------------------------------------- /files/udhcpd.conf: -------------------------------------------------------------------------------- 1 | # Sample udhcpd configuration file (/etc/udhcpd.conf) 2 | 3 | # The start and end of the IP lease block 4 | start 10.10.10.11 #default: 192.168.0.20 5 | end 10.10.10.199 #default: 192.168.0.254 6 | 7 | # The interface that udhcpd will use 8 | interface wlan0 #default: eth0 9 | 10 | # The maximim number of leases (includes addressesd reserved 11 | # by OFFER's, DECLINE's, and ARP conficts 12 | 13 | #max_leases 254 #default: 254 14 | 15 | 16 | # If remaining is true (default), udhcpd will store the time 17 | # remaining for each lease in the udhcpd leases file. This is 18 | # for embedded systems that cannot keep time between reboots. 19 | # If you set remaining to no, the absolute time that the lease 20 | # expires at will be stored in the dhcpd.leases file. 21 | 22 | #remaining yes #default: yes 23 | remaining yes #default: yes 24 | 25 | 26 | # The time period at which udhcpd will write out a dhcpd.leases 27 | # file. If this is 0, udhcpd will never automatically write a 28 | # lease file. (specified in seconds) 29 | 30 | #auto_time 7200 #default: 7200 (2 hours) 31 | 32 | 33 | # The amount of time that an IP will be reserved (leased) for if a 34 | # DHCP decline message is received (seconds). 35 | 36 | #decline_time 3600 #default: 3600 (1 hour) 37 | 38 | 39 | # The amount of time that an IP will be reserved (leased) for if an 40 | # ARP conflct occurs. (seconds 41 | 42 | #conflict_time 3600 #default: 3600 (1 hour) 43 | 44 | 45 | # How long an offered address is reserved (leased) in seconds 46 | 47 | #offer_time 60 #default: 60 (1 minute) 48 | 49 | # If a lease to be given is below this value, the full lease time is 50 | # instead used (seconds). 51 | 52 | #min_lease 60 #defult: 60 53 | 54 | 55 | # The location of the leases file 56 | 57 | #lease_file /var/lib/misc/udhcpd.leases #defualt: /var/lib/misc/udhcpd.leases 58 | 59 | # The location of the pid file 60 | #pidfile /var/run/udhcpd.pid #default: /var/run/udhcpd.pid 61 | 62 | # Everytime udhcpd writes a leases file, the below script will be called. 63 | # Useful for writing the lease file to flash every few hours. 64 | 65 | #notify_file #default: (no script) 66 | 67 | #notify_file dumpleases # <--- useful for debugging 68 | 69 | # The following are bootp specific options, setable by udhcpd. 70 | 71 | #siaddr 192.168.0.22 #default: 0.0.0.0 72 | 73 | #sname zorak #default: (none) 74 | 75 | #boot_file /var/nfs_root #default: (none) 76 | 77 | # The remainer of options are DHCP options and can be specifed with the 78 | # keyword 'opt' or 'option'. If an option can take multiple items, such 79 | # as the dns option, they can be listed on the same line, or multiple 80 | # lines. The only option with a default is 'lease'. 81 | 82 | #Examles 83 | opt dns 8.8.8.8 8.8.4.4 # Google Public DNS servers 84 | option subnet 255.255.255.0 85 | opt router 10.10.10.10 86 | #opt wins 192.168.10.10 87 | option domain local 88 | option lease 864000 # 10 days of seconds 89 | 90 | 91 | # Currently supported options, for more info, see options.c 92 | #opt subnet 93 | #opt timezone 94 | #opt router 95 | #opt timesrv 96 | #opt namesrv 97 | #opt dns 98 | #opt logsrv 99 | #opt cookiesrv 100 | #opt lprsrv 101 | #opt bootsize 102 | #opt domain 103 | #opt swapsrv 104 | #opt rootpath 105 | #opt ipttl 106 | #opt mtu 107 | #opt broadcast 108 | #opt wins 109 | #opt lease 110 | #opt ntpsrv 111 | #opt tftp 112 | #opt bootfile 113 | #opt wpad 114 | 115 | # Static leases map 116 | #static_lease 00:60:08:11:CE:4E 192.168.0.54 117 | #static_lease 00:60:08:11:CE:3E 192.168.0.44 118 | 119 | 120 | -------------------------------------------------------------------------------- /installer.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import sys 4 | import os 5 | import subprocess 6 | import argparse 7 | import shutil 8 | import urllib 9 | import argparse 10 | 11 | argparser = argparse.ArgumentParser() 12 | argparser.add_argument( "--khan-academy", 13 | choices=["none", "ka-lite"], 14 | default="ka-lite", 15 | help="Select Khan Academy package to install (default = \"ka-lite\")") 16 | argparser.add_argument("--no-wifi", 17 | dest="install_wifi", 18 | action="store_false", 19 | help="Do not configure local wifi hotspot.") 20 | args = argparser.parse_args() 21 | 22 | def install_kalite(): 23 | sudo("apt-get install -y python-pip") or die("Unable to install pip.") 24 | sudo("pip install ka-lite-static") or die("Unable to install KA-Lite") 25 | sudo("printf '\nyes\nyes\nno\n' | sudo kalite manage setup --username=rachel --password=rachel --hostname=rachel --description=rachel") 26 | sudo("mkdir -p /etc/ka-lite") or die("Unable to create /etc/ka-lite configuration directory.") 27 | cp("files/init-functions", "/etc/default/ka-lite") or die("Unable to install KA-Lite configuration script.") 28 | cp("files/init-service", "/etc/init.d/ka-lite") or die("Unable to install KA-Lite service.") 29 | sudo("chmod +x /etc/init.d/ka-lite") or die("Unable to set permissions on KA-Lite service.") 30 | sudo("sh -c 'echo root >/etc/ka-lite/username'") or die("Unable to configure the userid of the KA-Lite process.") 31 | if exists("/etc/systemd"): 32 | sudo("mkdir -p /etc/systemd/system/ka-lite.service.d") or die("Unable to create KA-Lite service options directory.") 33 | cp("files/init-systemd-conf", "/etc/systemd/system/ka-lite.service.d/10-extend-timeout.conf") or die("Unable to increase KA-Lite service startup timeout.") 34 | sudo("update-rc.d ka-lite defaults") or die("Unable to register the KA-Lite service.") 35 | sudo("service ka-lite start") or die("Unable to start the KA-Lite service.") 36 | sudo("sh -c '/usr/local/bin/kalite --version > /etc/kalite-version'") or die("Unable to record kalite version") 37 | return True 38 | 39 | def install_kiwix(): 40 | sudo("mkdir -p /var/kiwix/bin") or die("Unable to make create kiwix directories") 41 | kiwix_version = "0.9" 42 | sudo("sh -c 'wget -O - http://downloads.sourceforge.net/project/kiwix/"+kiwix_version+"/kiwix-server-"+kiwix_version+"-linux-armv5tejl.tar.bz2 | tar xj -C /var/kiwix/bin'") or die("Unable to download kiwix-server") 43 | # the reason we have a sample zim file is so that if no modules 44 | # are installed you can still tell that kiwix is running 45 | cp("files/kiwix-sample.zim", "/var/kiwix/sample.zim") or die("Unable to install kiwix sample zim") 46 | cp("files/kiwix-sample-library.xml", "/var/kiwix/sample-library.xml") or die("Unable to install kiwix sample library") 47 | cp("files/rachel-kiwix-start.pl", "/var/kiwix/bin/rachel-kiwix-start.pl") or die("Unable to coppy rachel-kiwix-start wrapper") 48 | sudo("chmod +x /var/kiwix/bin/rachel-kiwix-start.pl") or die("Unable to set permissions on rachek-kiwix-start wrapper") 49 | cp("files/init-kiwix-service", "/etc/init.d/kiwix") or die("Unable to install kiwix service") 50 | sudo("chmod +x /etc/init.d/kiwix") or die("Unable to set permissions on kiwix service.") 51 | sudo("update-rc.d kiwix defaults") or die("Unable to register the kiwix service.") 52 | sudo("service kiwix start") or die("Unable to start the kiwix service.") 53 | sudo("sh -c 'echo "+kiwix_version+" >/etc/kiwix-version'") or die("Unable to record kiwix version.") 54 | return True 55 | 56 | def exists(p): 57 | return os.path.isfile(p) or os.path.isdir(p) 58 | 59 | def cmd(c): 60 | result = subprocess.Popen(c, shell=True, stdin=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=True) 61 | try: 62 | result.communicate() 63 | except KeyboardInterrupt: 64 | pass 65 | return (result.returncode == 0) 66 | 67 | def sudo(s): 68 | return cmd("sudo DEBIAN_FRONTEND=noninteractive %s" % s) 69 | 70 | def die(d): 71 | print "Error: " + str(d) 72 | sys.exit(1) 73 | 74 | def is_vagrant(): 75 | return os.path.isfile("/etc/is_vagrant_vm") 76 | 77 | def wifi_present(): 78 | if is_vagrant(): 79 | return False 80 | return exists("/sys/class/net/wlan0") 81 | 82 | def basedir(): 83 | bindir = os.path.dirname(sys.argv[0]) 84 | if not bindir: 85 | bindir = "." 86 | if exists(bindir + "/files"): 87 | return bindir 88 | else: 89 | return "/tmp/rachel_installer" 90 | 91 | def cp(s, d): 92 | return sudo("cp %s/%s %s" % (basedir(), s, d)) 93 | 94 | sudo("apt-get update -y") or die("Unable to update.") 95 | sudo("apt-get install -y git") or die("Unable to install Git.") 96 | 97 | # Clone the repo. 98 | if basedir() == "/tmp/rachel_installer": 99 | sudo("rm -fr /tmp/rachel_installer") 100 | sudo("git clone --depth 1 https://github.com/rachelproject/rachelpios.git /tmp/rachel_installer") or die("Unable to clone RACHEL installer repository.") 101 | 102 | if is_vagrant(): 103 | sudo("mv /vagrant/sources.list /etc/apt/sources.list") 104 | # Update and upgrade OS 105 | sudo("apt-get update -y") or die("Unable to update.") 106 | sudo("apt-get dist-upgrade -y") or die("Unable to upgrade Raspbian.") 107 | 108 | 109 | # Update Raspi firmware 110 | if not is_vagrant(): 111 | sudo("yes | sudo rpi-update") or die("Unable to upgrade Raspberry Pi firmware") 112 | 113 | # Setup wifi hotspot 114 | if wifi_present() and args.install_wifi: 115 | sudo("apt-get -y install hostapd udhcpd") or die("Unable install hostapd and udhcpd.") 116 | cp("files/udhcpd.conf", "/etc/udhcpd.conf") or die("Unable to copy UDHCPd configuration (udhcpd.conf)") 117 | cp("files/udhcpd", "/etc/default/udhcpd") or die("Unable to copy UDHCPd configuration (udhcpd)") 118 | cp("files/hostapd", "/etc/default/hostapd") or die("Unable to copy hostapd configuration (hostapd)") 119 | cp("files/hostapd.conf", "/etc/hostapd/hostapd.conf") or die("Unable to copy hostapd configuration (hostapd.conf)") 120 | sudo("sh -c 'echo 1 > /proc/sys/net/ipv4/ip_forward'") or die("Unable to set ipv4 forwarding") 121 | cp("files/sysctl.conf", "/etc/sysctl.conf") or die("Unable to copy sysctl configuration (sysctl.conf)") 122 | sudo("iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE") or die("Unable to set iptables MASQUERADE on eth0.") 123 | sudo("iptables -A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT") or die("Unable to forward wlan0 to eth0.") 124 | sudo("iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT") or die("Unable to forward wlan0 to eth0.") 125 | sudo("sh -c 'iptables-save > /etc/iptables.ipv4.nat'") or die("Unable to save iptables configuration.") 126 | sudo("ifconfig wlan0 10.10.10.10") or die("Unable to set wlan0 IP address (10.10.10.10)") 127 | sudo("service hostapd start") or die("Unable to start hostapd service.") 128 | sudo("service udhcpd start") or die("Unable to start udhcpd service.") 129 | sudo("update-rc.d hostapd enable") or die("Unable to enable hostapd on boot.") 130 | sudo("update-rc.d udhcpd enable") or die("Unable to enable UDHCPd on boot.") 131 | # udhcpd wasn't starting properly at boot (probably starting before interface was ready) 132 | # for now we we just force it to restart after setting the interface 133 | sudo("sh -c 'sed -i \"s/^exit 0//\" /etc/rc.local'") or die("Unable to remove exit from end of /etc/rc.local") 134 | sudo("sh -c 'echo ifconfig wlan0 10.10.10.10 >> /etc/rc.local; echo service udhcpd restart >> /etc/rc.local;'") or die("Unable to setup udhcpd reset at boot.") 135 | sudo("sh -c 'echo exit 0 >> /etc/rc.local'") or die("Unable to replace exit to end of /etc/rc.local") 136 | #sudo("ifdown eth0 && ifdown wlan0 && ifup eth0 && ifup wlan0") or die("Unable to restart network interfaces.") 137 | 138 | # Setup LAN 139 | if not is_vagrant(): 140 | cp("files/interfaces", "/etc/network/interfaces") or die("Unable to copy network interface configuration (interfaces)") 141 | 142 | # Install web platform 143 | sudo("echo mysql-server mysql-server/root_password password rachel | sudo debconf-set-selections") or die("Unable to set default MySQL password.") 144 | sudo("echo mysql-server mysql-server/root_password_again password rachel | sudo debconf-set-selections") or die("Unable to set default MySQL password (again).") 145 | sudo("apt-get -y install apache2 libapache2-mod-proxy-html libxml2-dev \ 146 | php5-common libapache2-mod-php5 php5-cgi php5 php5-dev php-pear \ 147 | mysql-server mysql-client php5-mysql sqlite3 php5-sqlite") or die("Unable to install web platform.") 148 | sudo("yes '' | sudo pecl install -f stem") or die("Unable to install php stemmer") 149 | sudo("sh -c 'echo \'extension=stem.so\' >> /etc/php5/cli/php.ini'") or die("Unable to install stemmer CLI config") 150 | sudo("sh -c 'echo \'extension=stem.so\' >> /etc/php5/apache2/php.ini'") or die("Unable to install stemmer Apache config") 151 | sudo("sh -c 'sed -i \"s/upload_max_filesize *= *.*/upload_max_filesize = 512M/\" /etc/php5/apache2/php.ini'") or die("Unable to increase upload_max_filesize in apache2/php.ini") 152 | sudo("sh -c 'sed -i \"s/post_max_size *= *.*/post_max_size = 512M/\" /etc/php5/apache2/php.ini'") or die("Unable to increase post_max_size in apache2/php.ini") 153 | sudo("service apache2 stop") or die("Unable to stop Apache2.") 154 | #cp("files/apache2.conf", "/etc/apache2/apache2.conf") or die("Unable to copy Apache2.conf") 155 | cp("files/default", "/etc/apache2/sites-available/contentshell.conf") or die("Unable to set default Apache site.") 156 | sudo("a2dissite 000-default") or die("Unable to disable default Apache site.") 157 | sudo("a2ensite contentshell.conf") or die("Unable to enable contenthell Apache site.") 158 | cp("files/my.cnf", "/etc/mysql/my.cnf") or die("Unable to copy MySQL server configuration.") 159 | sudo("a2enmod php5 proxy proxy_html rewrite") or die("Unable to enable Apache2 dependency modules.") 160 | if exists("/etc/apache2/mods-available/xml2enc.load"): 161 | sudo("a2enmod xml2enc") or die("Unable to enable Apache2 xml2enc module.") 162 | sudo("service apache2 restart") or die("Unable to restart Apache2.") 163 | 164 | # Install web frontend 165 | sudo("rm -fr /var/www") or die("Unable to delete existing default web application (/var/www).") 166 | sudo("git clone --depth 1 https://github.com/rachelproject/contentshell /var/www") or die("Unable to download RACHEL web application.") 167 | sudo("chown -R www-data.www-data /var/www") or die("Unable to set permissions on RACHEL web application (/var/www).") 168 | sudo("sh -c \"umask 0227; echo 'www-data ALL=(ALL) NOPASSWD: /sbin/shutdown' >> /etc/sudoers.d/www-shutdown\"") or die("Unable to add www-data to sudoers for web shutdown") 169 | sudo("usermod -a -G adm www-data") or die("Unable to add www-data to adm group (so stats.php can read logs)") 170 | 171 | # Extra wifi driver configuration 172 | if wifi_present() and args.install_wifi: 173 | cp("files/hostapd_RTL8188CUS", "/etc/hostapd/hostapd.conf.RTL8188CUS") or die("Unable to copy RTL8188CUS hostapd configuration.") 174 | cp("files/hostapd_realtek.conf", "/etc/hostapd/hostapd.conf.realtek") or die("Unable to copy realtek hostapd configuration.") 175 | 176 | if args.khan_academy == "ka-lite": 177 | install_kalite() or die("Unable to install KA-Lite.") 178 | 179 | # install the kiwix server (but not content) 180 | install_kiwix() 181 | 182 | # Change login password to rachel 183 | if not is_vagrant(): 184 | sudo("sh -c 'echo pi:rachel | chpasswd'") or die("Unable to change 'pi' password.") 185 | 186 | # Update hostname (LAST!) 187 | if not is_vagrant(): 188 | cp("files/hosts", "/etc/hosts") or die("Unable to copy hosts file.") 189 | cp("files/hostname", "/etc/hostname") or die("Unable to copy hostname file.") 190 | sudo("/etc/init.d/hostname.sh") or die("Unable to set hostname.") 191 | 192 | # record the version of the installer we're using - this must be manually 193 | # updated when you tag a new installer 194 | sudo("sh -c 'echo piOS-2016.04.19 > /etc/rachelinstaller-version'") or die("Unable to record rachelpiOS version.") 195 | 196 | print "RACHEL has been successfully installed. It can be accessed at: http://10.10.10.10/" 197 | --------------------------------------------------------------------------------