Skip to content

Instantly share code, notes, and snippets.

View ptierno's full-sized avatar

Peter Tierno ptierno

  • New Jersey, USA
  • 11:06 (UTC -05:00)
View GitHub Profile
@ptierno
ptierno / all_to_private.rake
Created September 11, 2014 18:13
Gitlab rake task to set all project's visibility level to private (0)
namespace :gitlab do
namespace :import do
desc "GITLAB | Set all projects visibility level to 'private'"
task all_to_private: :environment do |t, args|
require 'acts_as_taggable_on/taggable/core'
projects = Project.all
projects.each do |project|
if project.visibility_level != 0
puts "Setting #{project.name}'s visibility_level to 'private'"
project.visibility_level = 0
#!/bin/sh
#
# fedora-fromiso - Patch the ramdisk of Fedora to allow booting from
# ISO image
#
# Copyright (C) 2012 Mansour <[email protected]>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# How Clearance / Hoptoad does it
module Clearance
class << self
attr_accessor :configuration
end
def self.configure
self.configuration ||= Configuration.new
yield(configuration)
end
@ptierno
ptierno / README.md
Last active August 29, 2015 14:14 — forked from bitflingr/README.md

##Description Simple Dashing widget (and associated job) to display general puppetdb status. Pulled the api calls from Nedap's Puppetboard. Excellent tool BTW.

WARNING: This only works if puppetdb is listening on HTTP. I have not gotten around to getting this to work with SSL client certificates yet. If you know how, please leave them at the comments below.

##Screenshot

##Dependencies None

@ptierno
ptierno / README.md
Last active August 29, 2015 14:14 — forked from tolleiv/README.md

Puppet Radiator Widget

This is a Dashing widget and all components needed to port the original radiator information into an Dashing Widget.

##Usage

To use this widget, copy puppet_radiator.html, puppet_radiator.coffee, and puppet_radiator.scss into the /widgets/puppet_radiator directory. Put the puppet_radiator.rb file in your /jobs folder. Or simply run dashing install c695b22a12259f0809f8 to let dashing do that for you.

To include the widget in a dashboard, add the following snippet to the dashboard layout file:

@ptierno
ptierno / Gemfile
Last active August 29, 2015 14:18 — forked from sr/Gemfile
source "http://rubygems.org"
gem "janky", "~>0.9"
gem "pg"
gem "thin"
@ptierno
ptierno / gist:12e97b17869ba275f4cf
Created April 24, 2015 19:53
HTML basic scaffold
<!DOCTYPE html>
<html>
<head>
<title>Testing JQuery</title>
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
<link href="style.css" rel="stylesheet" type="text/css"></script>
</head>
<body>
</body>
@ptierno
ptierno / ec2_tags.rb
Last active August 29, 2015 14:22 — forked from yureative/ec2_tags.rb
require 'json'
Ohai.plugin(:EC2Tags) do
provides "ec2/tags"
depends "ec2"
collect_data do
region = ec2['placement_availability_zone'].chop
instance_id = ec2['instance_id']
#!/bin/bash
# User data to configure a vanilla Ubuntu EC2 instance.
# Installs chef-client (with minimal dependencies),
# configures chef, and adds roles
test $UID == 0 || (echo "Error: must run as root"; exit 1)
######### STEP 1: OPERATING SYSTEM CONFIGURATION
BOOTLOG="/var/log/bootstrap.log"
@ptierno
ptierno / octohooks.rb
Last active August 29, 2015 14:25 — forked from searls/octohooks.rb
Use Octokit to add a particular webhook to all of your repos (handy for things like chat integration)
# This is just a scratchpad after I hacked what I needed in an irb session
require 'octokit'
Octokit.configure do |c|
c.login = 'searls'
c.password = 'c0d3b4ssssss!'
end
client = Octokit::Client.new
repos = client.repos #Note, for an org's repos, see `client.orgs.first.rels[:repos].get.data`