Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2024 package updates #11

Merged
merged 7 commits into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ Thumbs.db

# Arbitrary files and folders #
###############################
# I symlink alacritty.toml
alacritty/alacritty.toml

## General ##
#############
Expand Down Expand Up @@ -92,7 +90,6 @@ Music/*
Pictures/*
Screenshots/*
Videos/*
VirtualBox VMs/*
.TrueCrypt-lock-ricardo
.TrueCrypt/
.adobe/
Expand Down
2 changes: 2 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ repos:
rev: 1.16.0
hooks:
- id: yamlfix
additional_dependencies:
- 'maison<2.0.0'
- repo: https://github.com/Yelp/detect-secrets
rev: v1.4.0
hooks:
Expand Down
7 changes: 2 additions & 5 deletions MacOS/post-install
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@ strictMode
function are_brew_basics_installed() {
declare -a BREW_BASICS=('bat'
'bfg'
'exa'
'fd'
'fpp'
'rclone'
'ripgrep'
'pandoc'
'shellcheck'
Expand All @@ -33,7 +31,6 @@ function are_brew_basics_installed() {

function are_cask_basics_installed() {
declare -a BREW_CASK_BASICS=('1password'
'alacritty'
'alfred'
'firefox'
'font-hack-nerd-font'
Expand All @@ -52,8 +49,8 @@ function are_cask_basics_installed() {
'transmission'
'tripmode'
'tunnelblick'
'visual-studio-code'
'vlc')
'vlc'
'wezterm')
are_brew_basics_installed
install_if_not_installed 'brewcask' 'n' "${BREW_CASK_BASICS[@]}"
}
Expand Down
11 changes: 2 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Keep key configurations and share them among your computers
- [gnupg](https://gnupg.org/)
- [JetBrains Mono font](https://www.jetbrains.com/lp/mono/)
- [jq](https://stedolan.github.io/jq/)
- [keyring](https://pypi.org/project/keyring/)
- [inetutils](https://www.gnu.org/software/inetutils/)
- [mackup](https://github.com/lra/mackup)
- [parallel](https://www.gnu.org/software/parallel/)
Expand All @@ -33,9 +34,8 @@ Keep key configurations and share them among your computers
- [tmux](https://tmux.github.io/)
- [tree](http://mama.indstate.edu/users/ice/tree/)
- [vim](https://www.vim.org/)
- [visual studio code](https://code.visualstudio.com/)
- [VirtualBox](https://www.virtualbox.org/wiki/Downloads)
- [vlc](https://www.videolan.org/vlc/)
- [wezterm](https://wezfurlong.org/wezterm/index.html)
- [wget](https://www.gnu.org/software/wget/)
- [wireshark](https://www.wireshark.org)
- [xz](https://tukaani.org/xz/)
Expand Down Expand Up @@ -65,20 +65,13 @@ Keep key configurations and share them among your computers

- Installs:
- [Homebrew](https://brew.sh)
- [mitmproxy](https://mitmproxy.org/downloads/)
- [apt](https://wiki.debian.org/Apt)
- [apt-file](https://wiki.debian.org/apt-file)
- [ghostwriter](https://wereturtle.github.io/ghostwriter/)
- [libxml2-utils](http://xmlsoft.org)
- [Network Manager OpenVPN](https://gitlab.gnome.org/GNOME/NetworkManager-openvpn)
- [python3-keyring](https://pypi.org/project/keyring/)
- [xclip](https://github.com/astrand/xclip)

### Stuff I may replace

- Virtualbox with [multipass](https://multipass.run/) or
[xhyve](https://github.com/machyve/xhyve), `xhyve` if I need windows hosts

## how I use mackup

- `~/.mackup.cfg` uses directory `~/.dot-files-rclone` with engine `file_system`
Expand Down
1 change: 0 additions & 1 deletion Ubuntu/base
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ function are_basics_installed() {
'lsb-release'
'make'
'procps'
'python3-keyring'
'software-properties-common'
'tk-dev'
'wget'
Expand Down
96 changes: 56 additions & 40 deletions Ubuntu/post-install
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,35 @@ strictMode
# shellcheck disable=SC1091
. "${GITROOT}"/Ubuntu/base

function get_deb_url_from_xpath() {
local URL="${1}"
local XPATH="${2}"
local DEB_URL
DEB_URL="$(curl -s \
"${URL}" | \
xmllint --html \
--xpath "${XPATH}" - 2> /dev/null)"
if [[ "${#DEB_URL}" -lt 4 ]]; then
return 1
fi
echo "${DEB_URL}"
}

function is_repo_present() {
local REPO="${1}"
grep -v -E '^#|^ *$' /etc/apt/sources.list /etc/apt/sources.list.d/*.list | grep -Fq "${REPO/ppa:/}"
}

function add_apt_repo() {
local REPO="${1}"
echo "will try to remove repository ${REPO} if it exists already"
local FILE_NAME="${2}"
msg_info "will try to remove repository ${REPO} if it exists already"
if ! is_repo_present "${REPO}"; then
sudo add-apt-repository -y "${REPO}"
if [[ "${REPO}" =~ ^ppa:.*/ppa$ ]]; then
sudo add-apt-repository -y "${REPO}"
else
echo "${REPO}" | sudo tee /etc/apt/sources.list.d/"${FILE_NAME}".list > /dev/null
fi
fi
}

