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 / papertails-quickstart
Created July 18, 2012 22:35
papertrails quickstart
https://papertrailapp.com/systems/setup
# sudo sh
# cd /etc
# wget https://papertrailapp.com/tools/syslog.papertrail.crt
# yum install rsyslog-gnutls
$i = null;
echo $i++; echo ' ... '; echo $i++;
<?php
use ORM;
class User {
protected $userId;
protected $userName;
protected $role;
protected $row = null;
@ralph-tice
ralph-tice / gist:3837496
Created October 5, 2012 01:15
run remote commands via bash/ssh
# Use this to run SSH Commands on a remote host. Arguments must be global variables before running runRemoteCmds()
# remoteHost string, required
# remoteUser string, required
# remoteKey string, optional
# remoteCmds array of strings, required
#
# Example:
#
# remoteHost="my.server.com"
# remoteUser="sshuser"
@ralph-tice
ralph-tice / gist:4029601
Created November 7, 2012 04:43
Matt Kruse on Javascript
http://easycaptures.com/fs/uploaded/710/7202210039.gif
Here is my outline. I have some code examples and details that I am going to
mix in as I talk. It's a bit more rough than I wanted it to be, but oh well.
It's an informal training session and I can talk through it.
Quick Testbeds: JSBin.com , JSFiddle.net , TinkerBin.com
Fundamentals
============
@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:4252866
Last active October 13, 2015 20:38
swapping out OpenJDK for Oracle JDK on Amazon EC2
#download the JDK
#oracle's rpm.bin gets pulled down as corrupt..zzz
#wget --no-cookies --header "Cookie: gpw_e24=xxx" "http://download.oracle.com/otn-pub/java/jdk/7/jdk-7-linux-x64-rpm.bin" -O jdk-7-linux-x64-rpm.bin
#updated for version 7u11
wget --no-cookies --header "Cookie: gpw_e24=xxx" http://download.oracle.com/otn-pub/java/jdk/7u11-b21/jdk-7u11-linux-x64.rpm -O jdk-7u11-linux-x64.rpm
sudo rpm -ivh jdk-7u11-linux-x64.rpm
sudo alternatives --install /usr/bin/java java /usr/java/default/bin/java 20000
@ralph-tice
ralph-tice / gist:4253069
Last active October 13, 2015 20:38
netflix edda install/run updated 5/7
sudo yum install git
#need IAM credentials for read for all services, see https://github.com/Netflix/edda/wiki/AWS-Permissions
export AWS_ACCESS_KEY_ID=xxx
export AWS_SECRET_KEY=xxx
export JAVA_OPTS="-XX:MaxPermSize=256M -Xmx1g"
git clone git://github.com/Netflix/edda.git
cd edda
./gradlew build
cd ..
wget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-2.4.8.tgz
@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