Skip to content

Instantly share code, notes, and snippets.

View ticean's full-sized avatar

Ticean Bennett ticean

View GitHub Profile
@ticean
ticean / apache-site.conf.erb
Created December 10, 2010 04:06 — forked from yevgenko/apache-site.conf.erb
chef magento roles examples
<% if @params[:ssl] %>
<VirtualHost <%= node[:ipaddress] %>:443>
ServerName <% if node[:magento][:server][:secure_domain] %><%= node[:magento][:server][:secure_domain] %><% else %><%= @params[:server_name] %><% end %>
SSLEngine on
SSLCertificateKeyFile ssl/<%= @params[:server_name] %>.pem
SSLCertificateFile ssl/<%= @params[:server_name] %>.pem
SSLProtocol all
SSLCipherSuite ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
<% else %>
@ticean
ticean / convertMkv
Created December 10, 2010 04:22
sabnzbd/sickbeard post-process script that runs both sabToSickBeard and mkv conversion for XBox360, using handbrake.
#!/bin/bash
############################################################
# Recursively peruses a directory and converts MKV files
# to MP4 for streaming to Xbox360.
#
# @author: Ticean Bennett
# @url: http://ticean.com
# @see: http://trac.handbrake.fr/wiki/CLIGuide#options
#
# @param file The complete file path.
@ticean
ticean / Category.sql
Created December 10, 2010 04:45
A series of queries for selecting Magento entity EAV attributes, and their values. Lots of union here...
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
JOIN eav_attribute ea
ON eav.attribute_id = ea.attribute_id
WHERE e.entity_id = @entityid
UNION
@ticean
ticean / MagentoChangeAdminPassword.sql
Created December 10, 2010 20:52
Change Magento password for admin user with SQL command.
UPDATE admin_user SET PASSWORD=MD5('password123'), lock_expires=NULL WHERE username='admin'
#!/bin/bash
echo "Setting up chef..."
sudo apt-get -y update
sudo apt-get -y install ruby ruby1.8-dev libopenssl-ruby1.8 rdoc ri irb build-essential wget ssl-cert
cd /tmp
wget http://rubyforge.org/frs/download.php/57643/rubygems-1.3.4.tgz
tar zxf rubygems-1.3.4.tgz
@ticean
ticean / get-scalr-instances.sh
Created January 27, 2011 22:50
Get a list of Scalr instances for a particular role.
#!/bin/bash
##############################################################
# Get a list of Scalr instances for a particular role.
#
# PARAMS:
# ROLE_NAME - The Scalr role name.
#
##############################################################
ROLE_NAME="$1"
@ticean
ticean / Magento Auto Snapshot
Created February 11, 2011 00:53
Creates snapshot of Magento db & media.
#/bin/sh
####################################################################################
# Magento Auto Snapshot
#
# This script has been integrated into Magento Shell Tools.
# Please see https://github.com/guidance/magento-shell-tools/blob/master/shell/snapshot.php
#
# Shell script that makes a backup of Magento's database and media directories.
# Intended for use on development environments. Bring new developers up to speed
# quickly.
#!/bin/bash
# chef install
sudo apt-get -q -y install ruby ruby1.8-dev libopenssl-ruby1.8 rdoc ri irb build-essential wget >> /tmp/chef_bootstrap.log
cd /tmp
wget http://rubyforge.org/frs/download.php/55066/rubygems-1.3.2.tgz
tar zxvf rubygems-1.3.2.tgz >> /tmp/chef_bootstrap.log
cd rubygems-1.3.2
sudo ruby setup.rb --no-ri --no-rdoc >> /tmp/chef_bootstrap.log
@ticean
ticean / drop-mysql-tables.sh
Created May 10, 2011 23:34
Shell script to drop all tables from MySQL.
#!/bin/bash
# A shell script to delete / drop all tables from MySQL database.
# Usage: ./script user password dbnane
# Usage: ./script user password dbnane server-ip
# Usage: ./script user password dbnane mysql.nixcraft.in
# -------------------------------------------------------------------------
# Copyright (c) 2008 nixCraft project <http://www.cyberciti.biz/fb/>
# This script is licensed under GNU GPL version 2.0 or above
# -------------------------------------------------------------------------
# This script is part of nixCraft shell script collection (NSSC)
@ticean
ticean / gist:992632
Created May 26, 2011 06:07 — forked from brianjlandau/gist:176754
Rails Capistrano deploy using git as our deployment strategy. You'll need git version >=1.5.6.6 on your server for this to work.
# you'd obviously have more settings somewhere
set :scm, :git
set :repository, "git@github.com:defunkt/github.git"
set :branch, "origin/master"
set :migrate_target, :current
set :use_sudo, false
set :ssh_options, {:forward_agent => true}
set :rails_env, 'production'
set(:latest_release) { fetch(:current_path) }