Skip to content

miccal/personal-files

Repository files navigation

Get latest macos installer

softwareupdate --fetch-full-installer --full-installer-version VERSION

Create macos bootable usb

sudo '/Applications/Install macOS Sonoma.app/Contents/Resources/createinstallmedia' --volume /Volumes/Untitled --nointeraction --downloadassets

Install macos updates

softwareupdate --list

softwareupdate --all --install --force

Command line tools for xcode

xcode-select --install

Install homebrew

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Homebrew taps

brew tap homebrew/cask

brew tap miccal/miccal

Homebrew installs

HOMEBREW_CASK_OPTS="--no-quarantine" brew install m-little-snitch

cd "$(brew --caskroom)"; rm -r m-little-snitch; cd

HOMEBREW_CASK_OPTS="--no-quarantine" brew install bash curl ghostscript git pass pinentry-mac vim dropbox@beta keepingyouawake rectangle-pro

cd "$(brew --caskroom)"; rm -r dropbox@beta; cd

HOMEBREW_CASK_OPTS="--no-quarantine" brew install m-mactex-no-gui

cd "$(brew --caskroom)"; rm -r m-mactex-no-gui; cd

HOMEBREW_CASK_OPTS="--no-quarantine" brew install aspell gh gnuplot jupyterlab mas pdftoipe pwgen rsync apparency etrecheckpro folx google-chrome ipe launchcontrol m-dwsim m-libreoffice m-microsoft-outlook m-microsoft-teams m-mpv m-obs m-tex-live-utility m-tor-browser mathpix-snipping-tool omnidisksweeper homebrew/cask/onedrive proxyman sage slack@beta suspicious-package texshop textbuddy vmware-horizon-client wolfram-engine zoom

Homebrew maintenance

brew update && brew outdated --greedy --verbose && brew upgrade --dry-run && brew cleanup -s && rm -r -f "$(brew --cache)"

brew deps --installed --tree

Set homebrew bash as default

List current shells:

cat /etc/shells

Add homebrew bash:

sudo vim /etc/shells

Add to last line for Intel:

/usr/local/bin/bash

or for Arm:

/opt/homebrew/bin/bash

Check list:

cat /etc/shells

Set default shell for Intel:

chsh -s /usr/local/bin/bash miccal

or for Arm:

chsh -s /opt/homebrew/bin/bash miccal

Symlinks

ln -s ~/Library/CloudStorage/Dropbox/.homebrew_github_api_token ~/.homebrew_github_api_token

ln -s ~/Library/CloudStorage/Dropbox/.password-store ~/.password-store

Pass

pass init GPGID

pass insert -m NAME

pass generate -f -n GEN LENGTH

pass NAME

pass remove NAME

pass edit NAME

Gpg

gpg --full-generate-key

gpg --export GPGID > ~/Library/CloudStorage/Dropbox/.public.key

gpg --export-secret-key GPGID > ~/Library/CloudStorage/Dropbox/.private.key

gpg --import ~/Library/CloudStorage/Dropbox/.public.key

gpg --allow-secret-key-import --import ~/Library/CloudStorage/Dropbox/.private.key

gpg --list-keys --keyid-format short

gpg --list-secret-keys --keyid-format long

gpg --armor --export GPGID

gpg --edit-key GPGID

trust

If gpg: WARNING: unsafe permissions on homedir '~/.gnupg' is shown, run

chmod 700 ~/.gnupg

Gpg-agent

Create configuration file:

cd ~/.gnupg; touch gpg-agent.conf; textedit gpg-agent.conf

Add the following lines:

default-cache-ttl 0
max-cache-ttl 0

Reload gpg-agent:

gpgconf --kill gpg-agent; gpgconf --launch gpg-agent

Add pinentry-mac:

echo "pinentry-program $(which pinentry-mac)" >> ~/.gnupg/gpg-agent.conf

Note that for Intel:

|-> which pinentry-mac
/usr/local/bin/pinentry-mac

while for Arm:

|-> which pinentry-mac
/opt/homebrew/bin/pinentry-mac

Git setup

For brew:

cd "$(brew --repository)"

git config --global user.email "miccal.matthews@gmail.com"

git config --global user.name "miccal"

