/lyraphase_workstation

lyraphase_workstation cookbook

Primary LanguageRubyGNU General Public License v3.0GPL-3.0

lyraphase_workstation cookbook

ci pre-commit pre-commit

A cookbook including various recipes for installing tools used by myself. This includes Ableton Live DAW, VSTs, and other various tools and utilities.

Requirements

  • Mac OS X

Usage

Include the recipes you want in your Chef run_list, or in your soloistrc file.

NOTE: The default URLs for non-free applications may not work for you. You may want to host your own .dmg and app install files. Please see the recipe's cooresponding attributes file for examples. All checksums are SHA256, and can be found via shasum -a 256 path/to/file/here.dmg.

You may decide to create a DAW Chef Role such as:

roles/osx-daw.json:

{
  "json_class": "Chef::Role",
  "name": "osx-daw",
  "description": "Role for configuring OSX as a Digital Audio Workstation",
  "override_attributes": {
    "homebrew": {
      "casks": [
        "keyfinder",
        "soundflower",
        "audacity"
      ]
    },
    "lyraphase_workstation": {
      "ableton_live": {
        "managed_versions": "all",
        "options": ["EnableMapToSiblings"],
        "dmg": {
          "source": "http://www.example.com/mac/dmgs/ableton_live_suite_10.0.1_64.dmg",
          "checksum": "73f8b7d9c2e058639466cbb765e6e1610f97f542745e2c69567d7bf55a407e11",
          "volumes_dir": "Ableton Live 10 Suite Installer",
          "dmg_name": "ableton_live_suite_10.0.1_64",
          "app": "Ableton Live 10 Suite"
        }
      }
    }
  },
  "run_list": [
    "recipe[lyraphase_workstation::airfoil]",
    "recipe[lyraphase_workstation::ableton_live]",
    "recipe[lyraphase_workstation::ableton_live_options]",
    "recipe[lyraphase_workstation::max_for_live]",
    "recipe[lyraphase_workstation::traktor]",
    "recipe[lyraphase_workstation::traktor_audio_2]",
    "recipe[lyraphase_workstation::dmgaudio_dualism]",
    "recipe[lyraphase_workstation::oxium]",
    "recipe[lyraphase_workstation::polyverse_infected_mushroom_i_wish]",
    "recipe[lyraphase_workstation::mixed_in_key]",
    "recipe[lyraphase_workstation::korg_kontrol_editor]",
    "recipe[lyraphase_workstation::sublime_text_settings]",
    "recipe[lyraphase_workstation::nfs_mounts]",
    "recipe[lyraphase_workstation::bash_it_custom_plugins]",
    "recipe[lyraphase_workstation::daisydisk]",
    "recipe[lyraphase_workstation::drobo_dashboard]",
    "recipe[lyraphase_workstation::prolific_pl2303_driver]"
  ]
}

There are also some non-DAW related recipes included in this cookbook.

You may also decide to create a development tool Chef Role such as:

roles/osx-development.json:

{
  "json_class": "Chef::Role",
  "name": "osx-development",
  "description": "Role for configuring OSX with developer tools",
  "override_attributes": {
    "lyraphase_workstation": {
      "nfs_mounts": [
        "/../Volumes/my-nfs-mount    -fstype=nfs,nolockd,resvport,hard,bg,intr,rw,tcp,nfc nfs://nfs-server.example.com:/export/my-nfs-mount"
      ]
    }
  },
  "run_list": [
    "recipe[sublime_text_settings]",
    "recipe[nfs_mounts]",
    "recipe[homebrew_sudoers]",
    "recipe[iterm2_shell_integration]",
    "recipe[bash4]",
    "recipe[bash_it_custom_plugins]",
    "recipe[gpg21]"
  ]
}

To use the sublime_text_settings recipe, place your Sublime Text 3 Application Data folders under

"#{node['lyraphase_workstation']['home']}/pCloud Drive/AppData/mac/sublime-text-3/"

The recipe will create Symbolic Links to these files in the usual location:

"#{node['lyraphase_workstation']['home']}/Library/Application Support/Sublime Text 3/"

