{"id":13572548,"url":"https://github.com/18F/laptop","last_synced_at":"2025-04-04T10:30:49.339Z","repository":{"id":27947104,"uuid":"31439762","full_name":"18F/laptop","owner":"18F","description":"DEPRECATED: A shell script which turns your Mac into an awesome web development machine.","archived":true,"fork":false,"pushed_at":"2022-06-13T20:29:51.000Z","size":254,"stargazers_count":317,"open_issues_count":11,"forks_count":91,"subscribers_count":144,"default_branch":"master","last_synced_at":"2024-04-15T01:57:13.589Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://github.com/18F/handbook/pull/2186","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/18F.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-27T21:23:51.000Z","updated_at":"2024-03-12T12:39:07.000Z","dependencies_parsed_at":"2022-09-12T00:50:32.326Z","dependency_job_id":null,"html_url":"https://github.com/18F/laptop","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/18F%2Flaptop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/18F%2Flaptop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/18F%2Flaptop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/18F%2Flaptop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/18F","download_url":"https://codeload.github.com/18F/laptop/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223123781,"owners_count":17091169,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T14:01:26.531Z","updated_at":"2024-11-05T05:31:32.090Z","avatar_url":"https://github.com/18F.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"Laptop\n======\n[![Build Status](https://circleci.com/gh/18F/laptop.svg)](https://circleci.com/gh/18F/laptop)\n\nLaptop is a script to set up an OS X computer for web development, and to keep\nit up to date.\n\nIt can be run multiple times on the same machine safely.\nIt installs, upgrades, or skips packages\nbased on what is already installed on the machine.\n\nRequirements\n------------\n\nWe support:\n\n* [macOS Sierra (10.12)](https://www.apple.com/osx/)\n* OS X El Capitan (10.11)\n* OS X Yosemite (10.10)\n* OS X Mavericks (10.9)\n\nOlder versions may work but aren't regularly tested. Bug reports for older\nversions are welcome.\n\nInstall\n-------\n\nBegin by opening the Terminal application on your Mac. The easiest way to open\nan application in OS X is to search for it via [Spotlight]. The default\nkeyboard shortcut for invoking Spotlight is `command-Space`. Once Spotlight\nis up, just start typing the first few letters of the app you are looking for,\nand once it appears, press `return` to launch it.\n\nIn your Terminal window, copy and paste the command below, then press `return`.\n\n```sh\nbash \u003c(curl -s https://raw.githubusercontent.com/18F/laptop/master/laptop)\n```\nThe [script](https://github.com/18F/laptop/blob/master/mac) itself is\navailable in this repo for you to review if you want to see what it does\nand how it works.\n\nNote that the script will ask you to enter your OS X password at various\npoints. This is the same password that you use to log in to your Mac.\nIf you don't already have it installed, GitHub for Mac will launch\nautomatically at the end of the script so you can set up everything you'll\nneed to push code to GitHub.\n\n**Once the script is done, make sure to quit and relaunch Terminal.**\n\nMore [detailed instructions with a video][video] are available in the Wiki.\n\nIt is highly recommended to run the script regularly to keep your computer\nup to date. Once the script has been installed, you'll be able to run it\nat your convenience by typing `laptop` and hitting `return` in your Terminal.\n\n[Spotlight]: https://support.apple.com/en-us/HT204014\n[video]: https://github.com/18F/laptop/wiki/Detailed-installation-instructions-with-video\n\n### Want to install just git-seekret?\nIn your terminal window, copy and paste the following line, and press `return`:\n```sh\ncurl -s https://raw.githubusercontent.com/18F/laptop/master/seekrets-install | bash -\n```\nNote that the script may ask you to enter your password. This is the same password that you use to log in to your computer.\n\n\u003e git-seekret requires git 2.9.1 or higher.  Some versions of Ubuntu ship with an older version.  To update your git before installing git-seekret:\n\u003e \n\u003e ```\n\u003e sudo add-apt-repository ppa:git-core/ppa\n\u003e sudo apt-get update\n\u003e ```\n\n**git-seekret will install global git hooks into ~/.git-support/hooks.   To restore pre-existing git hooks, it is recommended to save pre-existing hooks into a separate directory and to copy those hooks into ~/.git-support/hooks after git-seekret is installed.**\n\nDevelopment\n-----------\n\n### Git Seekret\n\nThis section covers contributing and developing new rulesets for `git-seekrets`.\n\nThe rules installed by the `seekret-install` script are located in the `seekret-rules` directory at the root of this repository.  Inside each rule file is a list of rules.  The rule file can be considered a tree with the rules as the leaves of the tree.\n\nAn example rule file is below:\n\n```yaml\nthing_to_match:\n  match: r[egx]{2,}p?\n  unmatch:\n    - some_prefix\\s*r[egx]{2,}p?\n    - r[egx]{2,}p?\\s*some_suffix\n```\n\nUsing the example above, let's break down each stanza:\n\n- `thing_to_match` : The name of the rule we'd like to match / unmatch. This can be anything that makes sense for the `.rule` file being created / edited.\n- `match` : A single regular expression which will be used to match any rules for the name above.\n- `unmatch` : A list of regular expressions which will be used to unmatch anything that the `match` rule matches.\n\nFeel free to submit an issue/create a pull request in order to submit a new ruleset or to apply a modifification to an existing ruleset.\n\n#### Testing Git Seekrets\n\nYou can test secret rulesets using BATS for automated testing and manually using the installation script.\n\n##### Let's talk about BATS\n\nPlease read the [local BATS documentation](./test).\n\n##### Let's talk about local manual testing\n\nTo install the `*.rule` files located in the repo, just run the installation script locally. This will update your local `~/.git-support/seekret-rules` directory with the changes in this repository.\n\n```shell\n./seekrets-install\n```\n\nYou should now be able to run the check within any repository on your machine.\n\n```shell\ngit seekret check -c 0 # check for secrets within commit history\n```\n\n```shell\ngit seekret check -s # check for secrets within staged files\n```\n\nDebugging\n---------\n\nYour last Laptop run will be saved to `~/laptop.log`. Read through it to see if\nyou can debug the issue yourself. If not, copy and paste the entire log into a\n[new GitHub Issue](https://github.com/18F/laptop/issues/new) for us.\n\n#### Git Seekrets False Positives\n\nSometimes the `git-seekrets` rules may indicate a false positive and match\nthings that aren't actually secrets. This can happen if the regular\nexpressions used to `match` and `unmatch` are too strict.\n\nMake sure you have [the latest rulesets from this repository by running the\ngit-seekrets installation script](#want-to-install-just-git-seekret).\n\nIf the ruleset is still triggering a false positive, please open an issue\n(or a pull request if you know how to fix the regular expression), and\ninclude the text that is being treated as a false positive, along with the\nrules installed on your computer. Please run this command to output\nyour current rules, then copy and paste them into the GitHub issue:\n\n```shell\ncat ~/.git-support/seekret-rules/*.rule\n```\n\nWhat it sets up\n---------------\n\n* [ChromeDriver] for headless website testing\n* [chruby] for managing [Ruby] versions\n* [Cloud Foundry CLI] for command line access to 18F's Cloud Foundry-based application platform\n* [Docker] for all your containerization needs\n* [git-seekret] for preventing you from committing passwords and other sensitive information to a git repository\n* [GitHub Desktop] for setting up your SSH keys automatically\n* [Homebrew] for managing operating system libraries\n* [Homebrew Cask] for quickly installing Mac apps from the command line\n* [Homebrew Services] so you can easily stop, start, and restart services\n* [hub] for interacting with the GitHub API\n* [nvm] for managing Node.js versions if you do not have [Node.js] already installed (Includes latest [Node.js] and [NPM], for running apps and installing JavaScript packages)\n* [pyenv] for managing Python versions if you do not have [Python] already installed (includes the latest 3.x [Python])\n* [ruby-install] for installing different versions of Ruby\n* [Slack] for communicating with your team\n* [The Silver Searcher] for finding things in files\n* [Virtualenv] for creating isolated Python environments (via [pyenv] if it is installed)\n* [Virtualenvwrapper] for extending Virtualenv (via [pyenv] if it is installed)\n* [Zsh] as your shell\n\n[Bundler]: http://bundler.io/\n[ChromeDriver]: http://chromedriver.chromium.org/\n[chruby]: https://github.com/postmodern/chruby\n[Cloud Foundry CLI]: https://github.com/cloudfoundry/cli\n[Docker]: https://www.docker.com/\n[git-seekret]: https://github.com/18F/git-seekret\n[Homebrew]: http://brew.sh/\n[Homebrew Cask]: https://github.com/Homebrew/homebrew-cask\n[Homebrew Services]: https://github.com/Homebrew/homebrew-services\n[hub]: https://github.com/github/hub\n[n]: https://github.com/tj/n\n[Node.js]: http://nodejs.org/\n[NPM]: https://www.npmjs.org/\n[Python]: https://www.python.org/\n[pyenv]: https://github.com/yyuu/pyenv/\n[Ruby]: https://www.ruby-lang.org/en/\n[ruby-install]: https://github.com/postmodern/ruby-install\n[Slack]: https://slack.com/\n[The Silver Searcher]: https://github.com/ggreer/the_silver_searcher\n[Virtualenv]: https://virtualenv.pypa.io/en/latest/\n[Virtualenvwrapper]: http://virtualenvwrapper.readthedocs.org/en/latest/#\n[Zsh]: http://www.zsh.org/\nIt should take less than 15 minutes to install (depends on your machine and\ninternet connection).\n\nCustomize in `~/.laptop.local` and `~/Brewfile.local`\n-----------------------------------------------------\n\nYour `~/.laptop.local` is run at the end of the `mac` script.\nPut your customizations there. If you want to install additional\ntools or Mac apps with Homebrew, add them to your `~/Brewfile.local`.\nThis repo already contains a [.laptop.local] and [Brewfile.local]\nyou can use to get started.\n\n```sh\n# Go to your OS X user's root directory\ncd ~\n\n# Download the sample files to your computer\ncurl --remote-name https://raw.githubusercontent.com/18F/laptop/master/.laptop.local\ncurl --remote-name https://raw.githubusercontent.com/18F/laptop/master/Brewfile.local\n```\n\nIt lets you install the following tools and apps:\n\n* [VSCode] - Microsoft's open source text editor\n* [Atom] - GitHub's open source text editor\n* [Sublime Text 3] for coding all the things\n* [Vim] for those who prefer the command line\n* [Exuberant Ctags] for indexing files for vim tab completion\n* [Firefox] for testing your website on a browser other than Chrome\n* [iTerm2] - an awesome replacement for the OS X Terminal\n* [reattach-to-user-namespace] to allow copy and paste from Tmux\n* [Tmux] for saving project state and switching between projects\n* [Spectacle] - automatic window manipulation\n\n[.laptop.local]: https://github.com/18F/laptop/blob/master/.laptop.local\n[Brewfile.local]: https://github.com/18F/laptop/blob/master/Brewfile.local\n[VSCode]: https://code.visualstudio.com/\n[Atom]: https://atom.io/\n[Sublime Text 3]: http://www.sublimetext.com/3\n[Exuberant Ctags]: http://ctags.sourceforge.net/\n[Firefox]: https://www.mozilla.org/en-US/firefox/new/\n[iTerm2]: http://iterm2.com/\n[reattach-to-user-namespace]: https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard\n[Tmux]: https://tmux.github.io/\n[Vim]: http://www.vim.org/\n[Spectacle]: https://www.spectacleapp.com/\n\nWrite your customizations such that they can be run safely more than once.\nSee the `mac` script for examples.\n\nLaptop functions such as `fancy_echo` and `gem_install_or_update` can be used\nin your `~/.laptop.local`.\n\nWhat about background services (Redis, Postgres, MySQL, etc.)?\n----------------------------------------------------------\nThe script does not automatically install services like databases because you\nmay not need any particular one, or you may need specific versions, not just\nthe latest.  For services, we recommend using [Docker].  For example, you can\nuse the [`docker run`] command to start a service in a container and make the\ncontainer's port available to your local machine:\n\n```shell\ndocker run -p 5432 postgres:10.6\n```\n\nYou can also use [Docker Compose] to define your app's containers and their\nrelationships, cutting out the need to manually setup each service.\n\n[Docker Compose]: https://docs.docker.com/compose/\n[docker run]: https://docs.docker.com/engine/reference/run/#expose-incoming-ports\n\nHow to switch your shell back to bash from zsh (or vice versa)\n--------------------------------------------------------------\n1. Find out which shell you're currently running: `echo $SHELL`\n2. Find out the location of the shell you want to switch to. For example, if\n   you want to switch to `bash`, run `which bash`.\n3. Verify if the shell location is included in `/etc/shells`.\n   Run `cat /etc/shells` to see the contents of the file.\n4. If the location of the shell is included, run\n   `chsh -s [the location of the shell]`.\n   For example, if `which bash` returned `/bin/bash`, you would run\n  `chsh -s /bin/bash`.\n\n   If the location of the shell is not in `/etc/shells`, add it, then run the\n   `chsh` command.\n   If you have Sublime Text, you can open the file by running\n   `subl /etc/shells`.\n5. Quit and restart Terminal (or iTerm2), or open a new tab for the new shell\n   to take effect.\n\nWhether you're using bash or zsh, we recommend installing the latest versions\nwith Homebrew because the versions that came with your Mac are really old.\n```\nbrew install bash\n```\nor\n```\nbrew install zsh\n```\n\nCredits\n-------\n\nThe 18F laptop script is based on and inspired by\n[thoughtbot's laptop](https://github.com/thoughtbot/laptop) script.\n\n### Public domain\n\nthoughtbot's original work remains covered under an [MIT License](https://github.com/thoughtbot/laptop/blob/c997c4fb5a986b22d6c53214d8f219600a4561ee/LICENSE).\n\n18F's work on this project is in the worldwide [public domain](LICENSE.md), as are contributions to our project. As stated in [CONTRIBUTING](CONTRIBUTING.md):\n\n\u003e This project is in the public domain within the United States, and copyright and related rights in the work worldwide are waived through the [CC0 1.0 Universal public domain dedication](https://creativecommons.org/publicdomain/zero/1.0/).\n\u003e\n\u003e All contributions to this project will be released under the CC0 dedication. By submitting a pull request, you are agreeing to comply with this waiver of copyright interest.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F18F%2Flaptop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F18F%2Flaptop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F18F%2Flaptop/lists"}