Skip to content

Instantly share code, notes, and snippets.

View jalvarezsamayoa's full-sized avatar

Javier Alvarez jalvarezsamayoa

View GitHub Profile
@jalvarezsamayoa
jalvarezsamayoa / setup_base_ubuntu_ruby_box.sh
Created August 20, 2012 20:05
Setup base ubuntu box with ruby 1.9.3
#!/usr/bin/env
sudo apt-get update -y
sudo apt-get upgrade -y
sudo apt-get install git-core -y
sudo apt-get install emacs23 emacs-goodies-el -y
cd /tmp
wget http://apt.puppetlabs.com/puppetlabs-release-precise.deb
@jtmille3
jtmille3 / tidy_xml.py
Created August 19, 2012 02:08
Enhanced XML Formatting for Sublime Text 2
import sublime, sublime_plugin, subprocess
class TidyXmlCommand(sublime_plugin.TextCommand):
def run(self, edit):
if self.view.sel()[0].size() > 0:
self.cursor = None
for region in self.view.sel():
self.format(edit, region)
else:
self.cursor = self.view.sel()[0]
@jalvarezsamayoa
jalvarezsamayoa / puppet-mode.el
Created August 18, 2012 18:26
Emacs puppet-mode.el
;;; http://pastie.org/paste/asset/188795/puppet-mode.el
;;;
;;; puppet-mode.el
;;;
;;; Author: lutter
;;; Description: A simple mode for editing puppet manifests
;;;
(defconst puppet-mode-version "0.1")
@jalvarezsamayoa
jalvarezsamayoa / setup_base_ubuntu_ruby_box.sh
Created August 16, 2012 18:05
Setup base ubuntu box with ruby 1.9.3
#!/usr/bin/env
# setup_base_ruby_box.sh
sudo apt-get update -y
sudo apt-get install build-essential zlib1g-dev libssl-dev libreadline-dev git-core curl libyaml-dev libcurl4-dev libsqlite3-dev apache2-dev -y
sudo rm -rf /opt/vagrant_ruby
curl --remote-name http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p194.tar.gz
tar zxf ruby-1.9.3-p194.tar.gz
cd ruby-1.9.3-p194/
./configure
make
@winhamwr
winhamwr / tutorial.md
Created June 4, 2012 22:37
Creating a repeatable, dynamic site to site VPN with OpenSwan on Ubuntu 10.04 from Amazon EC2

Creating a dynamic site-to-site VPN with OpenSwan on Ubuntu 10.04 on EC2

Wes Winham winhamwr@gmail.com

There are many tutorials floating around the web that almost get you a dynamic VPN in EC2. The goal of this tutorial is to be a one-stop-shop for this specific setup.

@iiska
iiska / db_fixtures_dump.rake
Created December 28, 2011 13:17
Dump Rails db to fixtures
# Original from http://snippets.dzone.com/posts/show/4468 by MichaelBoutros
#
# Optimized version which uses to_yaml for content creation and checks
# that models are ActiveRecord::Base models before trying to fetch
# them from database.
namespace :db do
namespace :fixtures do
desc 'Dumps all models into fixtures.'
task :dump => :environment do
models = Dir.glob(RAILS_ROOT + '/app/models/**.rb').map do |s|