The result is that your Sublime Text 3 folders get synced to pCloud, and Sublime Text can look for them in the default location, follow the symlink to the pCloud destination files.

The nfs_mounts recipe will just mount things in the list of nfs_mounts for you. The /../ part in front of /../Volumes/ happens to be important! The reason is because the OSX /etc/auto_nfs file does not usually want to mount things under /Volumes. Putting the /../ in front allows you to use automount to mount NFS volumes there.

The homebrew_sudoers recipe uses the included templates/default/sudoers.d/homebrew_chef.erb template to fix sudo permissions when running chef-client or soloist to provision your OSX machine. Without this, you may be asked for sudo password far too many times than is feasible to type. The included sudoers.d file drop-in allows the homebrew cookbook to run the commands it needs via passwordless sudo.

The iterm2_shell_integration recipe installs iTerm via iterm recipe, and then iTerm2 Shell Integration via script url https://iterm2.com/misc/install_shell_integration.sh. Checksum may not be kept up to date, but you can change this. See the recipe's attributes (attributes/iterm2_shell_integration.rb).

The iterm recipe installs iTerm via Homebrew. It then installs my default preferences file via template templates/default/com.googlecode.iterm2.plist.erb. You may not want this and may want to use a wrapper cookbook that just calls include_recipe 'iterm' so you can override my template.

The bash4 recipe installs Bash version 4 via Homebrew and changes your login shell. It also configures /etc/shells with a list of shells from attribute node['lyraphase_workstation']['bash']['etc_shells']. If you do not want to reset your login shell to bash from Homebrew, set default['lyraphase_workstation']['bash']['set_login_shell'] = false. The etc_shells_path is also configurable (see attributes/bash4.rb).

The bash_it_custom_plugins recipe uses sprout-base::bash_it to install a list of plugins for Bash-it. The default list is in node.default['lyraphase_workstation']['bash_it']['custom_plugins']. See the sprout-base cookbook for more details.

The gpg21 recipe installs GnuPG version 2.1 via homebrew/versions Homebrew Tap. It ensures that old symlinks to gpg binaries are deleted (configurable via node['lyraphase_workstation']['gpg21']['binary_paths']). Only symlinks are unlinked, no old binaries should be harmed. The recipe also installs a helper script to /usr/local/bin/fixGpgHome, and a LaunchAgents to /Library/LaunchAgents/com.lyraphase.gpg21.fix.plist. Finally, it sets RunAtLoad: false for the original /Library/LaunchAgents/org.gpgtools.macgpg2.fix.plist file. The reason for this set of patches is because the original LaunchAgent has hardcoded references to the old GnuPG binaries, and you may end up getting confused as to which version of GPG you are really using from gpg-agent, gpg, and gpg2. This recipe sets them all to the new gpg21 binaries from Homebrew. Finally, it adds StreamLocalBindUnlink yes to your /etc/ssh/sshd_config so you may use gpg-agent forwarding over SSH.

Sponsor

If you find this project useful and appreciate my work, would you be willing to click one of the buttons below to Sponsor this project and help me continue?

Method Button
GitHub 💖 Sponsor
Liberapay Donate using Liberapay
PayPal Donate with PayPal
Ko-Fi Donate with Ko-Fi

Every little bit is appreciated! Thank you! 🙏

Migration

Note: This Chef Cookbook has migrated from the old location (trinitronx/lyraphase_workstation) to LyraPhase/lyraphase_workstation. It has NOT changed ownership or maintainers at this time. It has been moved to benefit from GitHub's CI/CD automation features that are available to a GitHub Organization.

While all links to the previous repository location are automatically redirected to the new location by GitHub, it is recommended to migrate any references you may have, or previously cloned git repos to use the new URL.

To avoid confusion, we strongly recommend updating any existing local clones to point to the new repository URL.

cd path/to/trinitronx/lyraphase_workstation
git remote -vv  # List remote repos
# Find the named remote URL with 'trinitronx/lyraphase_workstation'
# (usually 'origin' by default)
# If you checked this repo out as a fork
# or named the remote repo something other than 'origin',
# then use that in the following command
git remote set-url origin https://github.com/LyraPhase/lyraphase_workstation.git
git remote -vv  # Check that the remote repo URL now contains 'LyraPhase/lyraphase_workstation'

The cookbook and recipe names have not changed. While generally repo names are not as important to Chef Infra or Cinc Client, they may appear in dependency manager files such as:

  • Policyfiles
  • Berksfiles
  • Cheffiles

You can do this easily in your codebase using the following commands:

grep -rin -l 'trinitronx/lyraphase_workstation' ./ | \
  xargs -I{} sed -i '' -e 's#trinitronx/lyraphase_workstation#LyraPhase/lyraphase_workstation#g' '{}'
grep -rin -l 'LyraPhase/lyraphase_workstation'  ./ | xargs -I{} git add '{}'
git commit -m 'Migrating Cookbook trinitronx/lyraphase_workstation => LyraPhase/lyraphase_workstation'

Then, run your dependency manager tool commands appropriately.

Attributes

Too many to list! Please see the appropriate recipe's attributes/<recipe_here>.rb file for details.

Some general rules of thumb:

  • .dmg file installers usually have the following attributes:
    • ['lyraphase_workstation']['recipe_here']['dmg']: A set of attributes describing the DMG such as:
      • ['source']: A source URL for Chef to download the DMG installer from. You must set your own! I do not intend to host these for anyone else!
      • ['checksum']: A SHA256 checksum of the .dmg file. Get this via shasum -a 256 your-file.dmg OR on *nix systems sha256sum your-file.dmg.
      • ['volumes_dir']: Directory name that the .dmg will expected to be mounted under /Volumes/.
      • ['dmg_name']: Name of the .dmg file without the .dmg suffix. That's it!
      • ['app']: Name of the .app folder inside the mounted .dmg. This maps to /Volumes/dmg_name/app_name_here.app.
      • ['type']: Type of application the dmg cookbook will install. This can be one of: app, mkpg, pkg. Default: 'app'
  • .zip file app installations usually have these attributes:
    • ['lyraphase_workstation']['recipe_here']['zip']: A set of attributes describing the .zip file:
      • ['zip']['source']: A source URL for Chef to download the ZIP archive from. Again: You must set your own! I do not intend to host these for anyone else!
      • ['zip']['checksum']: A SHA256 checksum of the .zip file. Get this via shasum -a 256 your-file.zip OR on *nix systems sha256sum your-file.zip.
  • Some recipes have support for License Keys. To use these there are two methods:
    • ['license'] data inside Chef Attributes
      • Just set the attributes like you normally would and the recipe will use them
    • ['license'] data inside Encrypted Data Bags
      • Check the recipe .rb file for the Encrypted Data Bag name, then create an encrypted data bag with the same data structure as you would put under ['license']. You may wish to use the knife-solo_data_bag gem to assist in operating on plain files. If you have a Chef Server, use the normal knife commands to operate on the data bags.
      • If the recipe finds an Encrypted Data Bag with ['license'] data (Hash), it will override the Attributes and use this instead.

