Skip to content

Commit

Permalink
.osx: Comment computer name settings
Browse files Browse the repository at this point in the history
It’s good to have these commands here as a reference, but it’s annoying when running `.osx` on multiple computers in the same network.
  • Loading branch information
mathiasbynens committed Mar 6, 2014
1 parent a888a19 commit 92f4b42
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .osx
Expand Up @@ -13,10 +13,10 @@ while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
###############################################################################

# Set computer name (as done via System Preferences → Sharing)
sudo scutil --set ComputerName "0x6D746873"
sudo scutil --set HostName "0x6D746873"
sudo scutil --set LocalHostName "0x6D746873"
sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server NetBIOSName -string "0x6D746873"
#sudo scutil --set ComputerName "0x6D746873"
#sudo scutil --set HostName "0x6D746873"
#sudo scutil --set LocalHostName "0x6D746873"
#sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server NetBIOSName -string "0x6D746873"

# Set standby delay to 24 hours (default is 1 hour)
sudo pmset -a standbydelay 86400
Expand Down

5 comments on commit 92f4b42

@MoOx
Copy link

@MoOx MoOx commented on 92f4b42 Apr 26, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated my setup to have dynamic computer name depending on the model. I've an iMac & a Macbook, & this snippet generate iMoOx & MacMoOx computer name.
https://github.com/MoOx/dotfiles/blob/48da296f79856f074b254a6cc20e33504dc2ef63/components/osx/setup#L7-L24

@jgeusebroek
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, but might be better to use the serial number. In case you have more machines.

ioreg -l | grep IOPlatformSerialNumber | sed -e 's/.*\"\(.*\)\"/\1/'

@MoOx
Copy link

@MoOx MoOx commented on 92f4b42 Apr 26, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. But since I know I won't have a lots of machine, it suits my need :)
Anyway thanks for the tip.

@kud
Copy link
Contributor

@kud kud commented on 92f4b42 Apr 26, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mathiasbynens
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the tips!

Please sign in to comment.