Bootstrap shell scripts for provisioning my personal dev box. Targeting Ubuntu or macOS.
See also:
2024-11-18 20:25
Check that bootstrap will work with:
- if Ubuntu:
sudo apt-get install curl - user mode:
curl -o- https://raw.githubusercontent.com/Offirmo/open-source-dev-env/master/0-prerequisites/hello.sh | bash - admin mode:
curl -o- https://raw.githubusercontent.com/Offirmo/open-source-dev-env/master/0-prerequisites/hello.sh | sudo bash
First, set bash as default: (cf. https://www.cyberciti.biz/faq/change-default-shell-to-bash-on-macos-catalina/)
cat /etc/shells<-- check if /bin/bash is present:echo $SHELL , $0 , $BASH<-- check current shellchsh -s /bin/bash<-- switch if needed- IF NEEDED
chsh -s /bin/zsh(switch back)```
Then install git: either:
- type
gitand accept everything asked - or/and
xcode-select --install - or/and install xcode and launch it once (but takes time & a lot of disk space!)
curl -o- https://raw.githubusercontent.com/Offirmo/open-source-dev-env/master/1-provisioning/common/user--000ensure--present--work_structure.sh | bash- then remove
srcfrom the spotlight search: "Spotlight privacy"
- then remove
curl -o- https://raw.githubusercontent.com/Offirmo/open-source-dev-env/master/1-provisioning/common/user--010ensure--settings--shell.sh | bash- Settings: in
~/.profile:
#export PERSONAL_USERNAME__GITHUB=Xyz
#export COMPANY="foo"
#export COMPANY_DOMAIN="$COMPANY.com"
- Keys:
- IF WANTED copy your keys from previous machine here
- Set
export PERSONAL_USERNAME__GITHUB=Xyz curl -o- https://raw.githubusercontent.com/Offirmo/open-source-dev-env/master/1-provisioning/common/user--020ensure--present--ssh.sh | bash- if new, add the new keys to github
- go here: https://github.com/settings/keys
cat ~/.ssh/id_ed25519_offirmo.pub | pbcopycat ~/.ssh/id_ed25519_xyz.pub | pbcopy
- test it:
ssh -T git@offirmo.github.com - DELETE SSH KEYS FROM THE DISK/USB KEY!
curl -o- https://raw.githubusercontent.com/Offirmo/open-source-dev-env/master/1-provisioning/macos/user--099ensure--installed--first.sh | bash
bash ~/work/src/off/open-source-dev-env/1-provisioning/macos/user--100ensure--settings.shbash ~/work/src/off/open-source-dev-env/1-provisioning/macos/user--200ensure--installed--daily-life-utils.sh
bash ~/work/src/off/open-source-dev-env/1-provisioning/macos/user--201ensure--installed--fonts.shbash ~/work/src/off/open-source-dev-env/1-provisioning/common/user--300ensure--installed--dev-env--common.sh
bash ~/work/src/off/open-source-dev-env/1-provisioning/macos/user--301ensure--installed--dev-env--tools.sh
bash ~/work/src/off/open-source-dev-env/1-provisioning/common/user--310ensure--installed--dev-env--js.sh
bash ~/work/src/off/open-source-dev-env/1-provisioning/common/user--399ensure--cloned--common_offirmo_repos.shbash ~/work/src/off/open-source-dev-env/1-provisioning/macos/user--400ensure--installed--tools.shbash ~/work/src/off/open-source-dev-env/1-provisioning/macos/user--900ensure--installed--gaming.sh(no longer using)
Edit and check the bash config files
user--update.sh
user--clean.shgit remote prune origin
git branch --merged | grep -v "\*" | xargs -n 1 git branch -d
git gc[ "$VERBOSE__RC" == true ] && echo "* [~/.profile] hello!"https://www.jetbrains.com/toolbox/app/
Show hidden files:
- temp: https://apple.stackexchange.com/a/340543
Apple + shift + .
- définitif: (see provisioning file)
- WebStorm: File -> Import settings... -> folder "install/intellij-colors-solarized"
- iTerm (macOs) -> Prefs -> Profiles -> Colors -> color preset -> "ode/misc/iterm2"
- Terminal (macOs) -> Shell -> import -> "install/solarized"
- xcode -> Preferences -> Locations -> Command line tools https://stackoverflow.com/a/36726612
sudo smbpasswd -a sam
sudo gedit /etc/samba/smb.conf
npm adduser
https://youtrack.jetbrains.com/articles/IDEA-A-19/Shell-Environment-Loading
if [ -z "$INTELLIJ_ENVIRONMENT_READER" ]; then
...
fiAlso TODO compatibility with non-interactive shells, need no output
https://github.com/Offirmo-team/wiki/wiki/git
In .ssh/config:
Host offirmo.github.com
HostName github.com
User git
IdentityFile ~/.ssh/id_ed25519_offirmo
IdentitiesOnly yes
Host xyz.github.com
HostName xyz.github.com
User git
IdentityFile ~/.ssh/id_ed25519_xyz
IdentitiesOnly yes
In git configs:
[remote "origin"]
url = git@offirmo.github.com:Offirmo/offirmo-monorepo.git
fetch = +refs/heads/*:refs/remotes/origin/*
[user]
email = offirmo.net@gmail.com
name = Offirmo
[github]
user = Offirmo
XXXAlready in root gitconfig:
[color]
ui = auto
[push]
default = simple
Test GitHub SSH: https://help.github.com/en/github/authenticating-to-github/testing-your-ssh-connection
ssh -T git@github.com