3rdstage's Wiki
Advertisement

Fundamental

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

Configuration

Filesystem

  • Software installation locations
Software Installed Directory Sample Remarks
Oracle JDK /Library/java/JavaVirtualMachines/jdk-version.jdk/ /Library/java/JavaVirtualMachines/jdk-17.0.2.jdk/

Network Management

Linux Compatibles

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

Misc


Tools

Homebrew

  • Homebrew Formulae an online package browser for Homebrew
  • 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.

References

  • Homebrew Formulae : a listing of all packages available from the core tap via the Homebrew package manager for macOS and Linux.

Commands

Command Description Remarks
brew list [options] [formula|cask] List all installed formulae or casks alias: ls
brew install [options] formula|cask Install a formula or cask.
brew uninstall Uninstall a package.
brew info [options] [formula|cask] Display brief statistics for your Homebrew installation.
brew outdated [options] [formula|cask] List installed casks and formulae that have an updated version available.
brew formulae List all locally installable formulae including short names. Homebrew Formulae
brew search [text|/text/] Perform a substring search of cask tokens and formula names for text.
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.
  • Never use brew upgrade to upgrade single formula. Use brew install.
$ # search formula of which name containing 'openjdk'
$ brew search openjdk

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

Formulaes/Casks

Category Formulae/Casks Description Remarks
Formulae sevenzip 7-Zip is a file archiver with a high compression ratio 7-Zip
mariadb Drop-in replacement for MySQL
Casks mysqlworkbench Visual tool to design, develop and administer MySQL servers MySQL Workbench

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

Readings


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 ''


Advertisement