Expand All @@ -41,6 +60,7 @@ function are_extra_cli_tools_installed() {
'libcurl4-openssl-dev'
'libxml2'
'libxml2-dev'
'nala'
'pandoc'
'pkg-config'
'tshark')
Expand All @@ -49,28 +69,22 @@ function are_extra_cli_tools_installed() {

function are_extra_tools_installed() {
declare -a EXTRA_UBUNTU_TOOLS=('ghostwriter'
'alacritty'
'nala'
'network-manager-openvpn-gnome'
'openvpn-systemd-resolved'
'pinta'
'sublime-text'
'termshark'
'transmission-gtk'
'ubuntu-cleaner'
'vlc'
'virtualbox-7.0'
'wezterm'
'wireguard'
'wireshark-gtk')
install_if_not_installed 'apt' 'n' "${EXTRA_UBUNTU_TOOLS[@]}"
declare -a EXTRA_BREW_TOOLS=('bat'
'bfg'
'exa'
'fd'
'fpp'
'bitwarden-cli'
'mitmproxy'
'rclone'
'ripgrep'
'shellcheck'
'shfmt'
Expand Down Expand Up @@ -108,61 +122,63 @@ function download_and_install_deb() {
}

function install_desktop_apps() {
local TMP_DOT_FILES
TMP_DOT_FILES=$(mktemp -d dot-files.XXXX)

echo "Adding apt keys for docker, sublime-text, virtualbox"
msg_info 'Adding apt keys for docker, sublime-text'
declare -A APT_KEYS=(
['docker']='https://download.docker.com/linux/ubuntu/gpg'
['sublime']='https://download.sublimetext.com/sublimehq-pub.gpg'
['volian-scar-unstable']='https://deb.volian.org/volian/scar.key'
['wezterm-fury']='https://apt.fury.io/wez/gpg.key'
)

for KEY_NAME in "${!APT_KEYS[@]}"; do
add_apt_key "${APT_KEYS[${KEY_NAME}]}" "${KEY_NAME}" "${TMP_DOT_FILES}"
done

echo "Adding repositories: docker, GhostWriter, sublime-text, virtualbox"
declare -a REPOSITORIES=(
"deb [arch=amd64 signed-by=/etc/apt/trusted.gpg.d/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
'ppa:wereturtle/ppa'
'ppa:gerardpuig/ppa'
'deb [signed-by=/etc/apt/trusted.gpg.d/sublime.gpg] https://download.sublimetext.com/ apt/stable/'
"deb [arch=amd64] https://download.virtualbox.org/virtualbox/debian $(lsb_release -cs) contrib"
'deb [signed-by=/etc/apt/trusted.gpg.d/volian-scar-unstable.gpg] https://deb.volian.org/volian/ scar main'
msg_info 'Will create /etc/apt/keyrings/docker.asc if does not exist'
if [[ ! -e /etc/apt/keyrings/docker.asc ]]; then
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
msg_info 'Created /etc/apt/keyrings/docker.asc'
fi

echo "Adding repositories: docker, GhostWriter, sublime-text"
declare -A REPOSITORIES=(
['docker']="deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
['ghostwriter']='ppa:wereturtle/ppa'
['ubuntu-cleaner']='ppa:gerardpuig/ppa'
['sublime']='deb [signed-by=/etc/apt/trusted.gpg.d/sublime.gpg] https://download.sublimetext.com/ apt/stable/'
['wezterm']='deb [signed-by=/etc/apt/trusted.gpg.d/wezterm-fury.gpg] https://apt.fury.io/wez/ * *'
)

for REPOSITORY in "${REPOSITORIES[@]}"; do
add_apt_repo "${REPOSITORY}"
for KEY in "${!REPOSITORIES[@]}"; do
add_apt_repo "${REPOSITORIES[${KEY}]}" "${KEY}"
done

sudo apt update

is_docker_installed
are_extra_tools_installed

echo "Installing visual studio code, Google Chrome Stable, Slack"
LATEST_SLACK="$(curl -s 'https://slack.com/downloads/instructions/ubuntu' | xmllint --html --xpath 'string(/html/body/main/section[3]/div/p[1]/a[1]/@href)' - 2> /dev/null )"
echo "Installing Google Chrome Stable, Slack"
LATEST_SLACK="$(get_deb_url_from_xpath 'https://slack.com/downloads/instructions/linux?ddl=1&build=deb' 'string(/html/body/main/section[1]/iframe/@src)')"
declare -A DEB_PACKAGES=(
['1password']='https://downloads.1password.com/linux/debian/amd64/stable/1password-latest.deb' # pragma: allowlist secret
['code']='https://go.microsoft.com/fwlink/?LinkID=760868'
['google-chrome-stable']='https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb'
['slack']="${LATEST_SLACK}")
['slack']="${LATEST_SLACK}"
['nala']='https://deb.volian.org/volian/pool/main/v/volian-archive/volian-archive-nala_0.3.1_all.deb'
['volian-keyring']='https://deb.volian.org/volian/pool/main/v/volian-archive/volian-archive-keyring_0.3.1_all.deb'
)

for KEY in "${!DEB_PACKAGES[@]}"; do
download_and_install_deb "${DEB_PACKAGES[${KEY}]}" "${KEY}"
done

retry_command "10" "sudo" "apt" "update"

is_docker_installed
are_extra_tools_installed

# needed for multiple apps
mkdir -p "${HOME}/bin" || true
HOME_BIN="${HOME}/bin"

if ! grep -q 'Oracle VM VirtualBox Extension Pack' <(sudo VBoxManage list extpacks); then
echo 'Installing virtualbox Extension pack'
LATEST_EXT_PACK=$(curl 'https://www.virtualbox.org/wiki/Downloads' | xmllint --html --xpath 'string(//html/body/div[4]/div[3]/div[3]/div/div[2]/ul[3]/li/a/@href)' - 2> /dev/null)
curl -Lv "${LATEST_EXT_PACK}" -o "${TMP_DOT_FILES}/Oracle_VM_VirtualBox_Extension_Pack.vbox-extpack"
sudo VBoxManage extpack install --replace "${TMP_DOT_FILES}/Oracle_VM_VirtualBox_Extension_Pack.vbox-extpack"
fi

if ! grep -q 'JetBrains Mono' <(fc-list); then
echo 'Installing Jetbrains Font'
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/JetBrains/JetBrainsMono/master/install_manual.sh)"
Expand All @@ -175,7 +191,7 @@ function install_desktop_apps() {
git clone --depth 1 https://github.com/ryanoasis/nerd-fonts.git "${HOME}/src/nerd-fonts"
fi
cd "${HOME}/src/nerd-fonts" || exit 1
./install.sh -q -A
./install.sh -q
cd - || exit 1
fc-cache -f -v
fi
Expand All @@ -194,7 +210,7 @@ function install_desktop_apps() {
LATEST_JETBRAINS_TOOLBOX=$(curl -sL 'https://data.services.jetbrains.com//products/releases?code=TBA&latest=true&type=release' | jq -r '.TBA[].downloads.linux.link')
curl -Lv "${LATEST_JETBRAINS_TOOLBOX}" -o "${TMP_DOT_FILES}/jetbrains-toolbox.tar.gz"
tar -xzvf "${TMP_DOT_FILES}/jetbrains-toolbox.tar.gz" -C "${TMP_DOT_FILES}"
mv "${TMP_DOT_FILES}/jetbrains-toolbox-*/jetbrains-toolbox" "${HOME_BIN}/"
mv "${TMP_DOT_FILES}"/jetbrains-toolbox-*/jetbrains-toolbox "${HOME_BIN}/"
fi

if ! grep -q 'Bourne-Again shell' <(file ~/.tmux/plugins/tpm/tpm); then
Expand Down
27 changes: 0 additions & 27 deletions alacritty/alacritty_MacOS.toml

This file was deleted.

27 changes: 0 additions & 27 deletions alacritty/alacritty_Ubuntu.toml

This file was deleted.

1 change: 0 additions & 1 deletion bash_aliases
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
#alias cat='bat'
#alias ls='exa'
#alias find='fd'
alias ll='ls -alF'
alias la='ls -A'
Expand Down
1 change: 1 addition & 0 deletions default-python-packages
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
keyring
poetry
pre-commit
pynvim
uv
ruff
1 change: 0 additions & 1 deletion mackup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ ack
adium
adobe-camera-raw
airmail
alacritty
amethyst
ancient-domains-of-mystery
androidstudio-13
Expand Down
5 changes: 0 additions & 5 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,6 @@ done
# neovim
link_if_not_exists "${GITROOT}/nvim" "${HOME}/.config/nvim"

# alacritty
link_if_not_exists "${GITROOT}/alacritty" "${HOME}/.config/alacritty"
link_if_not_exists "${HOME}/.config/alacritty/alacritty_${MACHINE_OS}.toml" "${HOME}/.config/alacritty/alacritty.toml"


declare -a OS_SPECIFIC_LINKS=()
mapfile -t OS_SPECIFIC_LINKS < <(get_os_specific_links "${MACHINE_OS}")

Expand Down