Skip to content

Instantly share code, notes, and snippets.

@mefellows
mefellows / ec2-user-data.ps1
Last active May 28, 2021 11:44
Packer Community Plugins - Example Windows 2012 Setup
<powershell>
write-output "Running User Data Script"
write-host "(host) Running User Data Script"
cmd.exe /c net user /add vagrant FooBar@123
cmd.exe /c net localgroup administrators vagrant /add
Set-ExecutionPolicy -ExecutionPolicy bypass -Force
# RDP
@tvjames
tvjames / Vagrantfile
Last active August 11, 2022 14:27
Prepare a Windows Server 2008 R2 instance for use with vagrant-windows.
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
@havvg
havvg / ajax-form.js
Created August 1, 2012 13:20
jQuery AJAX form submit with Twitter Bootstrap modal
jQuery(function($) {
$('form[data-async]').live('submit', function(event) {
var $form = $(this);
var $target = $($form.attr('data-target'));
$.ajax({
type: $form.attr('method'),
url: $form.attr('action'),
data: $form.serialize(),
@drawks
drawks / graphite
Created February 14, 2012 21:24
Graphite on uwsgi/nginx
#This is the "site config" for nginx
upstream django {
# Distribute requests to servers based on client IP. This keeps load
# balancing fair but consistent per-client. In this instance we're
# only using one uWGSI worker anyway.
ip_hash;
server unix:/tmp/uwsgi.sock;
}
server {
@bohde
bohde / graphite_pip_uwsgi_recipe.sh
Created November 28, 2011 18:08 — forked from bfritz/graphite_pip_uwsgi_recipe.sh
installing graphite-web with pip and running under uwsgi
# graphite-web install is hardcoded in setup.cfg to /opt/graphite
sudo mkdir /opt/graphite
sudo chown brad.users /opt/graphite
# run under python2.7 virtualenv
virtualenv --python=python2.7 ~/ve/graphite
source ~/ve/graphite/bin/activate
# install the necessary python packages (simplejson is for flot graphs)
pip install graphite-web carbon whisper django django-tagging uwsgi simplejson