Fundamental

  • macOS
    • a series of proprietary graphical operating systems developed and marketed by Apple Inc. since 2001.

Configuration

Filesystem

Network Management

Linux Compatibles

Linux Software Mac Software Remarks
getopt gnu-getopt long option support
route route FreeBSD

Tools

Homebrew

References

Commands

Command Description Remarks
brew list [options] [formula|cask] List all installed formulae or casks alias: ls
brew outdated [options] [formula|cask] List installed casks and formulae that have an updated version available.
brew search [text|/text/] Perform a substring search of cask tokens and formula names for text.
brew info [options] [formula|cask] Display brief statistics for your Homebrew installation.
brew install [options] formula|cask Install a **formula** or **cask**.
brew uninstall Uninstall a package.
brew upgrade [options] [formula|cask] Upgrade outdated casks and outdated, unpinned formulae using the same options they were originally installed with, plus any appended brew formula options.
brew services list List all managed services for the current user.
brew services run Run the service without registering to launch at login (or boot).
brew services start Start the service immediately and register it to launch at login (or boot).
brew services stop Stop the service immediately and unregister it from launching at login (or boot).
brew tap [options] [user/repo] [URL] Tap a formula repository.
brew tap List all installed taps.
$ # search formula of which name containing 'openjdk'
$ brew search openjdk

$ # search formula undeer 'ethereum/ethereum' tap
$ brew search ethereum/ethereum

Repositories

Tap Description Remarks
Homebrew Cask Homebrew Cask extends Homebrew and brings its elegance, simplicity, and speed to the installation and management of GUI macOS applications such as Atom and Google Chrome.
Homebrew Ethereum Homebrew Tap for Ethereum

Tips and Tricks

Administration

Optimizing routing table in case of multiple network interfaces

Update hosts file and routing table

#! /bin/bash

declare hosts=(
  'vdi.solar.com'
  'wiki.solar.com'
  'issues.solar.com'
  'devops.solar.com'
  'helpdesk.solar.com'
)	

declare addrs=(
  '10.250.**.***'
  '10.250.**.***'
  '10.250.**.***'
  '10.250.**.***'
  '10.250.**.***'
)

# updates `hosts` file
for (( i = 0; i < ${#hosts[@]}; i++ )); do
  grep -Exq "\s*${addrs[$i]}\s+${hosts[$i]}\s*" /etc/hosts || sudo sh -c "echo '${addrs[$i]} ${hosts[$i]}' >> /etc/hosts"
done;

# updates routing table
for addr in ${addrs[@]}; do
  sudo route delete -host $addr
  sudo route add -host $addr 10.250.*.1
done;

echo ''
echo "Successfully updated host file and routing table."
echo "To check what's done, run 'cat /etc/hosts' and 'netstat -nr'."
echo ''


Community content is available under CC-BY-SA unless otherwise noted.