Skip to content

Instantly share code, notes, and snippets.

View caryp's full-sized avatar

caryp

View GitHub Profile
@caryp
caryp / My Servers Widget
Created March 10, 2011 06:38
RightScale Dashboard Widget in Liquid markup
{% if servers == empty %}
<div style="text-align:center;padding:20px">-no matching servers-</div>
{% else %}
{% counter total_count = 0 %}
{% assign my_table_contents = "" %}
{% for s in servers %}
{% increment total_count %}
{% capture my_server_table_contents %}
{{ my_server_table_contents }}
<tr>
@caryp
caryp / gist:943447
Created April 27, 2011 00:05
right_rackspace .blank? workaround
# monkey patch: right_rackspace currently depends on rails .blank? method.
class Object
def blank?
respond_to?(:empty?) ? empty? : !self
end
end
@caryp
caryp / tftpserver
Created September 19, 2012 04:59
This script is for controlling OSX v5.7.4 tftpserver
#!/bin/bash -e
# This script is for controlling OSX v5.7.4 tftpserver
case "$1" in
'start')
launchctl load -F /System/Library/LaunchDaemons/tftp.plist
launchctl start com.apple.tftpd
echo "tftpserver started..."
;;
@caryp
caryp / gist:3836421
Created October 4, 2012 21:00
Use jiffies and clock independent from hypervisor
# Use jiffies and clock independent from hypervisor is recommended by Citrix: http://support.citrix.com/article/CTX128034
echo "jiffies" > /sys/devices/system/clocksource/clocksource0/current_clocksource
[ -d /proc/sys/xen ] && echo 1 > /proc/sys/xen/independent_wallclock
config.vm.provision :chef_zero do |chef|
chef.verbose_logging = true
chef.environment = "vagrant"
chef.cookbooks_path = "cookbooks"
chef.environments_path = "environments"
chef.data_bags_path = "data_bags"
chef.roles_path = "roles"
chef.nodes_path = "nodes"