96 lines
3.8 KiB
Markdown
96 lines
3.8 KiB
Markdown
# 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: - [ ] Change defaults <br>
|
|
I like to change my XDG user directory defaults. Located at `/etc/xdg/user-dirs.defaults`<br>
|
|
`wget -O /etc/xdg/user-dirs.defaults https://myrepos.dev/Randy-Jordan/eg/raw/branch/main/dot/xdg/user-dirs.custom`<br>
|
|
`curl https://myrepos.dev/Randy-Jordan/eg/raw/branch/main/dot/xdg/user-dirs.custom > /etc/xdg/user-dirs.defaults`<br>
|
|
|
|
Step Two: - [ ] Add users and assign passwords and groups <br>
|
|
Where required, add users to groups such as custom, sudo, dialout etc...<br>
|
|
|
|
`sudo useradd -m user_variable`<br>
|
|
`sudo passwd user_variable`<br>
|
|
`sudo usermod -aG user group`<br>
|
|
|
|
Step Three: - [ ] Removing root login, and copying ssh keys.<br>
|
|
Now that we have a new user, we can make some security changes.
|
|
|
|
`sed -i 's/^PermitRootLogin yes/PermitRootLogin no/' /etc/ssh/sshd_config`<br>
|
|
`sudo systemctl restart sshd`<br>
|
|
|
|
Create and copy our ssh keys to server or instance.<br>
|
|
`ssh-keygen -t ed25519 -C "your_email@example.com"`
|
|
`ssh-copy-id username@remote_host`
|
|
|
|
Disable password logins<br>
|
|
`sed -i 's/^PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_config`<br>
|
|
`sudo systemctl restart sshd`<br>
|
|
|
|
|
|
Step Four: - [ ] Update and upgrade<br>
|
|
`sudo apt update` <br>
|
|
`sudo apt upgrade`<br>
|
|
`sudo apt dist-upgrade`<br>
|
|
`sudo apt autoremove`<br>
|
|
`sudo apt clean`<br>
|
|
|
|
Step Five: - [ ] Download Packages
|
|
Here is a list of packages to start with.<br>
|
|
`wget -O - https://myrepos.dev/Randy-Jordan/dot/raw/branch/main/.apt_defaults.list | xargs sudo apt-get -y install`<br>
|
|
`curl https://myrepos.dev/Randy-Jordan/dot/raw/branch/main/.apt_defaults.list | xargs apt-get -y install`<br>
|
|
|
|
I also like to change the user shell to zsh.<br>
|
|
`chsh -s /usr/bin/zsh username`<br>
|
|
|
|
Step Six: - [ ] Login as user and setup dotfiles<br>
|
|
If you are already tracking your dotfiles and this a fresh install, you can run these commands:<br>
|
|
`alias config='/usr/bin/git --git-dir=$HOME/.dot/ --work-tree=$HOME'` Alias config<br>
|
|
`echo ".dot" >> .gitignore` Avoid weird recursion problems where you clone.<br>
|
|
`git clone --bare https://github.com/Randy-Jordan/dot.git $HOME/.dot` Clone repo<br>
|
|
`alias config='/usr/bin/git --git-dir=$HOME/.dot/ --work-tree=$HOME'` Current shell scope<br>
|
|
|
|
You may already have some dotfiles, so we will back them up to avoid conficts.<br>
|
|
`mkdir -p .config-backup && \
|
|
config checkout 2>&1 | egrep "\s+\." | awk {'print $1'} | \
|
|
xargs -I{} mv {} .config-backup/{}`
|
|
<br>
|
|
Now we can run the checkout command to get our dotfiles from the repo.<br>
|
|
`config checkout`<br>
|
|
Make sure to set untracked files setting.<br>
|
|
`config config --local status.showUntrackedFiles no`<br>
|
|
|
|
Here is a script to automate the above.<br>
|
|
`wget -O - https://myrepos.dev/Randy-Jordan/sh/raw/branch/main/dot.sh | bash`<br>
|
|
`curl https://myrepos.dev/Randy-Jordan/sh/raw/branch/main/dot.sh | bash`<br>
|
|
|
|
`config status` To see status of your dotfiles.<br>
|
|
`config add .xyzfile` To start adding dotfiles. <br>
|
|
|
|
## Credits / Resources
|
|
[Tom Preston-Werner - README Driven Development](https://tom.preston-werner.com/2010/08/23/readme-driven-development.html)<br>
|
|
[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.
|