osx display nameserver via cmd line

[user@macmini ~]#  scutil --dns | grep 'nameserver\[[0-9]*\]'
  nameserver[0] :
  nameserver[1] :
  nameserver[0] :
  nameserver[1] :
  nameserver[0] :
  nameserver[1] :

ffmpeg on osx to convert flac to Apple Lossless (’cause itune$ won’t support flac)


  1. Install brew
  2. Install ffmpeg

    user@box dir $ brew install ffmpeg --with-fdk-aac --with-ffplay --with-freetype --with-frei0r --with-libass --with-libvo-aacenc --with-libvorbis --with-libvpx --with-opencore-amr --with-openjpeg --with-opus --with-rtmpdump --with-schroedinger --with-speex --with-theora --with-tools
  3. Convert all flac files

    for f in `find . -type f -name *.flac`; do ffmpeg -i "$f"  -vf "crop=((in_w/2)*2):((in_h/2)*2)" -c:a alac "${f%.flac}.m4a"; done

Convert flac to m4a

Since iTunes doesn’t support flac (Apple is just as proprietary as Micro$oft), I needed to convert a large number of flac files to m4a.

1) Download and setup ffmpeg . I dropped the 3 files in /usr/local/bin

for i in `find . -type f -name "*.flac"`; do echo $i; ffmpeg -i "$i" -acodec alac "$i.m4a"; done;

3) Drop the files in your iTunes directory under iTunes/Automatically\ Add\ to\ iTunes.localized/

Install PyYAML on OSX – Mountain Lion

When trying to setup pyyaml on Mountain Lion, I kept seeing a yaml.h error:

my-macbook:reorganization me$ pip install pyyaml
Downloading/unpacking pyyaml
  Downloading PyYAML-3.10.tar.gz (241kB): 241kB downloaded
  Running setup.py egg_info for package pyyaml
Installing collected packages: pyyaml
  Running setup.py install for pyyaml
    checking if libyaml is compilable
    cc -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -I/usr/local/opt/sqlite/include -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c build/temp.macosx-10.8-x86_64-2.7/check_libyaml.c -o build/temp.macosx-10.8-x86_64-2.7/check_libyaml.o
    build/temp.macosx-10.8-x86_64-2.7/check_libyaml.c:2:10: fatal error: 'yaml.h' file not found
    1 error generated.
    libyaml is not found or a compiler error: forcing --without-libyaml
    (if libyaml is installed correctly, you may need to
     specify the option --include-dirs or uncomment and
     modify the parameter include_dirs in setup.cfg)
Successfully installed pyyaml
Cleaning up...

Finally, I saw and did:

my-macbook:reorganization me$ sudo easy_install pip
my-macbook:reorganization me$ sudo brew install libyaml
my-macbook:reorganization me$ sudo easy_install setuptools
my-macbook:reorganization me$ pip install -U PyYAML