Skip to content

Instantly share code, notes, and snippets.

View GorillaTester's full-sized avatar

Peter Savage GorillaTester

  • GorillaTesting LLC
View GitHub Profile
@GorillaTester
GorillaTester / how-to.txt
Created August 7, 2017 17:08 — forked from simonw/how-to.md
How to create a tarball of a git repository using "git archive"
git archive --format=tar.gz -o /tmp/my-repo.tar.gz --prefix=my-repo/ master
@GorillaTester
GorillaTester / git_archive.sh
Created August 7, 2017 17:07 — forked from amatellanes/git_archive.sh
Create tarball and zipball from a repo using git.
git archive --format=tar --prefix=git-1.4.0/ v1.4.0 | gzip >git-1.4.0.tar.gz # Create a compressed tarball for v1.4.0 release.
git archive --format=zip --prefix=git-1.4.0/ v1.4.0 > git-1.4.0-docs.zip # Create a compressed zipball for v1.4.0 release.
@GorillaTester
GorillaTester / phantomjs_install.sh
Created July 7, 2017 05:25 — forked from ianchen06/phantomjs_install.sh
How to install PhantomJS on CentOS/RHEL
yum install fontconfig freetype freetype-devel fontconfig-devel libstdc++
wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.8-linux-x86_64.tar.bz2
tar -xjvf ~/downloads/phantomjs-1.9.8-linux-x86_64.tar.bz2 --strip-components 1 /opt/phantomjs/
sudo yum install libffi-devel openssl-devel
pip install pyopenssl pyasn1
pip install requests[security]
@GorillaTester
GorillaTester / node-on-ec2-port-80.md
Created March 17, 2016 06:57 — forked from kentbrew/node-on-ec2-port-80.md
How I Got Node.js Talking on EC2's Port 80

The Problem

Standard practices say no non-root process gets to talk to the Internet on a port less than 1024. How, then, could I get Node talking on port 80 on EC2? (I wanted it to go as fast as possible and use the smallest possible share of my teeny tiny little micro-instance's resources, so proxying through nginx or Apache seemed suboptimal.)

The temptingly easy but ultimately wrong solution:

Alter the port the script talks to from 8000 to 80:

}).listen(80);
@GorillaTester
GorillaTester / create_branch_from_tag
Created September 23, 2015 20:07 — forked from nickfloyd/create_branch_from_tag
To create a branch from a tag
-Go to the starting point of the project
>> git checkout origin master
-fetch all objects
>> git fetch origin
-Make the branch from the tag
>> git branch new_branch tag_name
-Checkout the branch
>> git checkout new_branch
-Push the branch up
>> git push origin new_branch
@GorillaTester
GorillaTester / README.md
Last active September 21, 2015 15:50 — forked from dergachev/README.md
Vagrant tutorial

Vagrant Setup

This tutorial guides you through creating your first Vagrant project.

We start with a generic Ubuntu VM, and use the Chef provisioning tool to:

  • install packages for vim, git
  • create user accounts, as specified in included JSON config files
  • install specified user dotfiles (.bashrc, .vimrc, etc) from a git repository

Afterwards, we'll see how easy it is to package our newly provisioned VM

@GorillaTester
GorillaTester / redflag.rb
Last active September 15, 2015 06:21 — forked from aninder/redflag.rb
fix for bug in "metaprogramming ruby" book code snippet on page 121 (creating DSL). It calls events of previous files again for each new file loaded and redflag2.rb is another way creating it.
lambda {
setups = []
events = {}
Kernel.send :define_method, :event do |name, &block|
events[name] = block
end
Kernel.send :define_method, :setup do |&block|
setups << block
@GorillaTester
GorillaTester / redflag.rb
Last active September 15, 2015 06:21 — forked from nusco/redflag.rb
lambda {
setups = []
events = {}
Kernel.send :define_method, :event do |name, &block|
events[name] = block
end
Kernel.send :define_method, :setup do |&block|
setups << block
@GorillaTester
GorillaTester / prepended_wrapper.rb
Last active September 15, 2015 06:20 — forked from nusco/prepended_wrapper.rb
Spell: Prepended Wrapper
# ========================
# Spell: Prepended Wrapper
# ========================
# Call a method from its prepended override.
module M
def reverse
"x#{super}x"
end
@GorillaTester
GorillaTester / refinement.rb
Last active September 15, 2015 06:20 — forked from nusco/refinement.rb
Spell: Refinement
# =================
# Spell: Refinement
# =================
# Patch a class until the end of the file, or (from Ruby 2.1) until the end of the including module.
module MyRefinement
refine String do
def reverse
"my reverse"