Skip to content

Instantly share code, notes, and snippets.

View gordonknoppe's full-sized avatar

Gordon Knoppe gordonknoppe

  • Magento
  • Dublin, Ireland
View GitHub Profile
@gordonknoppe
gordonknoppe / gist:73081e38e7a8c97ca149
Created November 14, 2014 22:38
Test curl TLS1 support for POODLE
<?php
$ch = curl_init();
// set URL and other options
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSLVERSION, '1');
curl_setopt($ch, CURLOPT_URL, "https://developer.paypal.com/");
curl_setopt($ch, CURLOPT_HEADER, 0);
$result = curl_exec($ch);
@gordonknoppe
gordonknoppe / gist:552218a3cb1a51015ca3
Created October 7, 2014 22:31
Tables size by database
SET @DATABASE = 'magento';
SELECT CONCAT(table_schema, '.', table_name),
CONCAT(ROUND(table_rows / 1000000, 2), 'M') rows,
CONCAT(ROUND(data_length / ( 1024 * 1024 * 1024 ), 2), 'G') DATA,
CONCAT(ROUND(index_length / ( 1024 * 1024 * 1024 ), 2), 'G') idx,
CONCAT(ROUND(( data_length + index_length ) / ( 1024 * 1024 * 1024 ), 2), 'G') total_size,
ROUND(index_length / data_length, 2) idxfrac
FROM information_schema.TABLES
WHERE `information_schema`.TABLES.table_schema = @DATABASE
@gordonknoppe
gordonknoppe / mod_rewrite_rules
Created November 17, 2012 20:46 — forked from phillipadsmith/mod_rewrite_rules
Mobile site redirection using mod_rewrite
RewriteEngine On
# If the user is asking for the fullsite, set a cookie, remove the query, and stop.
RewriteCond %{QUERY_STRING} ^fullsite$
RewriteRule ^/?(.*)$ http://domain.com/$1? [L,CO=fullsite:yes:.domain.com]
# If the user is asking for the mobilesite, set a cookie, remove the query, redirect and stop.
RewriteCond %{QUERY_STRING} ^mobilesite$
RewriteRule ^/?(.*)$ http://m.domain.com/$1? [L,CO=fullsite:no:.domain.com]
after 'deploy:update_code', 'magento-snapshot:initialize'
namespace :magento-snapshot do
desc "Initialize snapshot directories"
task :initialize, :roles => [:app] do
# Create snapshot directory
run "mkdir -p #{shared_path}/snapshot"
# Remove existing snapshot dir in case it is in the release path
#/bin/sh
####################################################################################
# Magento Auto Snapshot
#
# 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.
# Makes some assumptions regarding Capistrano style deploy path.
#
# You are responsible for your own security!!!!!