chore: import notes from an old repository

This commit is contained in:
Michele Cereda
2024-06-15 18:48:34 +02:00
parent a65ba478ba
commit ecde1dee42
22 changed files with 274 additions and 13 deletions

View File

@@ -1,14 +1,14 @@
#!sh
#!/usr/bin/env sh
# Set the host's name.
# Set the host's name
scutil --set 'ComputerName' "$(defaults read '/Library/Preferences/SystemConfiguration/com.apple.smb.server NetBIOSName')"
scutil --set 'HostName' "$(defaults read '/Library/Preferences/SystemConfiguration/com.apple.smb.server NetBIOSName')"
scutil --set 'LocalHostName' "$(defaults read '/Library/Preferences/SystemConfiguration/com.apple.smb.server NetBIOSName')"
# Clear the DNS cache.
# Clear the DNS cache
sudo dscacheutil -flushcache; sudo killall -HUP 'mDNSResponder'
# Create custom DNS resolvers.
# Create custom DNS resolvers
cat <<-EOF | sudo tee /etc/resolver/lan
domain lan
search lan
@@ -18,6 +18,26 @@ EOF
sudo dscacheutil -flushcache; sudo killall -HUP 'mDNSResponder'
scutil --dns | grep -C '3' '192.168.1.254'
# Try resolving names.
# Try resolving names
dscacheutil -q 'host' -a 'name' '192.168.1.35'
dscacheutil -q 'host' -a 'name' 'gitlab.lan'
dscacheutil -q 'host' -a 'name' 'gitlab.lan'
# Change the number of columns and rows in the springboard
defaults write 'com.apple.dock' 'springboard-columns' -int '9'
defaults write 'com.apple.dock' 'springboard-rows' -int '7'
killall 'Dock'
# Install Xcode cli tools if missing
[[ -d "$(xcode-select --print-path)" ]] || xcode-select --install
# Install 'brew' and its bundle
# Uses the user's global Brewfile if found
command -v 'brew' > '/dev/null' || /bin/bash -c "$(curl -fsSL 'https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh')"
[[ -r "${HOME}/.Brewfile" ]] && brew bundle --global --no-lock
# Install macports
if ! command -v 'port' > '/dev/null'
then
curl -C- -o '/tmp/macports.pkg https://github.com/macports/macports-base/releases/download/v2.7.2/MacPorts-2.7.2-12-Monterey.pkg'
sudo installer -pkg '/tmp/macports.pkg' -target '/'
fi