Skip to content

Instantly share code, notes, and snippets.

View ralph-tice's full-sized avatar

Ralph Tice ralph-tice

  • Kentik
  • Texas
View GitHub Profile
@ralph-tice
ralph-tice / gist:cf5d9b46da095a2f6df7
Created January 15, 2015 17:51
ssh config for transparent ssh through amazon NAT AMIs to ubuntu private instances
Host *.vpc.mycorp.com
User ubuntu
ProxyCommand ssh -W %h:%p ec2-user@nat.mycorp.com
IdentityFile "~/.ssh/mykey.pem"
Host 172.1.*
User ubuntu
ProxyCommand ssh -W %h:%p ec2-user@nat.mycorp.com
IdentityFile "~/.ssh/mykey.pem"
Host nat.mycorp.com
@ralph-tice
ralph-tice / test_sessions.php
Last active December 10, 2015 14:18
how to use aws-sdk-php v2.x with dynamodb session handling
<?php
// Include the SDK along with your other project dependencies
// using the Composer autoloader
require 'vendor/autoload.php';
use Aws\Common\Aws;
use Aws\Common\Enum\Region;
use Aws\DynamoDb\Exception\DynamoDbException;
$aws = Aws::factory(array(
'key' => 'aws_key_here',
@ralph-tice
ralph-tice / gist:4606111
Created January 23, 2013 14:17
Modifying /app/code/core/Mage/Core/Model/Layout/Update.php for reduction in total size of cache generated. ~250-300mb reduced to ~25-30mb. Tested on Magento 1.4.2.
/**
* Get cache id
*
* @return string
*/
public function getCacheId()
{
if (!$this->_cacheId) {
// -- CORE CHANGE
// -- remove store scoping to optimize cache usage
@ralph-tice
ralph-tice / gist:5084164
Created March 4, 2013 18:03
basic release management for php type applications that only involve file copy
#!/bin/bash
#git pull
releaseDir=`date +%F-%H-%M-%S`
sudo mkdir -p /var/www/releases/$releaseDir
sudo chown ec2-user.ec2-user /var/www/releases/$releaseDir
#assumes docroot is the name of the directory in your repo to deploy
cp -r ./docroot /var/www/releases/$releaseDir/
@ralph-tice
ralph-tice / gist:5207813
Created March 20, 2013 19:43
graphite/carbon/whisper install
sudo yum install httpd
sudo yum install pycairo
sudo yum install mod_python
sudo yum install python-ldap
sudo yum install&nbsp;git clone [https://github.com/graphite-project/graphite-web.git]
@ralph-tice
ralph-tice / gist:5340216
Created April 8, 2013 20:31
httpd.conf: CustomLog |/usr/local/bin/pipe_syslog combined
#!/usr/bin/perl
use Sys::Syslog qw( :DEFAULT setlogsock );
setlogsock('unix');
openlog('apache', 'cons', 'pid', 'local2');
while ($log = <STDIN>) {
syslog('notice', $log);
}
closelog
@ralph-tice
ralph-tice / gist:5405052
Created April 17, 2013 15:05
2.9 vs 2.10.1
/**
* allow for hierarchical properties
* {{{
* if we have prefix = "edda.collection",
* propName = "enabled",
* nameContext = "test.us-east-1.aws.addresses"
* then it will look for (in this order):
* edda.collection.test.us-east-1.aws.addresses.enabled
* edda.collection.test.us-east-1.aws.enabled
* edda.collection.us-east-1.aws.addresses.enabled
jar 'com.netflix.hystrix:hystrix-core', '~>1.2.16'
@ralph-tice
ralph-tice / gist:4152243
Created November 27, 2012 03:50
Installing stash on blank EC2 instance
#working Nov.26.2012
sudo vi /etc/hosts #add hostname to 127.0.0.1 entry
sudo yum install git
git clone https://github.com/git/git.git
cd git
git checkout v1.8.0.1
sudo yum install make
sudo yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel perl-ExtUtils-MakeMaker
sudo yum install gcc
sudo make prefix=/usr/local install
@ralph-tice
ralph-tice / gist:5672064
Created May 29, 2013 17:24
stuff installed on new macbook air
#Sublime Text 2 + Ensime for scala development
www.sublimetext.com/2
http://wbond.net/sublime_packages/package_control/installation
https://github.com/sublimescala/sublime-ensime
#x11 forwarding (xquartz)
http://xquartz.macosforge.org/landing/