# dot
## Description
There is no place like $HOME. All my dotfiles, and a guide for configuring a new install.
## Table of Contents
- [Description](#description)
- [Features](#features)
- [Usage](#usage)
- [Credits / Resources](#credits--resources)
- [License](#license)
## Features / TODOS
+ All my dotfiles.
+ Step by step guide.
+ Resources and references.
+ Current list of recommended software.
## Usage
After installation, you should login as root instead of the user. As this gives us a chance to add users, change passwords, set groups, and change defaults.
Step One: - [ ] Add users and assign passwords and groups
Where required, add users to groups such as custom, sudo, dialout etc...
`sudo useradd -m user_variable`
`sudo passwd user_variable`
`sudo usermod -aG user group`
Step Two: - [ ] Removing root login, and copying ssh keys.
Now that we have a new user, we can make some security changes.
`sed -i 's/^PermitRootLogin yes/PermitRootLogin no/' /etc/ssh/sshd_config`
`sudo systemctl restart sshd`
Create and copy our ssh keys to server or instance.
`ssh-keygen -t ed25519 -C "your_email@example.com"`
`ssh-copy-id username@remote_host`
Disable password logins
`sed -i 's/^PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_config`
`sudo systemctl restart sshd`
Step Three: - [ ] Update and upgrade
`sudo apt update`
`sudo apt upgrade`
`sudo apt dist-upgrade`
`sudo apt autoremove`
`sudo apt clean`
Step Four: - [ ] Download Packages
Here is a list of packages to start with.
`wget -O - https://myrepos.dev/Randy-Jordan/dot/raw/branch/main/.apt_defaults.list | xargs sudo apt-get -y install`
`curl https://myrepos.dev/Randy-Jordan/dot/raw/branch/main/.apt_defaults.list | xargs apt-get -y install`
Step Five: - [ ] Change defaults
I like to change my XDG user directory defaults. Located at `/etc/xdg/user-dirs.defaults`
`wget -O /etc/xdg/user-dirs.defaults https://myrepos.dev/Randy-Jordan/eg/raw/branch/main/dot/xdg/user-dirs.custom`
`curl https://myrepos.dev/Randy-Jordan/eg/raw/branch/main/dot/xdg/user-dirs.custom > /etc/xdg/user-dirs.defaults`
I also like to change the user shell to zsh.
`chsh -s /path/to/new/shell username`
Step Six: - [ ] Login as user and setup dotfiles
If you are already tracking your dotfiles and this a fresh install, you can run these commands:
`alias config='/usr/bin/git --git-dir=$HOME/.dot/ --work-tree=$HOME'` Alias config
`echo ".dot" >> .gitignore` Avoid weird recursion problems where you clone.
`git clone --bare https://github.com/Randy-Jordan/dot.git $HOME/.dot` Clone repo
`alias config='/usr/bin/git --git-dir=$HOME/.dot/ --work-tree=$HOME'` Current shell scope
You may already have some dotfiles, so we will back them up to avoid conficts.
`mkdir -p .config-backup && \
config checkout 2>&1 | egrep "\s+\." | awk {'print $1'} | \
xargs -I{} mv {} .config-backup/{}`
Now we can run the checkout command to get our dotfiles from the repo.
`config checkout`
Make sure to set untracked files setting.
`config config --local status.showUntrackedFiles no`
Here is a script to automate the above.
`wget -O - https://myrepos.dev/Randy-Jordan/sh/raw/branch/main/dot.sh | bash`
`curl https://myrepos.dev/Randy-Jordan/sh/raw/branch/main/dot.sh | bash`
`config status` To see status of your dotfiles.
`config add .xyzfile` To start adding dotfiles.
## Credits / Resources
[Tom Preston-Werner - README Driven Development](https://tom.preston-werner.com/2010/08/23/readme-driven-development.html)
[Dotfiles: Best way to store in a bare git repository](https://www.atlassian.com/git/tutorials/dotfiles)
## License
This project is licensed under GPLv3 - see the [LICENSE](LICENSE) file for details.