Skip to content

Instantly share code, notes, and snippets.

@MartinNowak
Last active October 11, 2022 21:16
Show Gist options
  • Save MartinNowak/8156507 to your computer and use it in GitHub Desktop.
Save MartinNowak/8156507 to your computer and use it in GitHub Desktop.
curl follow redirects
#!/bin/sh
set -e -v
# cd $HOME
cd /var/root
# enable passwordless sudo
echo 'vagrant ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
# disable software updates
softwareupdate --schedule off
# disable spotlight indexer
mdutil -a -i off
# install ssh keys
mkdir -p .ssh
curl -L https://raw.github.com/mitchellh/vagrant/master/keys/vagrant > .ssh/id_rsa
chmod 0600 .ssh/id_rsa
curl -L https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub > .ssh/id_rsa.pub
cp .ssh/id_rsa.pub .ssh/authorized_keys
cp -r .ssh /Users/vagrant/
chown -R vagrant /Users/vagrant/.ssh
# set network configuration
scutil --set HostName `uname -s`-`uname -r`-`uname -m`
# enable sshd
systemsetup -setremotelogin on
# disable auto login
defaults delete /Library/Preferences/com.apple.loginwindow autoLoginUser || echo 0
# TODO: disable gui startup
# install Xcode command line tools
echo "Please install XCode command line tools now."
@jacob-carlborg
Copy link

  • What about installing GCC instead of/in addition to Clang? As far as I know we don't support building DMD with Clang yet.
  • If only the command line developer tools are installed, will the makefile find the SDK properly?
  • You might want to add a note how to get Mac OS X. That is, if you have bough Mac OS X from the App Store, the older versions are still available for Download from the Purchases tab.

@MartinNowak
Copy link
Author

I didn't had any problems using only the command line tools.

@AndrewEdwards
Copy link

Uses of raw.github.com on lines L18 and L20 should be changed to raw.githubusercontent.com. These urls are redirected to the correct location when used in a browser but are not redirected when used in script.

@AndrewEdwards
Copy link

@ibuclaw
Copy link

ibuclaw commented Oct 11, 2022

@MartinNowak this works with 10.13 too :-)

I already had a 10.13 machine, so just obtained the "install macOS High Sierra.app" via the appropriate means of doing so.

Recommend running: diskutil secureErase freespace 0 / before shutdown though.
Then on the host run: VBoxManage modifymedium disk "OSX-10.13.vdi" --compact - otherwise you might be left with a ~27GB vmdk, instead of ~9GB.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment