AlanGreene / starter

Dotfiles starter project for new machines
1 stars 1 forks source link

Misc scripts / helpers #31

Closed AlanGreene closed 3 years ago

AlanGreene commented 4 years ago
AlanGreene commented 3 years ago

https://github.com/paulmillr/dotfiles/blob/master/etc/bootstrap-macos.sh

Set hostname

echo 'Enter new hostname of the machine (e.g. macbook-paulmillr)'
  read hostname
  echo "Setting new hostname to $hostname..."
  scutil --set HostName "$hostname"
  compname=$(sudo scutil --get HostName | tr '-' '.')
  echo "Setting computer name to $compname"
  scutil --set ComputerName "$compname"
  sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server NetBIOSName -string "$compname"

Generate SSH key and upload to GitHub

pub=$HOME/.ssh/id_ed25519.pub
echo 'Checking for SSH key, generating one if it does not exist...'
  [[ -f $pub ]] || ssh-keygen -t ed25519

echo 'Copying public key to clipboard. Paste it into your Github account...'
  [[ -f $pub ]] && cat $pub | pbcopy
  open 'https://github.com/account/ssh'
AlanGreene commented 3 years ago

Prompt feedback on error done using starship

Moved comment above to new issue