My $HOME directory for Unixy OSes
- Establish your login shell; these instructions assume Bash, so (if necessary)
chsh -s /bin/bashand login a new shell to use going forward. - Install GitHub Desktop via https://desktop.github.com/ and login
- Install homebrew ("brew")
- Install GNU stuff via:
brew install coreutils findutils gnu-tar gsed gnutls gnu-indent gnu-getopt gawk grep bash-completion zsh-completion emacs- NOTE: This seems to take awhile before the new Emacs is actually invoked (try
emacs --version) - Maybe try
$ hash -rfirst, or log in a new terminal and try it there
- NOTE: This seems to take awhile before the new Emacs is actually invoked (try
- Per the output of
brew, to have various commands such astar(not only when prefixed withg, e.g.gtar) run GNU version (instead of BSD tar), edit~/.profileto specify e.g.PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH" - If the system is under your control, make sure system name (as returned by
hostname) is as desired for.emacs.d/systems/:sudo scutil --set HostName xxxsudo scutil --set LocalHostName xxxsudo scutil --set ComputerName xxx
- Install Git from e.g.: https://git-scm.com/downloads/win
- This might be the best way to get a working Bash (Git Bash)
- It also offers a Git UI that is not necessary for the present purpose
- Configure it as "Unix-like" as you feel comfortable; the less Unix-like, the more likely aliases, functions, and scripts herein might misbehave; the more Unix-like, the more likely Windows scripts might
Add local account's public RSA key (on Linux, this will be in ~/.ssh/id_rsa.pub, or do ssh-keygen -t rsa to create it) as an SSH key to https://github.com account, currently via https://github.com/settings/keys. (This might not be necessary if one uses GitHub Desktop.)
Install, if not already present, GNU Emacs from a trusted source, such as: https://www.gnu.org/software/emacs/download.html
Do either of these:
$ cd ~; git clone [email protected]:jcburley/UnixHome.git .unixhome- Use GitHub Desktop
- Change the desired target directory to specify
~/.unixhome(e.g. remove intermediate components, lowercase capitalized "UnixHome", etc.)
- Change the desired target directory to specify
$ cd ~/.unixhome/Setup
$ ./git
$ ./bash
$ ./emacs
$ cd ../bin
$ ./install.sh # Installs to ~/bin: bash-for-emacs emacs install-go.sh path rssh settitle
$ sudo ./install.sh --system # Optional, instead of './install.sh', to install to /usr/local/bin
$ cd ../build; ./install.sh # OPTIONAL, if the 'build' command is desired
Now that ~/.profile has been created, on Windows it's probably necessary to append this line to it:
PATH="$PATH:/c/Program Files/Emacs/emacs-30.1/bin"
(The actual version number will depend on which version of GNU Emacs you installed, above.)
Then start up a new Git Bash window for the changes to take effect.
Installing useful tools into /usr/local/bin, instead of ~/bin,
by using (say) the --system option with ./install.sh in a directory,
simplifies access via e.g. ssh user@system <toolname>. E.g. on my
Ubuntu 16.04 system, I can't figure out how to add ~/bin to
$PATH such that it is effective when searching for toolname in
such an ssh command. (Seems like /bin/sh, which is dash, gets
invoked by sshd only to initialize things, not to establish an
environment that's then passed to the toolname when it is actually
executed. No amount of playing around with /etc/environment, adding
PermitUserEnvironment yes to /etc/ssh/sshd_config, putting
definitions in ~/.ssh/rc, etc., seemed to have any effect on the
environment for toolname despite it having various effects on the
output if toolname was something like env.)
Make sure that etc/bashrc and etc/bash_profile get run by various methods of logging in, but do not get caught in a loop running each other (or being run by outside scripts).
~/.profiletypically doesn't try to run.bashrcor anything else, but Ubuntu 16.04, or something I installed above it on an Ubuntu machine, had one that did.__git_ps1not being found at each prompt is a symptom of this mechanism breaking, sinceetc/git-prompt.shneeds to be sourced from${UNIXHOME}, which~/.bash_profiledefines only after invoking~/.profile(which could perhaps be changed, but it's really not clear to me which startup script should be responsible for what actions across all OSes and shells, so the order in which things should be done is also unclear).
Start up GNU Emacs, and confirm:
- Personal bindings (such as
C-c wto compare windows) work - Finding a file (even if non-existent) such as
foo.jokebrings up Clojure and related modes (might have topackage-installthem)
brew upgrade
If you chose the option to check daily for Git upgrades, that should handle Git Bash.
For Emacs and other utilities, check the download links periodically and take appropriate action.