Skip to content

Instantly share code, notes, and snippets.

@beddari
beddari / gist:9363794
Last active August 29, 2015 13:57
omnibus packaging workflow for gems

A workflow for packaging gems using fpm-cookery?

Given a gem with a specific version in recipe.rb:

If building "head" or "devel"

  1. Ignore the $version specified in recipe.rb
  2. Fetch and install the latest gem and deps using the "omnibus" ruby
  3. Derive the $version
recipies/
puppet
ruby-2.1
puppet-plugins
All these are buildable standalone-
But, if the puppet recipie supports omnibus-builds (extra attributes in recipe.rb), I want to be able to do both
no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty,command="/usr/local/sbin/restrict-ssh" ssh-rsa AAAAB3...VcuVQ== BackupPC
#!/usr/bin/env python
"""
Generates random articles containing loremipsum to
test Pelican site generation.
Requires the loremipsum Python module:
pip install loremipsum
@beddari
beddari / pr.md
Created August 1, 2014 16:32 — forked from ecarreras/pr.md

Locate the section for your github remote in the .git/config file. It looks like this:

Now add this lines:

[remote "github"]
	url = git@github.com:joyent/node.git
	fetch = +refs/pull/*/head:refs/remotes/github/pr/*
[alias]
pr = "!f() { git fetch -fu origin refs/pull/$1/head:pr/$1; } ; f"
prr = "!f() { git fetch -fu $1 refs/pull/$2/head:pr/$2; } ; f"
pru = "!f() { git fetch -fu upstream refs/pull/$1/head:pr/$1; } ; f"
pr-clean = "!git for-each-ref refs/heads/pr/* --format='%(refname)' | while read ref ; do branch=${ref#refs/heads/} ; git branch -D $branch ; done"
@beddari
beddari / gist:59f91a5f274e6ae9e966
Last active August 29, 2015 14:05
omnibus-installer metadata format
Projects root
https://url/path/to/root
Variables:
operatingsystem=redhat,centos,fedora,ubuntu,debian,darwin
version=majorosrelease, e.g 6 or 7 for centos, 14.04 for ubuntu
arch=output of uname -s, typically x86_64
# <project>/versions.txt
# tag version
@beddari
beddari / simpler
Created August 26, 2014 10:08 — forked from benizi/simpler
#!/bin/sh
# Print four lines showing blocks of colors: 0-7 | 0-7bold | 8-15 | 8-15bold
perl -CADS -lwe '
my $block = shift || (chr(0x2588) x 3);
for (["", 0], ["1;", 0], ["", 8], ["1;", 8]) {
my ($bold, $offset) = @$_;
my @range = map $offset + $_, 0..7;
printf "%s %-6s ", $bold ? "bold" : "norm", "$range[0]-$range[-1]";
print map("\e[${bold}38;5;${_}m$block", @range), "\e[0m"
}
config.ssh.shell = "bash -c 'BASH_ENV=/etc/profile exec bash'"
@beddari
beddari / gist:0b577c2f154a98d586da
Created October 24, 2014 19:40
Google drive direct link example
https://googledrive.com/host/0B6dgb1NG97heZDBnRzlVWWRKOE0
https://googledrive.com/host/0B6dgb1NG97heZDBnRzlVWWRKOE0/virtualbox
https://googledrive.com/host/0B6dgb1NG97heZDBnRzlVWWRKOE0/virtualbox/debian-7.5-amd64.box