Skip to content

Instantly share code, notes, and snippets.

View jtimberman's full-sized avatar
🚀

Joshua Timberman jtimberman

🚀
View GitHub Profile
@kevsmith
kevsmith / osx_clipboard.el
Last active October 29, 2016 13:49
osx_clipboard.el
(setq interprogram-cut-function
(lambda (text &optional push)
(let* ((process-connection-type nil)
(pbproxy (start-process "pbcopy" "pbcopy" "/usr/bin/pbcopy")))
(process-send-string pbproxy text)
(process-send-eof pbproxy))))
(setq interprogram-paste-function
(lambda ()
(shell-command-to-string "pbpaste")))
@jtopper
jtopper / gist:8588263
Last active October 7, 2021 08:06
Add a new disk to a VMWare vagrant box
config.vm.provider :vmware_fusion do |vm|
vdiskmanager = '/Applications/VMware\ Fusion.app/Contents/Library/vmware-vdiskmanager'
dir = "#{ENV['HOME']}/vagrant-additional-disk"
unless File.directory?( dir )
Dir.mkdir dir
end
return unless ['omnios'].include?(node['platform_family'])
directory '/opt/omni/etc' do
recursive true
end
execute 'pkg set-publisher -g http://pkg.omniti.com/omniti-ms/ ms.omniti.com' do
not_if 'pkg publisher ms.omniti.com'
end
@jtimberman
jtimberman / README.md
Created November 19, 2013 21:15 — forked from fnichol/README.md

Auto-enable Local HTTP Caching in Test Kitchen

Note: total experiment and hack, looks nasty, could be awesome:

Setup

  • Drop the kitchen.local.yml into $HOME/.kitchen/config.yml
  • Install polipo (with Mac: brew install polipo, with Ubuntu: apt-get install polipo)
  • Drop polipo-start and polipo-console somewhere useful (perhaps $HOME/bin?)
@fnichol
fnichol / README.md
Last active April 27, 2023 15:24
Auto-enable Local HTTP Caching in Test Kitchen

Auto-enable Local HTTP Caching in Test Kitchen

Note: total experiment and hack, looks nasty, could be awesome:

Setup

  • Drop the kitchen.local.yml into $HOME/.kitchen/config.yml
  • Install polipo (with Mac: brew install polipo, with Ubuntu: apt-get install polipo)
  • Drop polipo-start and polipo-console somewhere useful (perhaps $HOME/bin?)
---
platforms:
- name: vagrant-ubuntu-12.04
driver_config:
box: opscode-ubuntu-12.04
box_url: https://opscode-vm.s3.amazonaws.com/vagrant/opscode_ubuntu-12.04_provisionerless.box
require_chef_omnibus: true
customize:
memory: 1024
network:
@jtimberman
jtimberman / runit_service.rb
Last active December 20, 2015 10:39
Anatomy of a "plain defaults" runit_service resource, and its complimentary service resource (`:service_mirror`)
{
:name=>"plain-defaults",
# parameters specific to runit_service
:sv_bin => "/usr/bin/sv",
:sv_dir => "/etc/sv",
:service_dir => "/etc/service",
:lsb_init_dir => "/etc/init.d",
:control => [],
:options => {},
:env => {},
function table() {
case "$1" in
flip)
echo "(╯°□°)╯︵ ┻━┻ "
;;
set)
echo "┬─┬ ノ( ゜-゜ノ)"
;;
man)
echo "(╯°Д°)╯︵ /(.□ . \)"
@jtimberman
jtimberman / default.rb
Created May 2, 2013 20:56
When should I use a platform predicate method (#platform?, #platform_family?) vs a case statement?
# If you have a simple conditional, use a predicate:
if platform?("ubuntu")
# do things only applicable on Ubuntu
else
# do things on everything else
end
# If you have a complicated conditional for multiple platforms, use a case statement:
if ENV['ES_CACHE']
puts "Shared cache enabled"
if ENV['ES_CACHE_TYPE'] == 'yum'
FileUtils.mkdir_p(File.join("cache","yum")) unless Dir.exists?(File.join("cache","yum"))
config.vm.share_folder("yum", "/var/cache/yum", "cache/yum")
else
FileUtils.mkdir_p(File.join("cache","apt","partial")) unless Dir.exists?(File.join("cache","apt", "partial"))
config.vm.share_folder("apt", "/var/cache/apt/archives", "cache/apt")
end
end