git config --global user.signingKey 'Miccal Matthews <miccal.matthews@gmail.com>'

git config --global commit.gpgSign true

git config --global gpg.program $(which gpg)

git remote add miccal https://github.com/miccal/brew

git remote set-url miccal https://github.com/miccal/brew

For homebrew-cask:

cd "$(brew --repository)"/Library/Taps/homebrew/homebrew-cask

git config --global user.email "miccal.matthews@gmail.com"

git config --global user.name "miccal"

git config --global user.signingKey 'Miccal Matthews <miccal.matthews@gmail.com>'

git config --global commit.gpgSign true

git config --global gpg.program $(which gpg)

git remote add miccal https://github.com/miccal/homebrew-cask

git remote set-url miccal https://github.com/miccal/homebrew-cask

For homebrew-core:

cd "$(brew --repository)"/Library/Taps/homebrew/homebrew-core

git config --global user.email "miccal.matthews@gmail.com"

git config --global user.name "miccal"

git config --global user.signingKey 'Miccal Matthews <miccal.matthews@gmail.com>'

git config --global commit.gpgSign true

git config --global gpg.program $(which gpg)

git remote add miccal https://github.com/miccal/homebrew-core

git remote set-url miccal https://github.com/miccal/homebrew-core

Note that for Intel:

|-> which gpg
/usr/local/bin/gpg

while for Arm:

|-> which gpg
/opt/homebrew/bin/gpg

Git check

For brew:

cd "$(brew --repository)"

git remote -v

Expected output:

miccal	https://github.com/miccal/brew (fetch)
miccal	https://github.com/miccal/brew (push)
origin	https://github.com/Homebrew/brew (fetch)
origin	https://github.com/Homebrew/brew (push)

For homebrew-cask:

cd "$(brew --repository)"/Library/Taps/homebrew/homebrew-cask

git remote -v

Expected output:

miccal	https://github.com/miccal/homebrew-cask (fetch)
miccal	https://github.com/miccal/homebrew-cask (push)
origin	https://github.com/homebrew/homebrew-cask (fetch)
origin	https://github.com/homebrew/homebrew-cask (push)

For homebrew-core:

cd "$(brew --repository)"/Library/Taps/homebrew/homebrew-core

git remote -v

Expected output:

miccal	https://github.com/miccal/homebrew-core (fetch)
miccal	https://github.com/miccal/homebrew-core (push)
origin	https://github.com/Homebrew/homebrew-core (fetch)
origin	https://github.com/Homebrew/homebrew-core (push)

Update forks

cd "$(brew --repository)"; git checkout master; git pull --rebase origin; git push miccal master; cd
cd "$(brew --repository)"/Library/Taps/homebrew/homebrew-cask; git checkout master; git pull --rebase origin; git push miccal master; cd
cd "$(brew --repository)"/Library/Taps/homebrew/homebrew-core; git checkout master; git pull --rebase origin; git push miccal master; cd

To force the update:

git checkout master; git pull --unshallow origin; git push --force miccal master; cd

Manual PR's

!!!UPDATE FORK FIRST!!!

After cd'ing into the relevant directory:

git status

git checkout -b BRANCH

touch FILE.rb

textedit FILE.rb

git add FILE.rb

git rm FILE.rb

git commit --message "PR TITLE"

git commit --all --message "PR TITLE"

git commit --amend --message "PR TITLE"

git push miccal BRANCH

git fetch --all

git fetch origin pull/ID/head:BRANCH

git rebase --interactive origin/master # squash

git push --force miccal BRANCH

git push --force-with-lease miccal BRANCH

git checkout master

git branch

git branch --delete --force BRANCH

git branch -a

git remote prune miccal

git remote prune origin

List references in a remote repository

Example:

git ls-remote https://gitlab.com/MasterPassword/MasterPassword.git

Show/hide hidden files

defaults write com.apple.finder AppleShowAllFiles TRUE; killall Finder

defaults write com.apple.finder AppleShowAllFiles FALSE; killall Finder

Filevault

List enabled users:

sudo fdesetup list

Remove Guest user:

sudo fdesetup remove -user Guest

Set dock height

defaults write com.apple.dock tilesize -integer 40; killall Dock

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks