Skip to content

Instantly share code, notes, and snippets.

@jtimberman
jtimberman / rename-node.rb
Created March 2, 2012 07:47 — forked from mpasternacki/rename-node.rb
A knife exec script to change Chef node's name.
#!./bin/knife exec
# A knife exec script to change chef node's name, preserving all the attributes.
#
# Usage: knife exec rename-node.rb old-name new-name
#
# Script retrieves the Node object, changes its 'name' attribute,
# creates new Node object with updated name and rest of attributes
# untouched. Then it deletes old Node and Client objects from
# database, and logs into the server to update it:
@krosenvold
krosenvold / gist:2508909
Created April 27, 2012 12:43
Try this on your multimodule maven build and watch the performance difference !
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
.....
<dependencies>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-compiler-javac</artifactId>
<version>1.8.6</version>
</dependency>
@sperlic
sperlic / fabfile.py
Created May 13, 2012 10:01 — forked from whiteinge/fabfile.py
Example fabric script with VirtualBox automation
# -*- coding: utf-8 -*-
"""MyCompany Fabric script.
* Deploy code
* Set up a local development environment
There are two ways to deploy the myrepo code:
1. :func:`deploy` will do a full virtualenv installation/update and expand a
tarball of the specified git revision (defaults to HEAD) to a timestamped
@jtimberman
jtimberman / gist:3088517
Last active February 7, 2018 16:40
Replace $VAGRANTBOX with box names that should be repackaged with updates. Don't specify it for up, ssh, and package if you're not using a multi-VM vagrantfile
% vagrant up --no-provision $VAGRANTBOX
% vagrant ssh $VAGRANTBOX
vagrant$ wget -O - http://opscode.com/chef/install.sh | sudo bash
vagrant$ rm /tmp/chef*{rpm,deb}
vagrant$ exit
% vagrant package $VAGRANTBOX
% rm -rf ~/.vagrant.d/boxes/$VAGRANTBOX
% vagrant box add $VAGRANTBOX package.box
@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:

@fnichol
fnichol / 00_README.md
Created December 20, 2012 06:36
Chef Metadata Chopper!

MetadataChopper

MetadataChopper.extract('metdata.rb') # => [ "rvm", "0.9.1" ]
@Hydrotoast
Hydrotoast / AdversarialSearchAI.java
Last active December 10, 2015 15:18
An pseudocode AI demonstrating the Minimax algorithm. Note that the algorithm has two helper functions: min and max.
class AdversarialSearchAI {
private PieceType piece;
public AdversarialSearchAI(PieceType piece) {
this.piece = piece;
}
/**
* Returns the best move given the state of the game
*/
@kesor
kesor / Gemfile
Last active September 30, 2019 09:04
Vagrantfile to create a chef-server (11.x) and a client box that uses it.
source :rubygems
gem 'json', '= 1.5.4' # knife/chef 11.0 and 11.20 is broken with json 1.5.5/1.7.7
gem 'vagrant'
gem 'vagrant-hostmaster'
@dgageot
dgageot / PhantomJsDownloader.java
Last active May 28, 2019 17:40
PhantomJs / GhostDriver / FluentLenium with automatic install of PhantomJs
package com.fractales.synchro.helpers.phantomjs;
import com.google.common.io.ByteStreams;
import com.google.common.io.Files;
import com.google.common.io.InputSupplier;
import com.google.common.io.OutputSupplier;
import com.google.common.io.Resources;
import java.io.File;
import java.io.FileOutputStream;
What kind of new features would you be happy to see in Apache Maven new major release ?