This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use_inline_resources if defined?(use_inline_resources) | |
def whyrun_supported? | |
true | |
end | |
action :create do | |
package "patch" do | |
action :upgrade |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SeanWalbergsMacBookPro:surveys(master *) $ dig +short www.winnipegtransit.com @NS6.SO.CG.SHAWCABLE.NET | |
SeanWalbergsMacBookPro:surveys(master *) $ dig +short www.winnipegtransit.com @ns56.st.vc.shawcable.net | |
SeanWalbergsMacBookPro:surveys(master *) $ dig +short www.winnipegtransit.com @NS5.NO.CG.SHAWCABLE.NET | |
winnipegtransit.com. | |
198.163.45.39 | |
SeanWalbergsMacBookPro:surveys(master *) $ dig +short www.winnipegtransit.com @cowapdns1.winnipeg.ca | |
winnipegtransit.com. | |
198.163.45.39 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
action :create do | |
chef_gem 'f5-icontrol' | |
if pool_does_not_exist? | |
converge_by("Create pool #{pool}") do | |
create_pool | |
Chef::Log.info("#{new_resource} created pool #{pool}") | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Get your token from the HipChat website "API Access" menu | |
// Add the token and room where indicated in this line (we use "Easylog") | |
// Make a new page in your button bar with this in it: | |
javascript:(function(){function getSelectionText() { var text = "";if (window.getSelection) { text = window.getSelection().toString();} else if (document.selection && document.selection.type != "Control") {text = document.selection.createRange().text;} return text;} var auth_token = "MYTOKENGOESHERE";var room = "Easylog";var ajax = new XMLHttpRequest;var url = "https://api.hipchat.com/v2/room/" + encodeURIComponent(room) + "/notification?auth_token=" + auth_token;ajax.open('POST', url, true);ajax.setRequestHeader("Content-type", "application/json");var message = prompt('log entry?', getSelectionText()); if (message) {ajax.send('{"color":"green", "message": "' + message + '"}');} })() | |
// getSelectionText() copied from http://stackoverflow.com/questions/5379120/get-the-highlighted-selected-text |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Before | |
SeanWalbergsMacBookPro:~ $ dd if=/dev/zero of=testing bs=1m count=1024 | |
1024+0 records in | |
1024+0 records out | |
1073741824 bytes transferred in 11.015328 secs (97477062 bytes/sec) | |
# After | |
SeanWalbergsMacBookPro:~ $ dd if=/dev/zero of=testing bs=1m count=1024 | |
1024+0 records in | |
1024+0 records out |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Inside the gem | |
class ActionController::Base | |
def self.check_webhook_signature(key, *args) | |
before_filter lambda { |controller| controller.check_webhook_signature(key, controller)}, *args | |
end | |
def check_webhook_signature(key, controller) | |
# Do the work | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// From http://ertw.com/blog/2013/11/05/using-an-ip-phone-with-twilio/ | |
// Connect an incoming call to your SIP phone through Twilio | |
$called = preg_replace('/sip:1?(.*?)@.*/', '{$1}', $_POST['Called']); | |
header("content-type: text/xml"); | |
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"; | |
?> | |
<Response> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'active_support/concern' | |
module NationBuilderApi | |
extend ActiveSupport::Concern | |
def token | |
self.class.token | |
end | |
def nationbuilder(to, data) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module MyApp | |
module Database | |
def connect(pool_size = nil, reap_time = nil) | |
return unless defined? ActiveRecord::Base | |
config = Rails.application.config.database_configuration[Rails.env] | |
config['reaping_frequency'] = reap_time || ENV['AR_DB_REAP_FREQ'] || 10 # seconds | |
config['pool'] = pool_size || ENV['AR_DB_POOL'] || 5 | |
ActiveRecord::Base.establish_connection(config) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# perl test.pl | more | |
Name = root | |
UID = 0 | |
Comment = | |
Gcos = root | |
HOME DIR = /root | |
Name = root | |
UID = 0 | |
Comment = |