Skip to content

Instantly share code, notes, and snippets.

@fernandoaleman
fernandoaleman / Linux Static IP
Created March 23, 2012 16:20
How To Configure Static IP On CentOS 6
## Configure eth0
#
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
BOOTPROTO=static
@robinsmidsrod
robinsmidsrod / ubuntu-installer-amd64-remote.ipxe
Created April 26, 2012 14:26
Ubuntu 12.04 netboot installer via iPXE
#!ipxe
#dhcp
echo Starting Ubuntu x64 installer for ${mac}
set base-url http://archive.ubuntu.com/ubuntu/dists/precise/main/installer-amd64/current/images/netboot/ubuntu-installer/amd64
kernel ${base-url}/linux
initrd ${base-url}/initrd.gz
#imgargs linux auto=true url=http://yourserver/some/path/preseed.cfg
boot ||
# If everything failed, give the user some options
echo Boot from ${base-url} failed
@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
@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:

@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:
@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
@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
@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.