Skip to content

Instantly share code, notes, and snippets.

View ohadlevy's full-sized avatar

Ohad Levy ohadlevy

  • Red Hat
  • Israel
View GitHub Profile
NOTE: This server is under puppet control! Local changes may be lost.
Running <%=physicalprocessorcount %> <%= processor0.gsub(/ +/,' ') rescue hardwareisa %> on <%= operatingsystem %> <%= operatingsystemrelease %>
This host belongs to the <%= organization rescue 'None' %> organization,
its role is <%= hostgroup rescue 'unknown' %>, its located at <%= location rescue 'unknown' %> and owned by <%= owner_name %> (<%= owner_email %>)
<% if compute -%>
Running on <%= compute %>
<% end -%>
hammer discovery list
No permissions to create log dir /var/log/hammer
File /var/log/hammer/hammer.log not writeable, won't log anything to the file!
---|-----------------|-------------------|----------------------|--------|--------------|---------
ID | NAME | MAC | LAST REPORT | SUBNET | ORGANIZATION | LOCATION
---|-----------------|-------------------|----------------------|--------|--------------|---------
3 | mac28d2446939a9 | 28:d2:44:69:39:a9 | 2014-06-16T09:08:22Z | | DemoOrg | TLV
---|-----------------|-------------------|----------------------|--------|--------------|---------
require 'facter/util/ip'
Facter::Util::IP.get_interfaces.each do |interface|
Facter.debug("Running ethtool on interface #{interface}")
output = (Facter::Util::Resolution.exec("ethtool #{interface} 2>/dev/null"))
attributes = {}
output.each_line do |line|
next if line.nil? or line == ""
case line.strip
when /Speed: (.*)Mb/
Provide a brief description of the change in the first line.
Insert a single blank line after the first line.
Optionally, provide a detailed description of the change in the following lines, breaking paragraphs where needed.
@ohadlevy
ohadlevy / gist:a6d5f8c5dadb318e129a
Created October 2, 2014 19:26
pull request stats
require 'octokit'
class PullRequestStat
attr_reader :project
Octokit.auto_paginate = true
def initialize project
@project = project
end
#!/usr/bin/env ruby
require 'graphite-api'
require 'graphite-api/core_ext/numeric'
require './pull_request_stats'
# Or use the built-in one
GraphiteAPI::Logger.init(
:level => :debug,
:std => STDOUT
import DS from 'ember-data';
export default DS.RESTSerializer.extend({
extractArray: function(store, type, payload) {
// 'foreman-experimental-ui@model:setting:'
var wrapped_payload = {};
var model_name = type.toString().split(":")[1];
wrapped_payload[model_name] = payload['results'];
// TODO: handle additional API result (params, counters etc)
return this._super(store, type, wrapped_payload);
import DS from 'ember-data';
export default DS.RESTSerializer.extend({
extractArray: function(store, type, payload) {
// 'foreman-experimental-ui@model:setting:'
var model_name = type.toString().split(":")[1];
payload[model_name] = payload['results'];
delete payload['results']
// TODO: handle additional API result (params, counters etc)
return this._super(store, type, payload);
diff --git a/lib/proxy/plugin.rb b/lib/proxy/plugin.rb
index 8bdabc3..1a598c0 100644
--- a/lib/proxy/plugin.rb
+++ b/lib/proxy/plugin.rb
@@ -71,7 +71,7 @@ class ::Proxy::Plugin
end
def http_rackup_path(path)
- @get_http_rackup_path = path if http_enabled?
+ @get_http_rackup_path = path
USAGE
local_user{"ohad": uid => 1234, gid => 1234,
comment => "Ohad Levy", sudo => true,
}
define local_user ($comment, $ensure = 'present',