Skip to content

Instantly share code, notes, and snippets.

View ticean's full-sized avatar

Ticean Bennett ticean

View GitHub Profile
@ticean
ticean / gist:1053411
Created June 29, 2011 08:18 — forked from alistairstead/gist:1053331
Find bad things in Magento customisations
find . -name "*.phtml" -print | xargs grep --color=auto -iRnH "Mage::getModel("
find . -name "*.phtml" -print | xargs grep --color=auto -iRnH "Mage::getResourceModel("
find . -name "*.phtml" -print | xargs grep --color=auto -iRnH "Mage::getSingleton("
find . -name "*.phtml" -print | xargs grep --color=auto -iRnH "SELECT.*FROM.*;[\"\']"
find . -name "*.php" -print | xargs grep --color=auto -iRnH "htmlEscape("
find ./app/code/local -name "*.php" -print | xargs grep --color=auto -iRnH "htmlEscape("
find ./app/code/local -name "*/Block/*.phtml" -print | xargs grep --color=auto -iRnH "SELECT.*FROM.*;[\"\']"
find ./app/code/local -name "*.php" -print | xargs grep --color=auto -iRnH "\$_[GET|REQUEST|SERVER|POST]"
find ./app/code/local -name "*.php" -print | xargs grep --color=auto -iRnH "public _construct"
find . -name "*.php" -print | xargs grep --color=auto -iRnH "public _construct"
@ticean
ticean / bitcoin.conf
Created June 30, 2011 06:56
A default bitcoin configuration file.
rpcuser=USERNAME
rpcpassword=VERYSECUREPASSWORD
# bitcoin.conf configuration file. Lines beginning with # are comments.
# Network-related settings:
# Run on the test network instead of the real bitcoin network.
#testnet=1
# Connect via a socks4 proxy
@ticean
ticean / Category.sql
Created July 18, 2011 20:05
Magento EAV Entity Inspection
/**
* Magento EAV Entity Inspection
* Inspect Category
*/
SET @entityid = '3';
SELECT ea.attribute_id, ea.attribute_code, eav.value AS 'value', 'varchar' AS 'type'
FROM catalog_category_entity e
JOIN catalog_category_entity_varchar eav
ON e.entity_id = eav.entity_id
@ticean
ticean / .gitconfig
Created October 4, 2011 20:44
My Git Configuration
[user]
name = <redacted>
email = <redacted>
signingkey = <redacted>
[core]
excludesfile = /home/ticean/.gitignore
filemode = true
editor = vim
autocrlf = input
@ticean
ticean / recipe.rb
Created October 21, 2011 05:02 — forked from zsiddique/recipe.rb
S3 File Resource for Chef
# Source accepts the protocol s3:// with the host as the bucket
# access_key_id and secret_access_key are just that
s3_file "/var/bulk/the_file.tar.gz" do
source "s3://your.bucket/the_file.tar.gz"
access_key_id your_key
secret_access_key your_secret
owner "root"
group "root"
mode 0644
end
@ticean
ticean / knife.rb
Created October 21, 2011 07:25 — forked from fnichol/knife.rb
My Generic knife.rb
### Chef Solo
#
#
### Opscode Hosted Chef Server
#
# export KNIFE_USER="jdoe"
# export KNIFE_ORGNAME="acmeco"
#
# * Your Opscode client key should be at `~/.chef.d/opscode-jdoe.pem`.
# * Your Opscode validation key should be at `~/.chef.d/opscode-acmeco-validator.pem`.
@ticean
ticean / 10.04-LTS-EBS.json
Created November 4, 2011 15:49
CloudFormation Ubuntu AMI Mappings (Canonical)
"Mappings" : {
"AWSInstanceType2Arch" : {
"t1.micro" : { "Arch" : "64" },
"m1.small" : { "Arch" : "32" },
"m1.large" : { "Arch" : "64" },
"m1.xlarge" : { "Arch" : "64" },
"m2.xlarge" : { "Arch" : "64" },
"m2.2xlarge" : { "Arch" : "64" },
"m2.4xlarge" : { "Arch" : "64" },
"c1.medium" : { "Arch" : "32" },
@ticean
ticean / chef-ec2.rake
Created November 5, 2011 07:21 — forked from jtimberman/chef-ec2.rake
Chef EC2 Node Cleanup task
namespace :ec2 do
# setup chef config
# assumes this file is sibling to .chef dir, ex: CHEF_REPO/tasks
config = File.join(File.dirname(__FILE__), '..', '.chef', 'knife.rb')
Chef::Config.from_file(config)
require 'active_support'
require 'aws'
desc 'Delete any ec2-based chef nodes that no longer exist'
@ticean
ticean / MungeOneLine.rb
Created November 17, 2011 04:51
Chef MungeOneLine
# @see https://github.com/infochimps/cluster_chef/blob/version_3/site-cookbooks/hadoop_cluster/libraries/munge_one_line.rb
module MungeOneLine
#
# @param [String] name - name for the resource invocation
# @param [String] filename - the file to modify (in-place)
# @param [String] old_line - the string to replace
# @param [String] new_line - the string to insert in its place
# @param [String] shibboleth - a simple foolproof string that should be
# present after this works
@ticean
ticean / update_dns.rake
Created December 2, 2011 22:33 — forked from mpasternacki/update_dns.rake
Rake task to update Amazon Route53 DNS from by Chef node search
# -*- ruby -*-
# Needs following parameters configured in rake.rb:
# DNS_DOMAIN: domain for which to set entries, including trailing dot
# (e.g. "example.com.")
# DNS_ATTRIBUTE: attribute containing hostname to CNAME to, defaults
# to 'fqdn'; for EC2, use "ec2.public_hostname"
# DNS_ENTRIES: hash mapping hostname to node search query,
# e.g. {'buildbot' => 'recipes:buildbot', 'monitoring' =>
# 'roles:monitoring'}