This file contains 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
# To parse a tweet from twitter to get teh '@' , '#' and the text seperated | |
parsed_text = tweet.text.gsub(/ ?(@\w+)| ?(#\w+)/) { |a| ((a.include?('#')) ? tags : replies) << a.strip.gsub(/#|@/,''); '' } |
This file contains 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
diff --git a/Gemfile b/Gemfile | |
index fd90d42..9dd0146 100644 | |
--- a/Gemfile | |
+++ b/Gemfile | |
@@ -1,4 +1,6 @@ | |
source 'http://rubygems.org' | |
+gem 'perftools.rb', '>= 0.4.4' | |
+gem 'rack-perftools_profiler' | |
gem 'rails', '3.0.0.rc' |
This file contains 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
#!/bin/bash | |
# SPDX-License-Identifier: MIT | |
## Copyright (C) 2009 Przemyslaw Pawelczyk <[email protected]> | |
## | |
## This script is licensed under the terms of the MIT license. | |
## https://opensource.org/licenses/MIT | |
# | |
# Lockable script boilerplate | |
This file contains 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
include foo |
This file contains 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
Usage: puppet-package-over-ssh.rb HOST PACKAGE ACTION | |
% ruby puppet-package-over-ssh.rb snack sl uninstall | |
Package[sl] uninstall status: {:status=>"not-installed", :error=>"ok", :desired=>"unknown", :ensure=>:purged, :name=>"sl", :provider=>:apt} | |
% ruby puppet-package-over-ssh.rb snack sl install | |
Package[sl] install status: {:status=>"installed", :error=>"ok", :desired=>"install", :ensure=>"3.03-16", :name=>"sl", :provider=>:apt} | |
% ruby puppet-package-over-ssh.rb snack fancypants install | |
Could not install package Package[fancypants]: Execution of 'ssh snack sudo "/usr/bin/apt-get" "-q" "-y" "-o" "DPkg::Options::=--force-confold" "install" "fancypants"' returned 100: Reading package lists... | |
Building dependency tree... |
This file contains 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
Come see my teammate Derek Collison talk about the PaaS we've been building at VMware | |
http://www.rubyconf.org/presentations/8 | |
⚡ $ vmc -h | |
version # version | |
help, -h # show usage |
This file contains 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
(master)⚡ % vmc services | |
========== System Services ========== | |
Service Ver Description | |
------- --- ----------- | |
rabbitmq 2.1.1 RabbitMQ service | |
mysql 5.1 MySQL database service | |
redis 2 Redis key-value store service |
This file contains 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
#!/usr/bin/ruby | |
require "rubygems" | |
require "rest_client" | |
require "json" | |
require "uri" | |
fqdn = ARGV[0] || raise("Must define a fqdn") | |
mac = ARGV[1] || raise("Must define a mac") |
This file contains 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 'rubygems' | |
require 'rack' | |
class Object | |
def webapp | |
class << self | |
define_method :call do |env| | |
func, *attrs = env['PATH_INFO'].split('/').reject(&:empty?) | |
[200, {}, send(func, *attrs)] | |
end |
This file contains 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
{ | |
"id": "0123456789abcdef", | |
"name": "myname", | |
"provider": "puppet", | |
"role": "some_identifier_from_cm_system_can_be_nil?", | |
"timestamp": 1290616560, | |
"provisioned": "true", | |
"os": { | |
"name": "linux", | |
"version": "2.6.35-22-generic", |
OlderNewer