Skip to content

Instantly share code, notes, and snippets.

@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"
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 = {}
@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() {
@jbenet
jbenet / simple-git-branching-model.md
Last active April 9, 2024 03:31
a simple git branching model

a simple git branching model (written in 2013)

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.

@gnarf
gnarf / ..git-pr.md
Last active April 12, 2024 22:00
git pr - Global .gitconfig aliases for Pull Request Managment

Install

Either copy the aliases from the .gitconfig or run the commands in add-pr-alias.sh

Usage

Easily checkout local copies of pull requests from remotes:

  • git pr 4 - creates local branch pr/4 from the github upstream(if it exists) or origin remote and checks it out
  • git pr 4 someremote - creates local branch pr/4 from someremote remote and checks it out
@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
@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,

@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:
@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
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

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

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this: