diff --git a/.brew_programs b/.brew_programs index 10fa4d2..2a69b96 100644 --- a/.brew_programs +++ b/.brew_programs @@ -12,12 +12,12 @@ ipcalc iperf3 mtr neovim -newsboat parallel pinentry-mac ranger ripgrep rsync +taplo telnet texinfo tmux diff --git a/.brew_programs_cask b/.brew_programs_cask index b25cbb4..030f8ab 100644 --- a/.brew_programs_cask +++ b/.brew_programs_cask @@ -1,5 +1,4 @@ alacritty -brave chatterino dbeaver-community discord @@ -22,7 +21,6 @@ rustdesk scroll-reverser signal spotify -stats telegram the-unarchiver transfer diff --git a/.brew_programs_disable b/.brew_programs_disable index 33a9488..62a2861 100644 --- a/.brew_programs_disable +++ b/.brew_programs_disable @@ -1 +1,2 @@ example +displaylink diff --git a/.local/bin/Update-pkg b/.local/bin/Update-pkg index b7da061..4bc97a1 100755 --- a/.local/bin/Update-pkg +++ b/.local/bin/Update-pkg @@ -259,12 +259,6 @@ function install_ansible-language-server() { sudo npm -s -g i yaml-language-server --force } -function install_meraki_ansible() { - # Install python, ansible module for meraki - ansible-galaxy collection install cisco.meraki --force - $pip install meraki $PIPEXT -} - function install_azure_cli() { # Install azure_cli $install azure-cli @@ -275,11 +269,6 @@ function install_awscli() { $install awscli } -function install_aws_adfs() { - # Install aws-adfs - $pip install aws-adfs $PIPEXTPRE -} - function install_ytdlp() { # Install yt-dlp $pip install yt-dlp $PIPEXTPRE @@ -444,11 +433,6 @@ function install_tss_client() { fi } -function install_taplo() { - # Install taplo - $install taplo -} - function install_precommit() { # Install pre-commit $pip install pre-commit $PIPEXTPRE @@ -610,18 +594,15 @@ function main() { command_start install_terragrunt command_start install_azure_cli command_start install_ansible - command_start install_meraki_ansible command_start install_ansible-language-server command_start install_ytdlp command_start install_spotifydl command_start install_awscli - command_start install_aws_adfs command_start install_speedtest command_start install_gh_cli command_start install_kubernetes command_start install_rust command_start install_tss_client "1.5.9" - command_start install_taplo command_start install_precommit command_start install_streamlink command_start install_fzf @@ -631,7 +612,6 @@ function main() { command_start install_font_terminess command_start install_zsh_addons command_start install_brew_programs - command_start update_zsh } main diff --git a/.local/bin/python_env b/.local/bin/python_env index 6ca8380..c8b68b6 100755 --- a/.local/bin/python_env +++ b/.local/bin/python_env @@ -2,8 +2,8 @@ source "$HOME"/.local/bin/functions -# Function for creating a python env -python_env(){ +# Base function for creating a python venv +python_env_base() { [ -z "$PYTHONVERSION" ] && err "Python version is not set" @@ -14,7 +14,49 @@ python_env(){ virtualenv -p "$PYTHONVERSION" .venv .venv/bin/python -m pip install --upgrade pip - .venv/bin/pip install -r requirements.txt --break --force + .venv/bin/pip install pre-commit --break --force } -python_env "$@" +# Default python env with requirements.txt +python_env() { + python_env_base + if [ -f requirements.txt ]; then + .venv/bin/pip install -r requirements.txt --break --force + timestamp "Installing Python packages from requirements.txt" + fi +} + +# Ansible python env +python_env_ansible() { + python_env_base + timestamp "Installing Ansible packages" + .venv/bin/pip install \ + ansible \ + ansible-core \ + ansible-lint \ + ansible-parallel \ + passlib \ + python-tss-sdk \ + --break --force + + export ANSIBLE_COLLECTIONS_PATH=".venv/collections" + export ANSIBLE_ROLES_PATH=".venv/roles" + + timestamp "Installing Ansible Galaxy collections to .venv/collections" + .venv/bin/ansible-galaxy collection install community.general -p .venv/collections --upgrade + + timestamp "Installing Ansible Galaxy roles from requirements.yml files to .venv/roles" + find . -maxdepth 3 -name "requirements.yml" -path "*/roles/*" -not -path "./.venv/*" -print0 | while IFS= read -r -d '' req; do + timestamp "Found requirements: $req" + .venv/bin/ansible-galaxy install --force -r "$req" -p .venv/roles + done +} + +case "$1" in +ansible) + python_env_ansible + ;; +*) + python_env + ;; +esac diff --git a/.zshrc b/.zshrc index 8aeff8f..89eb187 100644 --- a/.zshrc +++ b/.zshrc @@ -16,10 +16,6 @@ gbranch() { echo -e "$(git branch "$@")" } -dt() { - date +"%Y%m%d%H%M%S" -} - [ -f /etc/gentoo-release ] && export ZSH="/usr/share/zsh/site-contrib/oh-my-zsh" [ -f /etc/centos-release ] && export ZSH="$HOME/.oh-my-zsh" [ -f /etc/debian_version ] && export ZSH="$HOME/.oh-my-zsh" @@ -90,22 +86,11 @@ export PATH=$PATH:$HOME/.cargo/bin # History export HISTTIMEFORMAT="%F %T " -# Export for WSL -if [[ "$(uname -sr)" =~ "Microsoft" ]]; then - export GOROOT=/usr/lib/go -fi - # Work -alias ansible-lint-work='GIT_SSH_COMMAND="ssh -i ~/.ssh/work/id_rsa" ansible-lint' -alias ansible-galaxy-work='GIT_SSH_COMMAND="ssh -i ~/.ssh/work/id_rsa" ansible-galaxy' alias ssh-work="ssh -i ~/.ssh/work/id_rsa" alias rsyncwork="rsync -h --progress -e 'ssh -i ~/.ssh/work/id_rsa'" alias git-work='GIT_SSH_COMMAND="ssh -i ~/.ssh/work/id_rsa" git' -alias git-commit-work="git commit --author='Marcin Woźniak '" - -# Alias ssh -alias ssh-restore="cp -rv ~/ssh-mega/config ~/.ssh/ ; ssh-permissions" -alias ssh-backup="cp -rv ~/.ssh/config ~/ssh-mega/" +alias git-commit-work="git commit --author='Marcin Woźniak '" # Alias and Export Gentoo alias svm="sudo $EDITOR /etc/portage/make.conf" @@ -120,7 +105,7 @@ alias feh="feh --edit --scale-down" alias graphic-card="glxinfo|egrep 'OpenGL vendor|OpenGL renderer'" alias mylaptop-components="inxi -Fxz" alias update_time="sudo ntpdate -b -u vega.cbk.poznan.pl" -alias dn='LC_TIME=C /bin/date "+%Y%m%d%H%M%S"' +alias dt='LC_TIME=C /bin/date "+%Y%m%d%H%M%S"' # Alias and Export for Mac if [[ "$(uname)" == "Darwin" ]]; then