We know that were are going to need separate setup files based on the operating system so let’s configure some default headers for these files.
setupScripts/windows.ps1
# DO NOT EDIT THIS FILE DIRECTLY!
# This file is auto-generated from Applications.org
setupScripts/mac.sh
# DO NOT EDIT THIS FILE DIRECTLY!
# This file is auto-generated from Applications.org
setupScripts/ubuntu.sh
# DO NOT EDIT THIS FILE DIRECTLY!
# This file is auto-generated from Applications.org
Each OS has a specific package manager that can be used for installing applications.
Windows has the Windows Store
but that isn’t easy to work with in the terminal so let’s install chocolatey
I mean everyone likes chocolate right?
Need to figure out how to configure this for ps1. This might take some work.
If (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole(`
[Security.Principal.WindowsBuiltInRole]::Administrator))
{
Write-Warning "You do not have Administrator rights to run this script!`nPlease re-run this script as an Administrator!"
exit 1
}
$executionPolicy = Get-ExecutionPolicy
if ($executionPolicy -ne "Unrestricted")
{
Write-Host "Not Equal"
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Force
}
if(-not $env:ChocolateyInstall -or -not (Test-Path "$env:ChocolateyInstall"))
{
Write-Output "Chocolatey Not Found, Installing..."
if($PSVersionTable.PSVersion.Major -gt 2)
{
Invoke-WebRequest https://chocolatey.org/install.ps1 -UseBasicParsing | Invoke-Expression
}
else
{
Invoke-Expression ((new-object net.webclient).DownloadString('http://chocolatey.org/install.ps1'))
}
}
Mac doesn’t ship with homebrew
which I use to install applications and packages. Let’s install it now.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" && brew upgrade
brew tap caskroom/cask 2> /dev/null
brew cask upgrade
eval "$(/opt/homebrew/bin/brew shellenv)"
Ubuntu has built-in package managers that we can utilize.
Nothing to setup
Nothing to setup
On some OS’s they don’t install the latest and greatest by default. I’m looking at you MacOS
Let’s upgrade the terminal to run the latest version of bash.
brew install bash
Now that we’ve installed the latest version of bash let’s make the computer use this as the default terminal.
echo $(brew --prefix)/bin/bash | sudo tee -a /private/etc/shells
sudo chpass -s /usr/local/bin/bash $(whoami)
Now that we have the latest bash and I dislike not being able to have tab completion let’s install bash-completion
brew install bash-completion@2
As most any developer I have my personal preferences when it comes to my development environment. Some of these preferences have been shaped by the programming languages I do/have written. In this section, I set up any language-specific needs, installed some IDEs, and documented some useful tools and plugins.
Let’s set up some version control systems. There is only one git
, haha just kidding. That’s the only one I use though so this section is dedicated to making it like I want.
choco install git
brew install git
sudo apt install git
I like how posh_git.ps1
modifies the terminal to show status, so let’s put that in place so that our .bashrc
can source it from.
Shout out to the maintainer of the posh-git-sh
version of posh_git
curl https://raw.githubusercontent.com/lyze/posh-git-sh/master/git-prompt.sh > ~/git-prompt.sh
Probably not going to use this OS :D
<<git-prompt>>
<<git-prompt>>
I have some experience in the following languages. These are the ones I use the most so they will be setup on each computer in anticipation of doing some level of development in each.
To develop C# some SDKs need to be installed. Depending on if we are developing .Net Framework or .Net Core will determine the necessary SDK’s. These scripts assume the latest versions of .NET.
Seems kind of redundant to talk about but we first need to install dotnet sdk and runtimes.
wget https://dot.net/v1/dotnet-install.sh -P ./bin
export PATH=$PATH:$PWD/bin
dotnet-install.sh -c 6.0
#dotnet-install.sh -c 5.0
Placeholder as we might need this.
# Uncomment to install mono
# sudo apt install gnupg ca-certificates
# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
# echo "deb https://download.mono-project.com/repo/ubuntu stable-focal main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list
# sudo apt update
# sudo apt install mono-complete
Documentation around JavaScript and TypeScript is readily available with a simple search on the interwebs. If you are reading this section expecting a full-blown explanation you won’t find it. I am doing a basic setup of just adding node
and npm
as these are usually sufficient to get you moving.
brew install node # This will install npm as well
We are going to install NVM to install NodeJS.
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
# Executing this so we don't need a new shell
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
nvm install --lts
Python is a fun language with many uses. I mainly use it for developing my home automation setup. If you are ever interested in a fun DIY project I recommend looking into setting up Home Assistant. It can run on a Raspberry Pi and is fun to set up. I have set this up and my house and will never look back again.
alias python=python3
brew install go
Installing Go is as simple as
sudo snap install go --classic
To make Doom happy we need to ensure that a few packages are installed. This should install the items in the bin directory of go
.
export PATH="$HOME/go/bin:$PATH"
go install github.com/x-motemen/gore/cmd/gore@latest
go install github.com/stamblerre/gocode@latest
go install golang.org/x/tools/cmd/godoc@latest
go install golang.org/x/tools/cmd/goimports@latest
go install golang.org/x/tools/cmd/gorename@latest
go install golang.org/x/tools/cmd/guru@latest
go install github.com/cweill/gotests/gotests@latest
go install github.com/fatih/gomodifytags@latest
go install golang.org/x/tools/gopls@latest
go install mvdan.cc/sh/v3/cmd/shfmt@latest
Let’s install Emacs itself.
TODO
brew tap d12frosted/emacs-plus
# brew install emacs-plus # install the latest version of Emacs (as of writing Emacs 27)
# brew install emacs-plus@26 [options] # install Emacs 26
# brew install emacs-plus@27 [options] # install Emacs 27
brew install emacs-plus@28 # install Emacs 28
ln -s /usr/local/opt/emacs-plus/Emacs.app /Applications/Emacs.app
# Check for ~/.emacs.d if exists move it before cloning the code
if [ -d "$HOME/.emacs.d" ]
then
mv "$HOME/.emacs.d" "$HOME/.emacs.d.bak"
fi
Out of the box, Ubuntu only provides Emacs 25.3. So we need to use snap to install the latest version.
snap install emacs --classic
# The default location of the .emacs.d directory should only exist if you open emacs after installation.
if [ -d "$HOME/.emacs.d" ]
then
mv "$HOME/.emacs.d" "$HOME/.emacs.d.bak"
fi
Chemacs2 is useful for creating multiple emacs profiles. This allows you to have a `default` configuration that you know works and have others that you want to try out or tweak. I keep one profile for modifying my configuration before placing it in my default. This allows me to see if it fits into my workflow or if I am missing packages.
With chemacs you can start emacs with a specific profile by passing the --with-profile
command line option. To achieve this we need to configure a profile file ~/.emacs-profiles.el
. Let’s configure this file now with a header alerting us that this is an auto-generated file.
.emacs-profiles.el
;; DO NOT EDIT THIS FILE DIRECTLY!
;; This file is auto-generated from Applications.org
When you start emacs without specifying a profile it will use the profile named default
.
For more information regarding configuration and usage see the repo.
git clone https://github.com/plexus/chemacs2.git ~/.emacs.d
<<clone_chemacs2>>
<<clone_chemacs2>>
<<clone_chemacs2>>
I use Doom Emacs as it provides a lot of nice defaults out of the box.
Straight from the Doom Emacs repository.
Doom is a configuration framework for GNU Emacs tailored for Emacs bankruptcy veterans who want less framework in their frameworks, a modicum of stability (and reproducibility) from their package manager, and the performance of a hand rolled config (or better). It can be a foundation for your own config or a resource for Emacs enthusiasts to learn more about our favorite operating system.
Installation is pretty straightforward. The docs does a great job of going into detail of how to install.
It is known that emacs is slower when running on Windows. I currently do not use emacs on Windows machines. This is partly due to my not having a Windows machine. This will be updated once I have a Windows machine to set up. If you are interested in setting up Doom Emacs on Windows please see the documentation.
There are some specific dependencies mentioned in the MacOS installation docs which we are setting up here.
# required dependencies
brew install git ripgrep
# optional dependencies
brew install coreutils fd
# Installs clang
xcode-select --install
There are a few challenges documented in the Ubuntu installation docs. We are going to work around those now.
Doom requires git 2.28+
sudo add-apt-repository ppa:git-core/ppa
sudo apt update
sudo apt install git
This one was handled above when we installed emacs itself.
sudo apt install ripgrep fd-find
Clone the doom configuration to my custom directory. This allows me to provide this in my chemacs2 configurations.
git clone https://github.com/hlissner/doom-emacs.git ~/mydoom
<<clone_doom>>
<<clone_doom>>
<<clone_doom>>
It is easily configurable by modifying the config.el
, init.el
, and packages.el
files which by default are stored in ~/.doom.d
. For further configuration information with doom checkout the configure docs
My Doom configuration enables some modules that require a few programs to be installed on the OS.
Used for spellchecking
TODO
brew install aspell
My last install on Ubuntu didn’t require anything special for aspell
Used for enforcing code formatting when not using something like Resharper
TODO
brew install editorconfig
sudo apt install editorconfig
I use the `npm` package `marked` for the markdown compiler which enables markdown preview.
npm install -g marked
<<install_marked>>
<<install_marked>>
<<install_marked>>
sudo apt install pandoc
TODO
brew install jq
sudo apt install jq
This is used for shell script linting inside of emacs.
TODO
brew install shellcheck
sudo apt install shellcheck
brew install graphviz
sudo apt install graphviz
To make Doom happy we need to ensure that a few packages are installed. This should install the items in the bin directory of go
.
export PATH="$HOME/go/bin:$PATH"
go install github.com/x-motemen/gore/cmd/gore@latest
go install github.com/stamblerre/gocode@latest
go install golang.org/x/tools/cmd/godoc@latest
go install golang.org/x/tools/cmd/goimports@latest
go install golang.org/x/tools/cmd/gorename@latest
go install golang.org/x/tools/cmd/guru@latest
go install github.com/cweill/gotests/gotests@latest
go install github.com/fatih/gomodifytags@latest
go install golang.org/x/tools/gopls@latest
go install mvdan.cc/sh/v3/cmd/shfmt@latest
These are the packages doom doctor
will check for.
pip3 install nose pytest isort pipenv black pyflakes
Now that we have all of the dependencies installed and doom cloned let’s go ahead and set the doom
command to be runnable from anywhere by adding it to our path.
This needs to be validated before using
export PATH="$HOME/mydoom/bin:$PATH"
doom install
export PATH="$HOME/mydoom/bin:$PATH"
doom install
This allows me to have a testing ground and a known working backup.
cp -a $HOME/mydoom $HOME/backupdoom
cp -a $HOME/mydoom $HOME/backupdoom
The doom utility is extremely helpful as well as required for some things to work. Some of the items I use regularly are documented below.
doom sync
: This synchronizes your config with Doom Emacs. It ensures that needed packages are installed, orphaned packages are removed and necessary metadata is correctly generated. Run this whenever you modify your doom! block or packages.el file. You’ll need doom sync -u if you override the recipe of a package installed by another module.
doom upgrade
: Updates Doom Emacs (if available) and all its packages.
doom doctor
: If Doom misbehaves, the doctor will diagnose common issues with your installation, system and environment.
Now that we have Doom installed and all ready to go let’s add it to our .emacs-profile.el
.
(("default" . ((user-emacs-directory . "~/mydoom")
(env . (("DOOMDIR" . "~/.doom.d")))))
("lab" . ((user-emacs-directory . "~/backupdoom")
(env . (("DOOMDIR" . "~/lab")))))
("backup" . ((user-emacs-directory . "~/backupdoom")
(env . (("DOOMDIR" . "~/testingThings"))))))
This is a language-agnostic IDE that is easily extensible with plugins. You can find their documentation here.
choco install vscode
brew install vscode
I do not use vs code at home
Many others are helpful but these are the basics that I use. The others are framework and language-specific which varies based on what I am developing, as such they are not included in this list.
This is a Vim emulation plugin to enable Vim keybindings while coding in VS Code
Provides a simple way to execute jest tests without having to define a launch.json file. It adds Run | Debug
above the describe
, test
, and it
blocks for easy execution.
Provides a mechanism for pretty printing JSON files.
Microsoft’s .NET IDE. More information is here. This IDE is also only available on Windows machines. There is a version built for Mac called Visual Studio for Mac. I have tried this but it wasn’t as good as some of the other IDEs I have listed. I prefer JetBrains Rider for developing .NET on a Mac and Linux machine.
Another .NET-specific IDE. This IDE is cross-platform and has some of the helpful plugins for Visual Studio built-in. For more information about Rider go here.
It’s recommended to install things from the toolbox from JetBrains so let’s install that.
curl https://raw.githubusercontent.com/nagygergo/jetbrains-toolbox-install/master/jetbrains-toolbox.sh > jetbrains-toolbox.sh
./jetbrains-toolbox.sh
A tool for enforcing coding standards, assisting with finding code smells, and some helpful editing features. For more information about Resharper go here. I use this when I have Visual Studio installed.
A tool for measuring unit test coverage in .NET Applications. This can be installed from the toolbox
I use this specifically for creating OCI compliant images for running containerized applications. More information about docker can be here.
choco install docker-desktop
Since docker now costs money for docker desktop I am transitioning away from this particular flavor of docker.
# brew cask install docker
This should install only the daemon which remains free to use.
brew install docker
TODO
Still working through this and if I can integrate it into my workflow
This only works on versions >=20.10 otherwise it’s not in the repo
sudo apt-get install -y podman
Minikube allows you to run a Kubernetes cluster on your local machine quickly and without much configuration.
Minikube does have a few requirements to run on the machine so make sure you are at least at the minimum specs (ideally much higher).
- 2 CPUs or more
- 2GB of free memory
- 20GB of free disk space
- Interwebs
- Container or virtual machine manager, such as Docker, Hyperkit, Hyper-V, KVM, Parallels, Podman, VirtualBox, or VMWare Fusion/Workstation
Don’t use windows, please.
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-darwin-amd64
sudo install minikube-darwin-amd64 /usr/local/bin/minikube
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube
- Download the checksum
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/darwin/arm64/kubectl.sha256"
- Verify the checksum
echo "$(cat kubectl.sha256) kubectl" | shasum -a 256 --check
- Valid output is:
kubectl: OK
- Invalid output is:
kubectl: FAILED shasum: WARNING: 1 computed checksum did NOT match
- Valid output is:
- Verify the checksum
- Make it executable
chmod +x ./kubectl
- Move to a location in the
PATH
sudo mv ./kubectl /usr/local/bin/kubectl sudo chown root: /usr/local/bin/kubectl
- Download kubectl
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
- Download the checksum
curl -LO "https://dl.k8s.io/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl.sha256"
- Verify the checksum
echo "$(cat kubectl.sha256) kubectl" | shasum -a 256 --check
- Valid output is:
kubectl: OK
- Invalid output is:
kubectl: FAILED shasum: WARNING: 1 computed checksum did NOT match
- Valid output is:
- Verify the checksum
- Install kubectl
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh
Not sure if I want this but I might
This one is up for debate but it’s a helpful GUI for making API calls.
A modern web browser that is better than the rest. Their site is here.
choco install firefox
brew install firefox
Comes with Firefox out of the box so don’t have to do anything YAY!
Snap version of Firefox causes isolation of the temp dirs
wget -O ~/FirefoxSetup.tar.bz2 "https://download.mozilla.org/?product=firefox-latest&os=linux64"
sudo tar xjf ~/FirefoxSetup.tar.bz2 -C /opt/
sudo mv /usr/lib/firefox/firefox /usr/lib/firefox/firefox_backup
sudo ln -s /opt/firefox/firefox /usr/lib/firefox/firefox
Updating
wget -O ~/FirefoxSetup.tar.bz2 "https://download.mozilla.org/?product=firefox-latest&os=linux64"
sudo tar xjf ~/FirefoxSetup.tar.bz2 -C /opt/
Removal
sudo rm -fr /opt/firefox
sudo mv /usr/lib/firefox/firefox_backup /usr/lib/firefox/firefox
Another modern web browser is Chromium-based. Their site is here. I use this specifically to ensure functionality works across the different browsers.
choco install googlechrome
brew install chrome
I don’t use chrome browser here.
Nyxt is a keyboard-oriented, infinitely extensible web browser designed for power users. Conceptually inspired by Emacs and Vim, it has familiar key-bindings (Emacs, vi, CUA), and is fully configurable in Lisp.
This makes it the perfect companion for Emacs setups. I have not used this but will be looking into it when I have time.
Documentation can be found at the nyxt website.
It’s pretty cool. Kinda difficult for me since I haven’t modified any of the keybindings yet. By default, you have emacs, vi, and some ones it comes with. Since I’ve been using emacs in evil mode with space
as the leader key it’s a little confusing.
Let’s figure out how to change the keybindings shall we, then we will modify the leader key to make it closer to doom.
Chat clients are a dime a dozen and I do not claim knowledge about all or even most of them. I tend to stick with what I know and have used. I prefer Slack out of the majority of the chat tools I’ve used and as such will gladly set it up on all machines.
I use Slack to chat with friends and family. You can use Slack in the browser or view its documentation here.
TODO
brew install slack
sudo snap install slack --classic
Nope
sudo snap install discord
- MermaidJs
- coreutils for macos This installs the gnu coreutils for macOS
- bash_completion