Main Page‎ > ‎

macos survival guide

This page gathers what I did on my macbook air.

port installation 

In order to survive on MacOS I installed port packaging system to be able to get all my favorites opensource tools following these instructions.

Here are the packages that I have installed:
port install mutt-devel +compress +gdbm +gnuregex +gpgme +headercache +imap +pop +sasl +sidebar +smtp +ssl +trash
port install tmux mosh screen lbdb rename irssi lftp wget w3m gnupg vim a2ps transfig xfig rsync bash coreutils procmail pstoedit curl urlview  dos2unix git muttprint nmap perl5 psutils python27 renameutils recode tnef2txt tnef unrar zim bzip2 gzip ImageMagick par2 plotutils ps2eps tig wget mtpfs libmtp p5-file-rename pv netcat pigz apg aspell file findutils par subversion texlive-science texlive-latex-extra texlive-latex-recommended texlive-lang-french most ncmpcpp rsnapshot gmake libsdl git gnupg
#NOT WORKING docbook-sgml-4.2 docbook-utils
sudo port install octave +atlas+doc+gcc47
port install py27-pip
port select --list pip
port select --set pip pip27
port select --list python
port select --set python python27
pip install google-api-python-client

To upgrade packages:
sudo port selfupdate
sudo port upgrade outdated
if fails port -p upgrade outdated

Reclaim some disk space from port:

sudo port clean --all all
sudo port uninstall inactive

homebrew installation

Alternatively to port, you can install brew:

/usr/bin/ruby -e "$(curl -fsSL"
  • Here are the packages that I have installed:
brew install mutt coreutils par tmux mosh lbdb rename irssi wget w3m gnupg a2ps
brew cask install osxfuse
brew install homebrew/x11/curlftpfs
brew reinstall coreutils --default-names
brew install homebrew/dupes/rsync bash procmail pstoedit curl urlview bash-completion ncdu htop hh colordiff 
brew install dos2unix git nmap perl psutils python renameutils gnu-sed
brew install tnef unrar bzip2 gzip p7zip
brew install ImageMagick par2 plotutils ps2eps tig wget libmtp pv netcat pigz apg aspell findutils par subversion 
brew install most ncmpcpp rsnapshot git
brew link ghostscript
# remove root folders in /usr/local/share...
brew install colordiff tig npm
npm install -g gitjk
brew install homebrew/science/octave
brew install homebrew/gui/meld
brew install homebrew/dupes/screen
brew install vim
brew install docbook docbook2x
export XML_CATALOG_FILES="/usr/local/etc/xml/catalog"
brew tap petere/sgml
brew install docbook docbook-dsssl docbook-sgml docbook-xsl openjade
brew install homebrew/science/transfig
brew unlink gnuplot; brew install gnuplot --with-x11
brew tap homebrew/science
brew update && brew upgrade
brew install gfortran
brew install octave
brew install fltk
brew install gnuplot
brew install xfig
brew install recode
brew install repo
brew install gpg
brew install python3 html2text pwgen mpv
brew install the_silver_searcher
brew install cunit
pip install pygame
  • zim installation:
brew install gtk-mac-integration
/usr/local/bin/pip install pyxdg
pip install --upgrade pip
tar zxf zim-0.65.tar.gz
cd zim-0.65“update-desktop-database”) in
/usr/local/bin/python ./ install
brew cask install --appdir="/Applications" --force macvim
brew cask install --appdir="/Applications" --force mactex
brew cask install --appdir="/Applications" --force cyberduck sigil texmaker calibre handbrake arduino iterm2 shiftit transmission-remote-gui gqrx vlc grandperspective gramps firefox
brew cask install --appdir="/Applications" --force google-chrome google-drive
brew cask install osxfuse
brew cask install atom textwrangler
brew install homebrew/fuse/ext4fuse
brew install homebrew/fuse/ntfs-3g
brew install Caskroom/cask/google-photos-backup
brew install Caskroom/cask/google-drive
brew install Caskroom/cask/google-chrome
brew install Caskroom/cask/meld
brew install  Caskroom/cask/virtualbox Caskroom/cask/virtualbox-extension-pack
brew install docker Caskroom/cask/docker-toolbox
brew install Caskroom/cask/kindle-comic-converter Caskroom/cask/kindlegen Caskroom/cask/kindle
brew cask install the-unarchiver
brew cask install spotify

  • update brew through
brew update
brew upgrade

Remove startup programes

  • find process with launchctl command
sudo launchctl list | grep -v apple
  • stop current session with launchctl remove label_of_program_to_remove
sudo launchctl remove com.fitbit.galileod
sudo launchctl remove com.leapmotion.leapd
  • erradicate it by removing instance in /Library/LaunchAgents/ or ~/Library/LaunchAgents/ folder
You can also add/remove startup actions in settings->users->startup menu.

Find processes preventing system to go to suspend

In order to find what is keeping your mac awake, use the following command:
pmset -g assertions | egrep '(PreventUserIdleSystemSleep|PreventUserIdleDisplaySleep)'

Timemachine tweaks

mdfind "com_apple_backup_excludeItem = ''"
tmutil addexclusion ~/Downloads/
tmutil addexclusion Calibre\ Library
tmutil addexclusion Applications/
tmutil addexclusion ./.Trash/
sudo defaults write /System/Library/LaunchDaemons/ StartInterval -int 604800
sudo defaults write /Library/Preferences/ MaxSize 204800

Mount ext4 ntfs partitions

After installing osxfuse ext4fuse and ntfs-3g you can use diskutil to identify partition number and:
diskutil list
sudo ext4fuse /dev/disk2s1 /mnt/ext4
sudo ntfs-3g /dev/disk2s1 /mnt/ntfs -olocal -oallow_other

Change hostname

sudo scutil --set ComputerName "imarc"
sudo scutil --set LocalHostName "imarc"
sudo scutil --set HostName "imarc"

Upload Maildir to gmail

git clone
brew install berkeley-db4
pip install bsddb3
BERKELEYDB_DIR=$(brew --cellar)/berkeley-db@4/4.8.30 pip install bsddb3
  7     #import bsddb
  8     import bsddb3 as bsddb

Use it like this: -u -p mypasswordortoken -f tag maildirbox/cur