{"id":49766743,"url":"https://github.com/heathen1878/bash","last_synced_at":"2026-05-11T10:54:36.346Z","repository":{"id":136341138,"uuid":"589339792","full_name":"heathen1878/bash","owner":"heathen1878","description":"Bash learning...","archived":false,"fork":false,"pushed_at":"2024-08-08T19:54:16.000Z","size":28,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-27T02:11:42.461Z","etag":null,"topics":["bash","bash-alias","bash-scripting"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/heathen1878.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2023-01-15T21:05:03.000Z","updated_at":"2024-08-08T19:54:19.000Z","dependencies_parsed_at":"2024-07-27T19:44:20.291Z","dependency_job_id":null,"html_url":"https://github.com/heathen1878/bash","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/heathen1878/bash","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heathen1878%2Fbash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heathen1878%2Fbash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heathen1878%2Fbash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heathen1878%2Fbash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/heathen1878","download_url":"https://codeload.github.com/heathen1878/bash/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heathen1878%2Fbash/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32891966,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-10T13:40:02.631Z","status":"online","status_checked_at":"2026-05-11T02:00:05.975Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","bash-alias","bash-scripting"],"created_at":"2026-05-11T10:54:35.657Z","updated_at":"2026-05-11T10:54:36.330Z","avatar_url":"https://github.com/heathen1878.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bash\nBash learning...\n\n## Local environment setup\n\nThese instructions can be used within an Ubuntu OS or an Ubuntu instance running within WSL.\n\n### WSL \n\nInstall WSL\n```shell\nwsl --install\n```\n\nInstall Ubuntu\n\n```shell\n# Check available versions\nwsl --list --online\n\nwsl --install -d Ubuntu-22.04\n```\n\n## Docker\n\n- [ ] Create a Docker container with all the tooling incl. Starship configured.\n\n\n## SSH Keys\n\nCreate an SSH key for GitHub, Azure DevOps or whatever source control...\n\n```shell\n# For example\nssh-keygen -C \"SSH Key for GitHub\" -t rsa -b 2048 -f ~/.ssh/github\n# Enter a passphrase when prompted\n```\n\nAdd the contents of github.pub - as per the above example - to GitHub.\n\n**NOTE**\nIf you have multiple SSH keys then use a config file, placed within `.ssh`\n\n```\n#Example configuration\nHost github.com\n    HostName github.com\n    User git\n    IdentityFile ~/.ssh/github\n    AddKeysToAgent yes\n\nHost vs-ssh.visualstudio.com\n    HostName vs-ssh.visualstudio.com\n    User git\n    IdentityFile ~/.ssh/azdo\n    AddKeysToAgent yes\n```\n\n### Install Keychain\n\nThis tool is useful to load SSH keys with passphrases when you start your terminal.\n\n```shell\n# Install Keychain\nsudo apt install keychain\n```\n\nThen add the following to `.bashrc`\n\n```\n# For example\neval `keychain --eval --agents ssh ssh_file1 ssh_file2`\n```\n\nReload bashrc `. ~/.bashrc`\n\n## Install Tooling\n\n### Essential tools\n```shell\nsudo apt update -y -qq\nsudo apt upgrade -y -qq\n\nsudo apt install build-essential curl file git jq zip unzip shellcheck -y -qq\n\n# Install Az Cli\nUBUNTU_VERSION=$(lsb_release -rs)\n\ncurl --silent https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add\ncurl --silent \"https://packages.microsoft.com/config/ubuntu/$UBUNTU_VERSION/prod.list\" | sudo tee /etc/apt/sources.list.d/msprod.list\n\ncurl --silent --location https://aka.ms/InstallAzureCLIDeb | sudo bash\n```\n\n## Configure aliases\n\nCreate a .bash_aliases file and add the following:\n\n```bash\nalias ls='ls -alhF --color --group-directories-first'\nalias tfapply='source ./scripts/apply.sh'\nalias tfauth='source ./scripts/auth.sh'\nalias tfinit='source ./scripts/init.sh'\nalias tflint='terraform fmt --recursive'\nalias tfoutput='source ./scripts/output.sh'\nalias tfplan='source ./scripts/plan.sh'\nalias tfset='source ./scripts/setup.sh'\n```\n\n## Configure prompt using Starship\n\nStarship is a great tool for configuring your command prompt to provide more information...for example the Git branch you're in etc.\n\n### Install a font\n\nI use Jetbrains font to get the additional symbols for my Starship configuration.\n\n#### Ubuntu\n\n```shell\ncurl https://download.jetbrains.com/fonts/JetBrainsMono-2.304.zip --output JetBrainsMono-2.304.zip\nunzip JetBrainsMono-2.304.zip -d /usr/share/fonts\n#Restart the terminal then set the terminal preferences to use the downloaded font\n```\n\n### Installing dotnet sdk\n```shell\nsudo apt-get update \u0026\u0026 \\\n  sudo apt-get install -y dotnet-sdk-7.0s\n\n# Check SDK is installed\ndotnet --list-sdks\n\n# Might need to copy the sdk to lib...\nsudo cp -r /usr/share/dotnet/* /usr/lib/dotnet/\n\n# This is generally available from the above command\nsudo apt-get update \u0026\u0026 \\\n  sudo apt-get install -y aspnetcore-runtime-7.0\n```\n\n#### WSL\n\n\n## Configure .bashrc\n\n### Catching terminal exit\n\nI wanted to logut my az cli sessions when the terminal exited; after lots of faffing around I read an article that suggested I \nneed a trap defined within my .bashrc file e.g. \n\n```bash\n# trap for terminal exit\ntrap az_logout EXIT\n```\n\n*NOTE* this trap above depends on a function called az_logout. So I decided to load my functions in .bashrc too e.g.\n\n```bash\n# load functions\nif [ -d ~/source/github/Terraform/scripts ]; then\n\tfor file in ~/source/github/Terraform/scripts/functions/*.sh; do\n\t\t. \"$file\"\n\tdone\nfi\n```\n\n*NOTE* the above functions are in my Terraform [repo](https://github.com/heathen1878/Terraform/blob/main/scripts/readme.md)\n\n\n\n\n\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheathen1878%2Fbash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fheathen1878%2Fbash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheathen1878%2Fbash/lists"}