Skip to content

Latest commit

 

History

History
807 lines (735 loc) · 29.9 KB

Applications.org

File metadata and controls

807 lines (735 loc) · 29.9 KB

Applications

Table of Contents

OS Specific prerequisites

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

Setup the package manager

Each OS has a specific package manager that can be used for installing applications.

Windows

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'))
    }
}

MacOS

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

Ubuntu has built-in package managers that we can utilize.

Nothing to setup

Nothing to setup

Terminal

On some OS’s they don’t install the latest and greatest by default. I’m looking at you MacOS

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

Development Environment

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.

VCS

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.

Windows

choco install git

MacOS

brew install git

Ubuntu

sudo apt install git

git-prompt.sh

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

Windows

Probably not going to use this OS :D

MacOS

<<git-prompt>>

Ubuntu

<<git-prompt>>

Programming Languages

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.

C#

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.

Windows

MacOS

Ubuntu

Dotnet

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
Mono

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

JS/TS

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.

Windows

MacOS

brew install node # This will install npm as well

Ubuntu

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

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.

Windows

MacOS

Ubuntu

alias python=python3

GoLang

Mac

brew install go

Ubuntu

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

IDEs

Emacs

Let’s install Emacs itself.

Windows

TODO

MacOS

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

Ubuntu

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

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

Windows

<<clone_chemacs2>>

MacOS

<<clone_chemacs2>>

Ubuntu

<<clone_chemacs2>>

Doom

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.

Dependencies

Installation is pretty straightforward. The docs does a great job of going into detail of how to install.

Windows

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.

MacOS

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
Ubuntu

There are a few challenges documented in the Ubuntu installation docs. We are going to work around those now.

Git

Doom requires git 2.28+

sudo add-apt-repository ppa:git-core/ppa
sudo apt update
sudo apt install git
Emacs

This one was handled above when we installed emacs itself.

Other dependencies
sudo apt install ripgrep fd-find

Clone

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>>

Configure

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

Additional dependencies

My Doom configuration enables some modules that require a few programs to be installed on the OS.

aspell

Used for spellchecking

Windows

TODO

MacOS
brew install aspell
Ubuntu

My last install on Ubuntu didn’t require anything special for aspell

editorconfig

Used for enforcing code formatting when not using something like Resharper

Windows

TODO

MacOS
brew install editorconfig
Ubuntu
sudo apt install editorconfig
markdown compiler

I use the `npm` package `marked` for the markdown compiler which enables markdown preview.

npm install -g marked
Windows
<<install_marked>>
MacOS
<<install_marked>>
Ubuntu
<<install_marked>>
pandoc
Ubuntu
sudo apt install pandoc
jq
Windows

TODO

MacOS
brew install jq
Ubuntu
sudo apt install jq
shellcheck

This is used for shell script linting inside of emacs.

Windows

TODO

MacOS
brew install shellcheck
Ubuntu
sudo apt install shellcheck
graphviz
Windows
MacOS
brew install graphviz
Ubuntu
sudo apt install graphviz
golang

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
python

These are the packages doom doctor will check for.

pip3 install nose pytest isort pipenv black pyflakes

Installation

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.

Windows
MacOS

This needs to be validated before using

export PATH="$HOME/mydoom/bin:$PATH"
doom install
Ubuntu
export PATH="$HOME/mydoom/bin:$PATH"
doom install

Make a backup

This allows me to have a testing ground and a known working backup.

Window
MacOS
cp -a $HOME/mydoom $HOME/backupdoom
Ubuntu
cp -a $HOME/mydoom $HOME/backupdoom

Doom utility

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.

Sync

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.

Upgrade

doom upgrade: Updates Doom Emacs (if available) and all its packages.

Doctor

doom doctor: If Doom misbehaves, the doctor will diagnose common issues with your installation, system and environment.

Setup profile

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"))))))

VS Code

This is a language-agnostic IDE that is easily extensible with plugins. You can find their documentation here.

Windows

choco install vscode

MacOS

brew install vscode

Ubuntu

I do not use vs code at home

Useful plugins

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.

Vim

This is a Vim emulation plugin to enable Vim keybindings while coding in VS Code

Jest runner

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.

Pretty js/json

Provides a mechanism for pretty printing JSON files.

Visual Studio

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.

JetBrains

Rider

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

Resharper

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.

DotCover

A tool for measuring unit test coverage in .NET Applications. This can be installed from the toolbox

Additional applications that assist with the development

Docker

I use this specifically for creating OCI compliant images for running containerized applications. More information about docker can be here.

Windows

choco install docker-desktop

MacOS

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

Ubuntu

TODO

Podman

Still working through this and if I can integrate it into my workflow

Ubuntu

This only works on versions >=20.10 otherwise it’s not in the repo

sudo apt-get install -y podman

Kubernetes

Minikube

Minikube allows you to run a Kubernetes cluster on your local machine quickly and without much configuration.

Machine Requirements

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
Windows

Don’t use windows, please.

Mac
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-darwin-amd64
sudo install minikube-darwin-amd64 /usr/local/bin/minikube
Ubuntu
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube

  1. 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"
        
    1. Verify the checksum
      echo "$(cat kubectl.sha256)  kubectl" | shasum -a 256 --check
              
      1. Valid output is:
        kubectl: OK
                    
      2. Invalid output is:
        kubectl: FAILED
        shasum: WARNING: 1 computed checksum did NOT match
                    
  2. Make it executable
    chmod +x ./kubectl
        
  3. Move to a location in the PATH
    sudo mv ./kubectl /usr/local/bin/kubectl
    sudo chown root: /usr/local/bin/kubectl
        
Ubuntu
  1. Download kubectl
    curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
        
  2. Download the checksum
    curl -LO "https://dl.k8s.io/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl.sha256"
        
    1. Verify the checksum
      echo "$(cat kubectl.sha256)  kubectl" | shasum -a 256 --check
              
      1. Valid output is:
        kubectl: OK
                    
      2. Invalid output is:
        kubectl: FAILED
        shasum: WARNING: 1 computed checksum did NOT match
                    
  3. Install kubectl
    sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
        

helm

MacOS
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
Ubuntu
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

argocd

tekton

Buildah

Not sure if I want this but I might

Postman

This one is up for debate but it’s a helpful GUI for making API calls.

Browsers

Firefox

A modern web browser that is better than the rest. Their site is here.

Windows

choco install firefox

MacOS

brew install firefox

Ubuntu

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

Chrome

Another modern web browser is Chromium-based. Their site is here. I use this specifically to ensure functionality works across the different browsers.

Windows

choco install googlechrome

MacOS

brew install chrome

Ubuntu

I don’t use chrome browser here.

Nyxt

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.

First impressions

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.

Keybindings I want to set

Let’s figure out how to change the keybindings shall we, then we will modify the leader key to make it closer to doom.

Communication

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.

Slack

I use Slack to chat with friends and family. You can use Slack in the browser or view its documentation here.

Windows

TODO

MacOS

brew install slack

Ubuntu

sudo snap install slack --classic

Discord

Windows

Nope

MacOS

Ubuntu

sudo snap install discord

Items to look at

  • MermaidJs
  • coreutils for macos This installs the gnu coreutils for macOS
  • bash_completion