Workstation setup scripts. All roles (except the private one) are now migrated to novicecpp.homeconfig
My (Ansible) Galaxy.
- git
- sudo
- ssh and ssh-agent
- ansible
- local user with root access
Do not forget setup credentials storage before run setup.
For Fedora, you can use init/fedora.sh script to bootstrap. For Archlinux, it is already setup in installation step archlinux/bootstrap.yml.
mkdir ~/myhome
Note: I do not do backup whole home directory, but put everything into ~/myhome
directory instead to clean up the mess created by applications when reinstall OS.
Dot files will be setup later by ansible roles in home-config-ansible-private.
Setup this repo and initialize home-config-ansible-private and mygalaxy.
cd ~/myhome
git clone [email protected]:novicecpp/home-config-ansible.git
cd home-config-ansible
git submodule update --init
# install galaxy deps and symlink mygalaxy to ~/.ansible
bash mygalaxy/install.sh
Clone home-config and home-config-private to ~/myhome
. Need ssh-agent to clone private repo.
CREDENTIALS_PATH=/path/to/credentials-store
eval $(ssh-agent)
ssh-add -f "${CREDENTIALS_PATH}"/private/github
cd ~/myhome
git clone [email protected]:novicecpp/home-config.git
cd home-config
git submodule update --init
cd ~/myhome/home-config-ansible
bash example_run.sh # Switch playbook and inventory to the machine you run in the script.
TBD
For Lenovo X1/P1 Gen 2,
- Remove power cord.
- Restart.
- Open bios menu > Power > Turn of built-in battery.
- wait 5 seconds.
- Plug in power cord, open laptop.
Copy from pyenv.sh.
f_pyenv_init_pipenv ()
{
if [[ "$#" -ne 1 ]]; then
echo 'Error: python version required.';
echo "Usage: ${FUNCNAME[0]} <python_version>";
return 1;
fi;
PY_VERSION=${1};
if [[ -d .venv ]]; then
echo 'Error: .venv exists.';
return 1;
fi;
export PYENV_ROOT="$HOME/.pyenv";
command -v pyenv > /dev/null || export PATH="$PYENV_ROOT/bin:$PATH";
eval "$(pyenv init -)";
pyenv shell "${PY_VERSION}" || rc=$?;
[[ $rc -ne 0 ]] && return "$rc";
python -m venv .venv --prompt "$(basename $PWD)";
source .venv/bin/activate;
pip install -U pip;
pip install pipenv
}
f_pyenv_init_pipenv 3.11 && pipenv sync