Skip to content

Instantly share code, notes, and snippets.

@audstanley
Last active July 23, 2023 22:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save audstanley/6653b3a288bfb008a96deb9865b33bb9 to your computer and use it in GitHub Desktop.
Save audstanley/6653b3a288bfb008a96deb9865b33bb9 to your computer and use it in GitHub Desktop.
fresh-alpine-with-go-zsh-and-fzf
#!/bin/ash
#
#############################################################
# #
# Fresh Alpine Linux with all the Go things, zsh, and fzf #
# -Richard Stanley #
# -Thanks- YouTuber; /watch?v=tirOEF8Bnj8 #
# #
#############################################################
#
GO_VERSION=go1.20.6.linux-amd64.tar.gz # change_me
apk update
apk add patchelf gcompat curl tar shadow
apk add git vim zsh bash
curl https://dl.google.com/go/$GO_VERSION --output $GO_VERSION
mv $GO_VERSION /usr/local/bin/$GO_VERSION
cd /usr/local/bin
tar -xf $GO_VERSION
rm $GO_VERSION
cd go/bin
patchelf --set-interpreter /lib/libc.musl-x86_64.so.1 go
# gcompat include libresolv.so.2 # may not need
# To replace ash with zsh;
sed "s/root:x:0:0:root:\/root:\/bin\/ash/root:x:0:0:root:\/root:\/bin\/zsh/" -i /etc/passwd
# add the go path to the zsh root environment
grep -qxF 'PATH=$PATH:/usr/local/bin/go/bin' foo.bar || echo 'PATH=$PATH:/usr/local/bin/go/bin' >> .zshrc
#!/bin/zsh
# Install ohmyzsh;
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
cd ~/;
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
~/.fzf/install
exit;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment