Skip to content

Instantly share code, notes, and snippets.

View trinitronx's full-sized avatar
⛩️
Zazen

James Cuzella trinitronx

⛩️
Zazen
View GitHub Profile
@trinitronx
trinitronx / osx-screensharing-featuretoggle.sh
Created June 6, 2013 22:32
A script to enable hidden OSX 'Screen Sharing.app' featuresSource for OSX 'default' command lines: http://lifehacker.com/334759/add-more-functionality-to-leopards-screen-sharing
#!/bin/bash
RESULT_ERROR=1
disp_usage=1
usage()
{
echo "$(basename $0) [-t|-b] " >&2
echo "" >&2
echo "" >&2
@trinitronx
trinitronx / set_git_email_vars.sh
Last active March 8, 2022 14:48
Function to set git author & committer email addresses based on your cwd
# Original Gist: https://gist.github.com/trinitronx/5979265
# RP Gist: https://gist.github.com/returnpathadmin/dbffee1d3d675f271435
# Function to set git author & committer email addresses based on your cwd
# Uses the very first .gitemail file found while traversing up directories
# Use case: As a developer,
# Given that I have a .gitemail file in my work directory containing my work email
# When I am in the work directory
# Then I should be able to commit with my work email address
# Given that I have a .gitemail file in my public directory containing my public email
# When I am in the public directory
|ruby-1.9.3-p392| Spica in ~/src/gloo/cookbooks/users-gloo ± |master ✗| → gem list | grep vagrant-berkshelf
vagrant-berkshelf (1.2.0)
|ruby-1.9.3-p392| Spica in ~/src/gloo/cookbooks/users-gloo ± |master ✗| → gem list | grep test-kitchen
test-kitchen (1.0.0.dev, 1.0.0.alpha.7)
|ruby-1.9.3-p392| Spica in ~/src/gloo/cookbooks/users-gloo ± |master ✗| → vagrant plugin install kitchen-vagrant
Installing the 'kitchen-vagrant' plugin. This can take a few minutes...
/Applications/Vagrant/embedded/lib/ruby/1.9.1/rubygems/dependency_installer.rb:153:in `gather_dependencies': Unable to resolve dependencies: kitchen-vagrant requires test-kitchen (~> 1.0.0.beta.1) (Gem::DependencyError)
from /Applications/Vagrant/embedded/lib/ruby/1.9.1/rubygems/dependency_installer.rb:267:in `install'
@trinitronx
trinitronx / knife_exec_to_hash_deep.txt
Last active December 20, 2015 11:39
Trying to extend Chef::Node::ImmutableMash with a to_hash_deep method in order to print out nested Mash data using knife exec
knife exec -E " require 'chef'; require 'chef/node/immutable_collections'; class Chef; class Node; class ImmutableMash < Mash; def to_hash_deep; h = Hash.new; each_pair do |k,v|; v.respond_to?(:to_hash_deep) ? h[k] = v.to_hash_deep : h[k] = v; end; h; end; end; end; end; nodes.transform(:all) {|n| puts n['sudo'].to_hash_deep unless n['sudo'].nil? }" -VV
DEBUG: Signing the request as jcuzella
DEBUG: Sending HTTP Request via GET to chef-server.example.com:443/search/node
DEBUG: ---- HTTP Status and Header Data: ----
DEBUG: HTTP 1.1 200 OK
DEBUG: server: nginx/1.2.3
DEBUG: date: Wed, 31 Jul 2013 18:03:00 GMT
DEBUG: content-type: application/json
DEBUG: transfer-encoding: chunked
DEBUG: connection: close
vagrant up --provider vmware_fusion
Bringing machine 'default' up with 'vmware_fusion' provider...
[default] VMware requires root privileges to make many of the changes
necessary for Vagrant to control it. In a moment, Vagrant will ask for
your administrator password in order to install a helper that will have
permissions to make these changes. Note that Vagrant itself continues
to run without administrative privileges.
Password:
[default] Cloning VMware VM: 'OSX-10.8.4-Mountain_Lion-x64'. This can take some time...
[default] Verifying vmnet devices are healthy...
<?xml version="1.0"?>
<!--
** DO NOT EDIT THIS FILE.
** If you make changes to this file while any VirtualBox related application
** is running, your changes will be overwritten later, without taking effect.
** Use VBoxManage or the VirtualBox Manager GUI to make changes.
-->
<VirtualBox xmlns="http://www.innotek.de/VirtualBox-settings" version="1.12-macosx">
<Machine uuid="{82f3b6b6-dd1f-4d4f-98a8-2f194d19a406}" name="OSX-10.8.4-Mountain_Lion-x64" OSType="MacOS_64" snapshotFolder="Snapshots" lastStateChange="2013-08-09T21:43:08Z">
<MediaRegistry>
<?xml version="1.0"?>
<!--
** DO NOT EDIT THIS FILE.
** If you make changes to this file while any VirtualBox related application
** is running, your changes will be overwritten later, without taking effect.
** Use VBoxManage or the VirtualBox Manager GUI to make changes.
-->
<VirtualBox xmlns="http://www.innotek.de/VirtualBox-settings" version="1.12-macosx">
<Machine uuid="{82f3b6b6-dd1f-4d4f-98a8-2f194d19a406}" name="OSX-10.8.4-Mountain_Lion-x64" OSType="MacOS_64" snapshotFolder="Snapshots" lastStateChange="2013-08-09T21:43:08Z">
<MediaRegistry>
#!/bin/bash
git clone git@github.com:trinitronx/veewee.git
cd veewee/
git co add-virtualbox-support-to-OSX-templates
bundle install
bundle exec veewee vbox define 'OSX-10.8.4-Mountain_Lion-x64' 'OSX'
sudo definitions/OSX-10.8.4-Mountain_Lion-x64/prepare_veewee_iso/prepare_veewee_iso.sh ~/path/to/OSX-10.8.4.dmg
bundle exec veewee vbox build OSX-10.8.4-Mountain_Lion-x64
@trinitronx
trinitronx / vagrant_dev_gem.log
Last active December 20, 2015 23:28
Trying to use vagrant development gem with plugins
$ EMBEDDED_DIR=/Applications/Vagrant/bin/../embedded
$ export VAGRANT_INSTALLER_EMBEDDED_DIR="${EMBEDDED_DIR}"
$ VAGRANT_LOG=DEBUG vagrant --version
INFO global: Vagrant version: 1.2.8.dev
DEBUG global: Loading core plugin: /Users/jcuzella/.rvm/gems/ruby-1.9.3-p392/gems/vagrant-1.2.8.dev/plugins/commands/box/plugin.rb
INFO manager: Registered plugin: box command
DEBUG global: Loading core plugin: /Users/jcuzella/.rvm/gems/ruby-1.9.3-p392/gems/vagrant-1.2.8.dev/plugins/commands/destroy/plugin.rb
INFO manager: Registered plugin: destroy command
DEBUG global: Loading core plugin: /Users/jcuzella/.rvm/gems/ruby-1.9.3-p392/gems/vagrant-1.2.8.dev/plugins/commands/halt/plugin.rb
INFO manager: Registered plugin: halt command
@trinitronx
trinitronx / xcode-cli-tools.sh
Last active January 18, 2024 05:20
Script to download & install XCode Command Line tools on OSX 10.7 or 10.8. Lifted from jedi4ever/veewee template.
#!/bin/sh
# 2021-12-09:
# This script is no longer supported!
# Apple broke all direct downloads without logging with an Apple ID first.
# The number of hoops that a script would need to jump through to login,
# store cookies, and download is prohibitive.
# Now we all must manually download and mirror the files for this to work at all :'-(
OSX_VERS=$(sw_vers -productVersion | awk -F "." '{print $2}')