{"id":15398419,"url":"https://github.com/marcomontalbano/bash_profile","last_synced_at":"2025-04-15T22:31:02.508Z","repository":{"id":87862499,"uuid":"73380761","full_name":"marcomontalbano/bash_profile","owner":"marcomontalbano","description":"A collection of bash utilities. Set and unset proxy. Completions for git, svn and ssh. PS1 customization.","archived":false,"fork":false,"pushed_at":"2020-07-14T20:35:02.000Z","size":788,"stargazers_count":18,"open_issues_count":0,"forks_count":7,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-29T03:41:36.486Z","etag":null,"topics":["bash-profile","shell","terminal","utility"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/marcomontalbano.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-11-10T12:41:01.000Z","updated_at":"2023-09-05T10:19:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"fe103f80-26b2-4228-a32b-3893fa1a6ff6","html_url":"https://github.com/marcomontalbano/bash_profile","commit_stats":{"total_commits":43,"total_committers":2,"mean_commits":21.5,"dds":"0.046511627906976716","last_synced_commit":"9996720ca07c611d6874812e5f582b47eb815832"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcomontalbano%2Fbash_profile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcomontalbano%2Fbash_profile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcomontalbano%2Fbash_profile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcomontalbano%2Fbash_profile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marcomontalbano","download_url":"https://codeload.github.com/marcomontalbano/bash_profile/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249165944,"owners_count":21223352,"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":["bash-profile","shell","terminal","utility"],"created_at":"2024-10-01T15:43:39.693Z","updated_at":"2025-04-15T22:31:01.356Z","avatar_url":"https://github.com/marcomontalbano.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"![](https://img.shields.io/badge/available_for-osx-green.svg?style=flat-square)\n![](https://img.shields.io/badge/available_for-ubuntu-green.svg?style=flat-square)\n![](https://img.shields.io/badge/available_for-windows-green.svg?style=flat-square)\n\n# .bash_profile\n\nThis is a collection of bash utilities. It contains:\n\n- [x] PS1 customization with Git and Svn integration.\n- [x] Bash Completions for Git, Svn, SSH and SFTP.\n- [x] set/unset proxy faster.\n- [x] Updatable `bash_profile` project.\n\n[![asciicast](https://asciinema.org/a/MEknLqkjqFCRHg8kQoT5G84r6.svg)](https://asciinema.org/a/MEknLqkjqFCRHg8kQoT5G84r6)\n\n## Get started\n\nClone this project in your home folder `~`.\n\n```sh\ncd ~ \u0026\u0026 git clone https://github.com/marcomontalbano/bash_profile.git\n```\n\nOpen and modify your `$HOME/.bash_profile` on OS X and Windows or `$HOME/.bashrc` on Ubuntu, adding the following script.\n\n```sh\n# https://github.com/marcomontalbano/bash_profile\nsource ~/bash_profile/.bash_profile -u\n```\n\n### Options\n\n- `-p \u003chttp-proxy\u003e`: combined with `-u`, you can use self-update behind proxy.\n- `-u`: enables self-update for bash_profile. (the latest release will automatically downloaded and loaded)\n- `-w`: show welcome screen on new tabs.\n\n\n## Completions\n\nThe following procedure works for OS X. If you are using Windows or Ubuntu, you don't need it. \n\nIf you want to use the git, svn and ssh completion, just run following scripts.\n\n```sh\n# Bash Completion for GIT\ncurl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash -o ~/bash_profile/.bash_completion_git\n\n# Bash Completion for SVN\ncurl http://svn.apache.org/repos/asf/subversion/trunk/tools/client-side/bash_completion -o ~/bash_profile/.bash_completion_svn\n\n# Bash Completion for SSH and SFTP\ncurl https://gist.githubusercontent.com/marcomontalbano/7c48f6756e4e4133c30fdb8e1fff3100/raw -o ~/bash_profile/.bash_completion_ssh\n```\n\n## Useful Commands\n\n### Bash Profile\n\n- **bash_profile__path** - get project path.\n\n- **bash_profile__cd** - `cd` to the `bash_profile` folder. Something like `cd ~/bash_profile`\n\n- **bash_profile__version** - get current version.\n\n- **bash_profile__reload** - reload the project.\n\n- **bash_profile__reload_all** - reload your own `.bash_profile` or `.bashrc`.\n\n- **bash_profile__update** - update the `bash_profile` project with latest changes. Is \"just\" a `git pull` :smile:\n\n### General\n\nBelow a list of utilities that you can use on command line or your own .bash_profile.\n\n- **console__set_title** - set a console title. _(only for OS X and Windows)_\n\n- **cli__is_installed** - check if a program is installed on your system. *`cli__is_installed node` will return `true` if node is installed on your system, `false` otherwise.*\n\n- **proxy__set** - simply set the command line proxy. It works also for npm and apm, if you use them. *usage: `proxy__set http://domain:8080` or `proxy__set http://domain:8080 https://domain:8080`*\n\n- **proxy__unset** - simply unset the command line proxy.\n\n- **network__get_ip** - get ip address _(e.g. 192.168.0.5)_\n\n- **network__get_gateway** - get gateway address _(e.g. 192.168.0.1)_\n\n- **network__get_broadcast** - get broadcast address _(e.g. 192.168.0.1)_\n\n- **java__use_jdk** - if you work with different version of JDK, you can easily switch with `java__use_jdk 1.8`. _(only for OS X)_\n\n### Git\n\n- **git__update_date** - update last commit with current date. *usage: `git__update_date` or `git__update_date -v -5H`* _(only for OS X)_\n\n\n## PS1 customization\n\nPS1 is customized with multiple lines.\n\n1. green label - you can fetch the **pwd** path.\n1. yellow label _(optional)_ - it appear inside Git or Svn folders.\n1. cyan label - you have the **username** @ **hostname**\n\n![](images/PS1.png)\n\n\n### Git integration\n\n_there are **no** changes on the active **master** branch_\n![](images/git--no-changes.png)\n\n_there are changes on the active **master** branch, but not committed yet_\n![](images/git--with-changes.png)\n\n_you have created a **new-branch**, but not pushed yet_\n![](images/git--new-branch-no-changes.png)\n\n_you have created and pushed a **new-branch**_\n![](images/git--new-branch-no-changes-pushed.png)\n\n_you have created a **new-branch** with some changes, but not committed and pushed yet_\n![](images/git--new-branch-with-changes.png)\n\n_you have pushed the **new-branch**, but it has other changes to commit_\n![](images/git--new-branch-with-changes-pushed.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcomontalbano%2Fbash_profile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarcomontalbano%2Fbash_profile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcomontalbano%2Fbash_profile/lists"}