/dotfiles

Custom .bashrc, custom logger script

Primary LanguageShellGNU General Public License v3.0GPL-3.0

Dotfiles

This is a repository containing my custom dotfiles and custom commands and terminal settings.

It also contains my notes for software installations and configurations for various systems, especially Linux and macOS.

Setup

Clone this repo

git clone https://github.com/stevekm/dotfiles.git
cd dotfiles

Enable or disable the sets of configs you want in bashrc_extras or zshrc_extras

  • zsh is the default shell on a lot of newer Mac's, but many bash shell configs and aliases should still work

Add the following entry to your ~/.bashrc:

source ~/dotfiles/bashrc_extras
  • you may also need to create a file ~/.bash_profile as well if its not present and may also need to source the .bashrc from there too
  • if using zsh then source ~/dotfiles/zshrc_extras from ~/.zshrc instead

Restart your shell session for changes to take effect

Should look like this:

image

Also do not forget to copy the included inputrc file to enable better scrollback in your terminal;

cp inputrc ~/.inputrc

(also requires a terminal restart to take effect)

With this, you will be able to e.g. type s into your shell then press Up/Down Arrow keys to scroll through all commands in your shell history that start with "s" (such as that long ssh command you used last month which you cant remember now).

Git

NOTE: if you are on macOS and your git is not working, check out the section below about setting up Xcode first

Set up your git username and email.

git config --global user.name "My Name"
git config --global user.email "username@users.noreply.github.com"

Conda

These days I typically install conda on most systems I will be using because it makes life easier.

The Miniconda latest docs and download is here; https://docs.conda.io/en/latest/miniconda.html

The Miniconda installer archive is here; https://repo.anaconda.com/miniconda/

Pick the version appropriate for your system. I usually download the .sh installer, and then install it with;

bash Miniconda3-latest-MacOSX-arm64.sh

I generally let the installer put Miniconda in the default location (~/miniconda3) and let it run the conda init step.

NOTE that running conda init will update your .bashrc and/or .zshrc, and possibly other shell config files, in order to make conda available by default in your shell. If you are going to use the bashrc_extras and zshrc_extras included here, you MUST update your .bashrc/.zshrc in order to source these files after the section included by conda init. Otherwise, both conda and the extras included here are likely to not work.

More

Ubuntu

Notes specific to setting up a personal Ubuntu instance are in ubuntu.txt

Nvidia GPU

Notes specific to configuring advanced settings for Nvidia GPU are in nvidia.txt and also in ubuntu.txt

macOS

Extra notes specific to setting up macOS

XCode

  • https://developer.apple.com/xcode/resources/
  • also on the App Store https://apps.apple.com/us/app/xcode/id497799835?mt=12
  • has a bunch of core tools and libraries that all dev tools require
  • if you are not actually building macOS / iOS apps, then you do not need to download the entire giant XCode application, you only need the CLI Tools supplemental pack, which must be installed separately
  • HOWEVER, Apple has recently started requiring you to log in with an Apple ID in order to access the CLI Tools installer (previously it was all publically downloadable), so you will likely have to either click through that homepage and login with an Apple ID, or log in to the Apple App Store to download
  • after you have installed Xcode and/or the Xcode CLI Tools packs, you must accept License Agreement before any cli tool (such as git) will work
  • accepting the agreement can sometimes be a PIA to do from the Terminal, so it might be easier to just go ahead and install the full Xcode application anyway if only to have an easier GUI window to click through to "Accept" the first time you launch Xcode
  • sometimes if you upgrade macOS, you might need to do this whole process again before your cli tools (which worked fine before upgrading) will work again. Thanks, Apple.
  • Application manager for macOS
  • see the homepage for the latest install instructions; https://brew.sh/
  • some homebrew repos that you might need to add (or maybe not):
brew tap caskroom/cask
brew tap homebrew/science
  • other useful Homebrew packages
# some GNU-like utilities that don't ship with macOS by default
brew install coreutils

# helpful tools
brew install wget 
brew install awscli
brew install btop
brew install tree
brew install watch

# quick & easy batch image conversion in the Terminal
brew install imagemagick

# manipulation of PDFs
brew install ghostscript

# if you ran into .7z archives or other weird archives you need to extract
brew install p7zip

# the versions of some basic tools included in macOS are ancient so you might want newer versions with extra better features
brew install rsync
brew install make  # GNU "make" has been installed as "gmake"
brew install bash 

Apps

  • also on the App Store; https://cyberduck.io/appstore
  • File manager for remote servers
  • Lets you edit code saved on remote servers in your local editor and syncs changes back to the remote server as you make them!
  • stop trying to dev your code on the remote server using vim and just open the remote code locally in your locally installed VS Code through CyberDuck
  • also dont bother using the "sftp" extension for VS Code because Cyberduck can open all files in the local app of your choice
  • thank you CyberDuck you're a life saver! :)
  • set up a Bookmark for your desired server, using SFTP and your ssh credentials to access the server's remote filesystem
  • CyberDuck supports a ton of other remote access methods like FTP, S3, etc., but SFTP tends to be the most useful since it gives you access to any server you can ssh into
  • Better terminal for OS X
  • Good code editor
  • if you dont like Visual Studio Code then try Sublime Text
  • MS Paint alternative for Mac. Quick & easy image editing. Or just use Preview.
  • Reverse scrolling direction of touchpad and/or mouse on Mac, so you can have your mouse use normal scrolling and your touchpad use natural scrolling
BetterSnapTool
Docker
  • Enables X11 graphical windows for terminal programs on remote servers, like IGV
brew cask install xquartz
  • after installation, make sure you log into the server with the -Y argument: ssh username@server.com -Y
  • with this installed, opening a program in the terminal which can use X11 windows (such as IGV or Firefox) should auto-magically load in a GUI X window on your local Mac
  • latency is extremely high while running remote apps via local X windows like this so its recommended only for testing purposes, not a good solution for programs you need to use heavily frequently
  • LaTeX PDF typesetting program installation for OS X