Skip to content

Instantly share code, notes, and snippets.

@Toady00
Toady00 / Vagrantfile
Created July 15, 2012 00:28
Vagrantfile for testing chef recipes
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::Config.run do |config|
config.vm.define :server do |server_config|
server_config.vm.customize ["modifyvm", :id, "--name", "server", "--memory", "1024"]
server_config.vm.box = "precise64_ruby193p194"
server_config.vm.box_url = "https://s3.amazonaws.com/kazumlabs-vagrant-boxes/precise64_ruby193p194.box"
server_config.vm.host_name = "server"
server_config.vm.forward_port 22, 2222, :auto => true
@Toady00
Toady00 / setwebui_adminpass.rb
Created September 14, 2012 15:21 — forked from hh/setwebui_adminpass.rb
reset admin webui password for chef
require 'rubygems'
require 'chef/config'
require 'chef/webui_user'
Chef::Config.from_file(File.expand_path("~/.chef/knife.rb"))
user = Chef::WebUIUser.load('admin')
user.set_password("MyAwesomePassword")
user.save
@Toady00
Toady00 / .bash_profile
Created September 23, 2012 06:35
Bash function to rename OS X Terminal windows and tabs
# Add this to your .bash_profile, or where ever you prefer.
function tname {
printf "\e]1;$1\a"
}
function wname {
printf "\e]2;$1\a"
}
@Toady00
Toady00 / .bash_aliases
Last active October 10, 2015 23:38
My current dot bash setup
alias la='ls -a'
alias ll='ls -alF'
alias df="df -h"
alias ping="ping -c 4"
alias sping="sudo ping -i 0.1"
alias tb="torquebox"
alias xcode="open -a /Application/Xcode.app"
# http://alias.sh
@Toady00
Toady00 / bash_setup.sh
Last active October 10, 2015 23:38
Script to copy dot files from gist into place
#!/bin/bash
mkdir ~/.bundle
curl https://gist.githubusercontent.com/Toady00/3769131/raw/4fef2f8f0e007ba37058ff3a2b31d45bc08f613b/bundle_config > ~/.bundle/config
curl https://gist.githubusercontent.com/Toady00/3769131/raw/d1402476a0f0aba91cdbe2180668b6ca48fe586f/.bash_aliases > ~/.bash_aliases
curl https://gist.githubusercontent.com/Toady00/3769131/raw/32fb14f7deb0670bbcd76c579d4fa9cca087ca85/.bash_profile > ~/.bash_profile
curl https://gist.githubusercontent.com/Toady00/3769131/raw/be799a6eef7fa4fac7e50f56d99079037a50e27a/.bash_prompt > ~/.bash_prompt
curl https://gist.githubusercontent.com/Toady00/3769131/raw/777a96d5b812f0bb05a50b5403b87eef82f6f495/.bash_rvm > ~/.bash_rvm
curl https://gist.githubusercontent.com/Toady00/3769131/raw/9834cfdbf5bb642fdd3e9e4090f7157920072f35/.bash_nvm > ~/.bash_nvm
@Toady00
Toady00 / index.html
Created November 19, 2012 05:50
A CodePen by Brandon Dennis. Particle System - Attempt at canvas based particle system. Currently trying to get particle system to stream instead of generate all particles simultaneously.
<div class='particles'></div>
@Toady00
Toady00 / gist:4601707
Created January 23, 2013 03:38
Error running remote commands via torquebox-remote-deployer.
$ rake torquebox:remote:exec["chmod +x $TORQUEBOX_HOME/stage/blog/vendor/bundle/jruby/1.9/bin/*"]
SyntaxError: /bin/chmod:1: Invalid char `\177' ('') in expressionELF>è#@@0Ã@8 @@@@@ø88@8@@@œ¶œ¶ ¾ ¾` ¾ H¾H¾`H¾`TT@T@DDPåtdx x @x @QåtRåtd ¾ ¾` ¾`àà/lib64/ld-linux-x86-64.so.2GNUGNU‚=ÿ䍨N¯2áIÚ|áçÜꎐ(<¢!@’
–hH€" <@G(ŒÜKaÆ
9Š’ûpò¼Pvž†ð–|BȒ– ‰—Î,cräbAõ9ò‹2Ä÷²¢÷§ÿÅâ¹!O¿!å>m:fë—#†ÂGI^`Ýpa2€
s {f×*5t9ΰy©=(2€y±¯ÀÞB‹ “PP¡ o@-WPe@Å TPo@ô”@0@€`@ŠÅ!pŸpÂð!@»xÂW`Â`©hÂd@5__gmon_start__libc.so.6fflushstrcpy__printf_chkreaddirsetlocalembrtowcstrncmpoptindstrrchrdcgettextclosedirfchdirerror__stack_chk_fail__lxstatiswprintreallocfstatfsabort_exitprogram_invocation_name__assert_fail__ctype_get_mb_cur_maxfts_closecallocstrlenmemset__errno_locationmemcmpfchmodat__fprintf_chkstdoutfts_readlseekmemcpyfclosemallocumaskfd
@Toady00
Toady00 / Vagrantfile
Last active December 15, 2015 08:19
Issue using VMware Fusion Vagrant provider. Only works when prefixed with "sudo". Mac OS X 10.8.3 Vagrant 1.1.2
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.define :zk1 do |zk_config|
zk_config.vm.network :private_network, ip: "192.168.123.10"
zk_config.vm.box = "precise64"
end
end
@Toady00
Toady00 / DupTest.rb
Created April 2, 2013 19:48
Testing out passing values.
class DupTest
def initialize(options = {})
options = options.dup
options[:from_init] = true
puts options
end
end
# => nil
options = {from_init: false}
@Toady00
Toady00 / JRuby.rb
Created July 14, 2013 05:08
JRuby discrepancy with Time.
# irb session using: jruby 1.7.4 (1.9.3p392) 2013-05-16 2390d3b on Java HotSpot(TM) 64-Bit Server VM 1.7.0_13-b20 [darwin-x86_64]
Time.new(2013, 1, 1, 12, 0, 0, "-05:00")
#=> 2013-01-01 12:00:00 +0500
Time.new(2013, 1, 1, 12, 0, 0, "+05:00")
#=> 2013-01-01 12:00:00 -0500