How to List Brew Dependencies


Recently, after updating my installed brews, I wanted to see a list of dependencies for each installed brew. Homebrew provides a couple of useful commands to show dependencies.

brew deps

You can see the dependencies for a given brew by running the brew deps command.

$ brew deps osxfuse
autoconf
automake
gettext
libtool

brew uses –installed

You can also ask brew to tell you which brews use a particular formula with brew uses --installed.

$ brew uses --installed autoconf
automake fuse4x htop-osx osxfuse sshfs

The --installed parameter is important, without it the results will be all brew formulas, installed or otherwise.

Brew Dependencies

Both of these are useful commands but I wanted a way to list all installed brews along with their dependencies. This is the “one-liner” I came up with after some experimentation.

$ brew list | while read cask; do echo -n $fg[blue] $cask $fg[white]; brew deps $cask | awk '{printf(" %s ", $0)}'; echo ""; done

The color specifications here are for zsh. If you want to use this command on bash it would look like this.

$ brew list | while read cask; do echo -n "\e[1;34m$cask ->\e[0m"; brew deps $cask | awk '{printf(" %s ", $0)}'; echo ""; done

Here is a sample of the output.

$ brew list | while read cask; do echo -n $fg[blue] $cask $fg[white]; brew deps $cask | awk '{printf(" %s ", $0)}'; echo ""; done
 apple-gcc42
 autoconf
 automake  autoconf
 cscope
 faac
 ffmpeg  faac  lame  pkg-config  texi2html  x264  xvid  yasm
 fontconfig  freetype  libpng  pkg-config
 freetype  libpng
 fuse4x  autoconf  automake  fuse4x-kext  gettext  libtool
 fuse4x-kext
 gettext
 git
 giter8
 glib  gettext  libffi  pkg-config  xz
 gnu-go
 htop-osx  autoconf  automake  libtool
 imagesnap
 jenkins
 lame
 libdvdcss
 libevent
 libffi
 libgpg-error
 libiconv
 libksba  libgpg-error
 libpng
 libtool
 libxml2
 libxslt  libxml2
 libyaml
 macvim  cscope
 mercurial
 mtr  pkg-config
 ngrep
 openssl
 ossp-uuid
 osxfuse  autoconf  automake  gettext  libtool
 pkg-config
 popt
 readline
 reattach-to-user-namespace
 sbt
 scala
 sqlite  readline
 sshfs  autoconf  automake  gettext  glib  libffi  libtool  osxfuse  pkg-config  xz
 szip
 texi2html
 tig
 tmux  libevent  pkg-config
 vim
 wget  openssl
 x264  yasm
 xvid
 xz
 yasm
 youtube-dl

And here is a screen shot showing the colors.

brew dependencies


How to Delete Ruby Gems, Part II


Back in June I wrote about how to delete Ruby gems and presented a solution that involved a short script. Recently I went through another round of cleaning up Gems and discovered and even shorter method for deleting them.

for i in `gem list --no-versions`; do gem uninstall -aIx $i; done

This will ignore all default Gems errors. Simple and direct.

The flags specified with the gem uninstall, -aIx mean the command will remove all matching versions (-a), will ignore dependency requirements (-I), and will remove executables without needing confirmation (-x). You can read more about gem uninsall on the RubyGems Guide.


Unix Shell's Humble If


One of the best explanations of shell’s if statement.


Amazon PrimeAir


Holy crap.

It looks like science fiction, but it’s real.


Half an Operating System


The first operating system I installed on my first PC-style computer was OS/2 2.1. The company I worked for at the time was using OS/2 with a case tool called ADW, so I was familar with it and wanted to use it at home too. Eventaully it became too cumbersome to continue using and I switched to Windows for Workgroups (3.11). I knew some of the details in this article but not all. It’s a fascinating look at the early days of personal computing.


What is Reddit?


CGP Grey is wonderful at explaining things. This is as good an explanation of Reddit as you are likely to find.


Laurie Anderson's Farewell to Lou Reed


Poignant. Beautiful.

For 21 years we tangled our minds and hearts together.


Preparing for Git 2.0


After a recent update to Git I started getting the following message when doing a git push.

warning: push.default is unset; its implicit value is changing in 
Git 2.0 from 'matching' to 'simple'. To squelch this message 
and maintain the current behavior after the default changes, use: 

  git config --global push.default matching

To squelch this message and adopt the new behavior now, use: 

  git config --global push.default simple

The push.default setting controls what happens when you do a git push without specifying a branch. When push.default is set to matching all local branches are pushed to their matching remote pairs.

The new default, simple, means that when you do a git push without specifying a branch, only your current branch will be pushed to the one git pull would normally get your code from.

As the message explains you can configure this setting in your .gitconfig file by using one of the two lines below.

git config --global push.default matching

or

git config --global push.default simple

I’ve gone ahead and set my push.default to be simple.


Hostnames


A wonderful resource to get you started with hostnames. For a time I used locations from “The Lord of the Rings” books. I once worked at a place that used rivers (test machines) and planets (production machines). I think you could make good use of the periodic table of elements too. Maybe use the atomic weight as the final part of the IP address.


Million Lines of Code


I know I’m late to this party, but the apparent size of the healthcare.gov site is astounding.