Skip to content

Instantly share code, notes, and snippets.

@timsutton
timsutton / make_brew_omnibus_osx_pkg.sh
Last active August 29, 2015 14:10
Dead-simple Omnibus-style installer package builder for OS X using Homebrew.
#!/bin/sh -e
#
# make_brew_omnibus_osx_pkg.sh
# Tim Sutton, 2014
#
# Dead-simple Omnibus-style installer package builder for OS X using Homebrew. It
# takes no command-line options or arguments: all configuration is done using
# environment variables:
#
# - FORMULA: (required) name of Homebrew formula
@jamesez
jamesez / build.sh
Created July 3, 2012 13:31
Adobe AIR Munki Packaging
#!/bin/bash -ex
# download latest Adobe AIR
ftp -o adobeair.dmg http://airdownload.adobe.com/air/mac/download/latest/AdobeAIR.dmg
# Mount disk image on temp space
mountpoint=`hdiutil attach -mountrandom /tmp -nobrowse adobeair.dmg | awk '/private\/tmp/ { print $3 } '`
echo Mounted on $mountpoint
# Obtain version
@ahpook
ahpook / data_in_modules.md
Created February 8, 2013 14:11
Data in modules summary

Data in Modules Summary

Problem Statement

Currently, module authors use a 'params class pattern' to provide defaults for the parameters their classes accept. A module for managing a database service mydb, for example, will provide a class mydb::params, which contains parameter assignments like $mydb::params::tcp_port, $mydb::params::install_dir, etc. These assignments can use the puppet DSL for conditional logic so that the install_directory follows different OS' filesystem conventions appropriately. The parameter values are then used in the module's other classes, either in the prototype for the class or directly in the manifest:

class mydb::packages (

$tcp_port = $mydb::params::tcp_port,

@jedi4ever
jedi4ever / gist:4954727
Last active December 13, 2015 18:19
vm building with veewee CI tuning notes

CPU

  • OK - introduced VEEWEE_CPU_COUNT to override the number of cpus

problem(s):

  • multiple CPU's don't get passed to compiles so only CPU is busy

MEMORY

  • introduced VEEWEE_MEMORY_SIZE to override the memory size
@btm
btm / install.sh.erb
Last active December 25, 2015 14:59
opscode-omnitruck/views/install.sh.erb 2013-10-15 / af7c7b45f0b60e0faef6c7b51108abae713e0c41
#!/bin/bash
# This is the current stable release to default to, with Omnibus patch level (e.g. 10.12.0-1)
# Note that the chef template downloads 'x.y.z' not 'x.y.z-r' which should be a duplicate of the latest -r
use_shell=0
prerelease="false"
# Check whether a command exists - returns 0 if it does, 1 if it does not
exists() {
diff --git a/YouTubeCore.py b/YouTubeCore.py
index d955e49..b088134 100644
--- a/YouTubeCore.py
+++ b/YouTubeCore.py
@@ -397,7 +397,10 @@ class YouTubeCore():
return ret_obj
if get("url_data"):
- request = urllib2.Request(link, urllib.urlencode(get("url_data")))
+ args = {}
@jedi4ever
jedi4ever / gist:3698451
Created September 11, 2012 13:26
Puppet loop over hash and pass array of args to sysctl
Exec { path => '/usr/bin:/usr/sbin/:/bin:/sbin' }
$sysctl_settings = {
# On Hardware Node we generally need
# packet forwarding enabled and proxy arp disabled
"net.ipv4.ip_forward" => 1 ,
"net.ipv6.conf.default.forwarding" => 1 ,
"net.ipv6.conf.all.forwarding" => 1 ,
"net.ipv4.conf.default.proxy_arp" => 0 ,
# Enables source route verification
@vStone
vStone / test.txt.erb
Created December 4, 2012 07:05
Puppet Template Headers
Original header used now:
### File managed with puppet ###
## Served by: '<%= scope.lookupvar('::servername') %>'
## Module: '<%= scope.to_hash['module_name'] %>'
## Template source: 'MODULES<%= template_source.gsub(Regexp.new("^#{Puppet::Node::Environment.current[:modulepath].gsub(':','|')}"),"") %>'
Problem: When using puppet apply with relative modulepath, the information can be wrong or messy.
Alternative 1:
@koter84
koter84 / travis_secure_private_key.sh
Last active April 18, 2017 00:36
Create a private key-pair and encrypt it for use in .travis.yml with working code for decrypting it on both linux and osx builders
#!/bin/bash
ssh-keygen -t rsa -N "" -C travis -f ./travis_key
# i only tested the encrypting on Linux.
# on mac you need gsplit instead of split, but the rest should be mostly the same
#
# decryption works on both linux and mac travis-workers
echo "encrypt private"