Skip to content

Instantly share code, notes, and snippets.

@meduzen
Last active December 8, 2018 10:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save meduzen/2b2818a53de02cf43a7c1ae7b4f9d384 to your computer and use it in GitHub Desktop.
Save meduzen/2b2818a53de02cf43a7c1ae7b4f9d384 to your computer and use it in GitHub Desktop.
“Hey, let’s put your macOS sessions in the Active Directory and see what mess it creates for developers”

Active Directory username change on macOS

Dev things will break when your macOS sessions enters the Active Directocrap. Here are some things to help.

(This supposes your user stays administrator of the computer.)

First note

You may end up by doing some find and replace in some place where the macOS username is hardcoded (like Vagrant files, Homestead.yaml or $PATH: it’s the only ones I remember). So: /Users/oldUsername should become /Users/newUsername.

Dotfiles and Mackup

You may have to remove all dotfiles symlinks one by one and relink stuff with Mackup. I don’t remember how exactly I dealt with them, sorry and good luck.

PHP or Composer

You’ll probably have to reinstall or fix permissions of PHP and Composer. As for Dotfiles, I don’t remember how the hell I solved the problem.

Homebrew

Permissions denied

From StackOverflow:

sudo mkdir /usr/local/Frameworks
sudo chown $(whoami):admin /usr/local/Frameworks

Vagrant invalid export

(Note: all your VM’s states are probably lost forever at this point.)

From StackOverflow:

  • update Vagrant and VirtualBox

  • clean exports

  • sudo rm /etc/exports
    sudo touch /etc/exports
    vagrant halt
    vagrant up --provision

.DS_Store shit

  • find . -name "*.DS_Store" -type f -delete

In folders of Git repositories (or in the folder containing them all)

  • find "*" -type f -exec chmod 644 {} +

Laravel only (not sure it’s necessary)

  • find . -name artisan -type f -exec chmod 755 {} + -print
  • find . -name vessel -type f -exec chmod 755 {} + -print

SSH

In user root folder (/Users/username)

  • chmod 700 .ssh

In SSH folder (/Users/username/.ssh)

  • find . -name "*" -type f -exec chmod 600 {} + -print
  • find . -name "*.pub" -type f -exec chmod 644 {} + -print
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment