Skip to content

Instantly share code, notes, and snippets.

View rbuck's full-sized avatar

Robert Buck rbuck

View GitHub Profile
@rbuck
rbuck / install-vmware-tools.sh
Created January 20, 2017 15:57
Install VMWare Tools on Ubuntu Server
#!/bin/sh
# I use local VMs on Mac for all our development in
# Docker. And our choice of VM technology is VMWare.
# And those VMs are Ubuntu Server based. One issue,
# VMWare Tools fails to install, and I've never seen
# it succeed once with years of use.
# That said, VMWare is far superior to VirtualBox.
# For VirtualBox, we find the Docker and Kinematic
@rbuck
rbuck / ruby_globals.rb
Created September 27, 2012 14:07
How to get a hash listing all Ruby globals
def get_globals
hash = {}
global_variables.sort.map do |symbol|
begin
value = eval ("#{symbol}")
hash[symbol] = value unless value.nil?
rescue
nil
end
end
@rbuck
rbuck / config.ru
Created September 20, 2012 21:34
How to hook some other Event Machine activity into the Sinatra event machine
require 'rubygems'
require 'eventmachine'
require 'sinatra/base'
EM.next_tick do
EventMachine.add_periodic_timer(1) do
puts "hello"
end
end
@rbuck
rbuck / config.ru
Created September 20, 2012 19:18
Sinatra shutdown issues: `to_app': missing run or map statement (RuntimeError)
require 'rubygems'
require 'eventmachine'
require 'sinatra/base'
require 'sinatra'
EM.run {
EventMachine.add_periodic_timer(1) {
puts "hello"
}
my_app = Sinatra.new { get('/') { "hi" } }
@rbuck
rbuck / gist:1606115
Created January 13, 2012 13:27
Setting Up Mac Terminal App Home and End Keys
Finding conflicting information on the web I decided to write a Gist on the topic.
First open Terminal, then select Terminal, Preferences, Settings.
For the Home and End keys set 'send string to shell', and in the text box enter Control-A for Home and Control-E for End.
@rbuck
rbuck / package-rrdtool-collectd.sh
Created January 12, 2012 17:03
Create rrdtool plus collectd package on Solaris 11
wget http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.4.5.tar.gz
(
cd rrdtool-1.4.5
./configure --prefix=/opt/rrdtool
make
sudo make install
)
wget http://collectd.org/files/collectd-5.0.1.tar.gz
tar xzvf collectd-5.0.1.tar.gz