Recipes

  • lyraphase_workstation::ableton_live: Install Ableton Live DAW
  • lyraphase_workstation::ableton_live_options: Manage Options.txt settings for Ableton Live DAW
  • lyraphase_workstation::airfoil: Install Airfoil
  • lyraphase_workstation::audinate_dante_controller: Install Audinate Dante Controller
  • lyraphase_workstation::bash4: Install bash v4 from Homebrew
  • lyraphase_workstation::bash_it_custom_plugins: Install some custom plugins for bash-it:
    • git-custom_subdir_gitconfig.aliases: Alias for git to support custom .gitemail author & email config files
      • For example: Commit public repos as personal email & ID
      • Commit to work repos as corporate email & ID.)
    • less-manpage-colors.bash: Set LESS_TERMCAP_* environment variables for Manpage colors in less Pager.
  • lyraphase_workstation::bitfocus_companion: Install Bitfocus Companion
  • lyraphase_workstation::cycling_74_max: Install CYCLING '74 MAX
  • lyraphase_workstation::daisydisk: Install DaisyDisk
  • lyraphase_workstation::default: No-Op recipe for just loading libraries this cookbook provides
  • lyraphase_workstation::dmgaudio_dualism: Install DMGAudio Dualism
  • lyraphase_workstation::drobo_dashboard: Install Drobo Dashboard
  • lyraphase_workstation::gpg21: Install GnuPG 2.1 via homebrew/versions Homebrew Tap
    • Note that many old Homebrew Taps have been deprecated, including homebrew/versions
    • Homebrew gpg-suite recipe version 2019.2 now installs gpg (GnuPG/MacGPG2) 2.2.17!
    • Therefore this recipe is only for legacy support purposes and it's recommended to migrate off this version. This recipe will eventually be deprecated.
  • lyraphase_workstation::hammerspoon: 'Install Hammerspoon (GitHub)
  • lyraphase_workstation::hammerspoon_shiftit: Install ShiftIt replacement: MiroWindowManager.spoon (GitHub ShiftIt Deprecated)
  • lyraphase_workstation::homebrew_sudoers: Install /etc/sudoers.d/homebrew_chef config settings to fix sudo permissions when running chef-client or soloist to provision your OSX machine.
    • Without this, you may be asked for sudo password far too many times than is feasible to type!
    • The included sudoers.d file drop-in allows the homebrew cookbook to run the commands it needs via passwordless sudo.
  • lyraphase_workstation::korg_kontrol_editor: Install Korg Kontrol Editor (Manual Archived DL)
  • lyraphase_workstation::loopback_alias_ip: Install loopback alias IP LaunchDaemon for SSH Tunneled Proxy Access to VPC / Private Network from a Docker Container
    • Adds support for local SSH tunnel port forwarding across Docker bridge networks
    • Use case for terraform explained here Note: GoLang net library must still add SOCKS5h support for hostname DNS lookup through the tunnel!
    • Any tool supporting socks5h:// protocol via HTTP_PROXY, HTTPS_PROXY environment variables should work fine! (e.g.: curl, wget, etc...)
    • How to use:
      • Install the LaunchDaemon with this recipe.
      • Set up SSH DynamicForward tunnel using the Alias IP set in node['lyraphase_workstation']['loopback_alias_ip']['alias_ip'] attribute (Default: 172.16.222.111)
        • Note: The alias_ip should be in a network range designated as Private Address Space by IANA
        • Default alias_ip (172.16.222.111) is configured to be in the 172.16.0.0/12 not publicly routable private IPv4 range.
      • Run a Docker container, passing the configured Alias IP via standard *_PROXY environment variables
        • For example:

          export PROTO='socks5h://'; export IP=172.16.222.111; export PORT=2903;
          ssh -f -N -v -D ${IP}:${PORT} ssh-bastion-host.example.com
          export ALL_PROXY="${PROTO}${IP}:${PORT}";  HTTP_PROXY="$ALL_PROXY" HTTPS_PROXY="$ALL_PROXY"
          
          • Set up Docker Networking:

            docker network create -d bridge --subnet 10.1.123.0/22 --gateway 10.1.123.1 bridgenet
            
          • Then pass the proxy to docker run ...:

            --net=bridgenet -e HTTP_PROXY=HTTP_PROXY -e HTTPS_PROXY=HTTPS_PROXY -e ALL_PROXY=ALL_PROXY
            
          • Alternatively, use a hostname inside the container's /etc/hosts:

            --add-host proxy.local:$IP
            
            export ALL_PROXY=socks5h://proxy.local:2903; export HTTPS_PROXY=$ALL_PROXY; export HTTP_PROXY=$ALL_PROXY;
            curl -v http://your-service.vpc.local
            
          • More complete docs & example can be found here

  • lyraphase_workstation::machine_name: Set MacOS machine name based on node[machine_domain] Local cookbook replacement for sprout-osx-settings::machine_name
  • lyraphase_workstation::max_for_live: Install Max for Live
  • lyraphase_workstation::mixed_in_key: Install Mixed In Key
  • lyraphase_workstation::multibit: Install Multibit
  • lyraphase_workstation::musicbrainz_picard: Install MusicBrainz Picard
  • lyraphase_workstation::nfs_mounts: Manage /etc/auto_nfs entries for NFS Client mounts on OS X
  • lyraphase_workstation::omnifocus: Install OmniFocus
  • lyraphase_workstation::osx_autohide_dock: Enable AutoHide OSX Dock, with default autohide-delay.
    • AutoHide Delay is configurable via node attribute: node['lyraphase_workstation']['settings']['autohide_delay'].
    • AutoHide Enable / Disable can be controlled via: node['lyraphase_workstation']['settings']['autohide_dock']
  • lyraphase_workstation::osx_natural_scrolling: Enable Natural Mouse Scrolling OSX setting com.apple.swipescrolldirection for a more natural & intuitive TouchPad scrolling direction.
    • Enable / Disable via: node['lyraphase_workstation']['settings']['natural_scrolling']
    • Natural Scrolling on: Scrolling up/down behaves as if you are swiping a piece of paper in the physical world
      • fingers up = page down
      • fingers down = page up
    • Natural Scrolling off: Scrolling up/down is exactly the same as the direction you are moving your fingers
      • fingers up = page up
      • fingers down = page down
  • lyraphase_workstation::oxium: Install Xils-Lab Oxium Synthesizer
  • lyraphase_workstation::polyverse_infected_mushroom_gatekeeper: Install Polyverse - Infected Mushroom - Gatekeeper VST
  • lyraphase_workstation::polyverse_infected_mushroom_i_wish: Install Polyverse - Infected Mushroom - I Wish VST
  • lyraphase_workstation::polyverse_infected_mushroom_manipulator: Install Polyverse - Infected Mushroom - Manipulator VST
  • lyraphase_workstation::prolific_pl2303_driver: Install Prolific PL2303 Driver
  • lyraphase_workstation::root_bootstrap_ssh_config: Installs a minimal .ssh/config + known_hosts file for GitHub & Homebrew bootstrap
  • lyraphase_workstation::ssh_tunnel_port_override: Install ssh-tunnel-port-override.sh script & LaunchDaemon to allow killing some process (cough McAfee -Anti-virus cough 🦠😷) that claims your favorite SSH tunnel port (Default: 8081) on login.
    • Will kill the process so long as SSH Tunnel App has not claimed the port yet.
    • Supports CPU soft limit throttling via SIGXCPU, as supported by launchd!
    • Logs to file: /var/log/ssh-tunnel-override.log
  • lyraphase_workstation::sublime_text_settings: Installs Settings symlinks for storing Sublime Text configs in pCloud Drive
  • lyraphase_workstation::trackspacer: Installs WavesFactory TrackSpacer VST plugin.
  • lyraphase_workstation::traktor: Installs Traktor DJ software
  • lyraphase_workstation::traktor_audio_2: Installs Traktor Audio 2 DJ Driver
    • Note: Apple deprecated kext/ Kernel Extension drivers in macOS Catalina 10.15.
    • Native Instruments has also officially deprecated this driver for Audio 2 version 1, which is now considered a Legacy device.
    • The Audio 2 version 2 should still operate without a kext driver as a USB class-compliant device.
    • As such, the driver installed by this recipe may not work properly in later versions of macOS >= 10.15.x
    • The Traktor Audio 2 version 1 is still supported on Linux by the snd-usb-caiaq Kernel Module!
    • Therefore, this device is a good choice for Linux & embedded systems projects, and is known to work with Open Source drivers on Intel Edison, Raspberry Pi, etc...
    • Mixxx has some notes about Native Instruments devices & controllers here
    • This device luckily does not send NHL nor MIDI, it is just a simple 2 channel sound card!
  • lyraphase_workstation::user_default_shell: Sets a default shell for your user
  • lyraphase_workstation::vimrc: Installs vimrc via git repo
  • lyraphase_workstation::xcode: Install XCode via .dmg and accepts XCode build license

Author

Author:: James Cuzella (@trinitronx)