Skip to content

deniscostadsc/dotfiles

Repository files navigation

dotfiles

DISCLAIMER: This project is intentended to be a personal project, to setup my personal computers.

ci workflow status

Running the playbooks

To execute playbook, you need to install ansible and its dependencies locally. To do that run the following commands

pip3 install ansible-core
ansible-galaxy collection install --requirements-file roles/requirements.yml --upgrade

After that, you can run the playbooks:

make run

Manual steps

On MacOS

What this project does

Packages installed

Bash

Commands

Installs the following commands:

  • clipboard (you can copy/paste using shell redirections and pipes)
  • colors (cheatsheet for colors on terminal)
  • ll (alias for ls -alhF)
  • mkcd (create and got into a directory)
  • passphrase (generates passphrases)

Commands with color

Adds color by default to the following command:

  • egrep
  • fgrep
  • grep
  • ls

Terminal prompt

Costomizes PS1 variable, which is responsible for the prompt on terminals, like bellow:

~/projects/personal/dotfiles 13:55:25 master ⇡
$

It shows:

  • Current folder name
  • Time when the promt was shown on screen
  • Git branch name (if current directory is in a Git repository)
  • Arrows that indicates you are ahead/behind remote branch

Terminal history

Sets the history limit size to 100000 commands, while avoid logging in history the following commands:

  • bg
  • clear
  • fg
  • ll
  • ls
  • pwd

It also add the date and time to history output. See example bellow:

~/projects/personal/dotfiles 13:55:25 master ⇡
$ history
...
11374  22/11/20 - 13:54:43 git commit
11375  22/11/20 - 13:55:25 git status
11376  22/11/20 - 13:56:05 history

Code Editors

Look at code editors README

Docker

Creates a Docker user group and adds the current user to it on Linux. This step is required to avoid use of sudo for every docker command you run.

Add also the command docker-full-clean that remove everything related to Docker. Like images, containers, cache, volumes, etc..

Git

Look at git role README

SSH

To enable the coexistance of two SSH keys, one for work and one for personal purposes, I set the work SSH key to impact only the domain work.github.com. For that reason, after I clone the repositories from work I need to change the remote URL to add the suffix work..

Development

Running the tests

There are make tasks to run lint and tests

make lint
make lint-fix
make test

Troubleshooting

Pop!_os

Could not import python modules: apt, apt_pkg. Please install python3-apt package.

In a new installation of Ansible a problem related to python3-apt can occour.

...
"msg": "Could not import python modules: apt, apt_pkg. Please install python3-apt package."
...

There are many sugestions listed on the internet, but the creation symlinks to the lib *.so solved the problem on Pop!_os.

cd /usr/lib/python3/dist-packages
sudo ln -s apt_pkg.cpython*.so apt_pkg.so
sudo ln -s apt_inst.cpython*.so apt_inst.so