View .profile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias now='/bin/date +%s' | |
# Convert a timestamp | |
unixtime() { | |
php -r 'if (isset($argv[1]) && is_numeric($argv[1])) print date(DATE_RSS, $argv[1]) . "\n";' $1 | |
} | |
# Local VM config | |
export localvmname="Debian32" |
View memcached-tool
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
# | |
# memcached-tool: | |
# stats/management tool for memcached. | |
# | |
# Author: | |
# Brad Fitzpatrick <brad@danga.com> | |
# | |
# License: | |
# public domain. I give up all rights to this |
View default.vcl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
backend default { | |
.host = "127.0.0.1"; | |
.port = "8080"; | |
.connect_timeout = 600s; | |
.first_byte_timeout = 600s; | |
.between_bytes_timeout = 600s; | |
} | |
acl purge { | |
"localhost"; |
View gist:4667006
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### | |
# BEGIN MOBILE REDIRECTS | |
### | |
# If the skipMobileDetection cookie is set, and we're on the mobile domain, | |
# return to the normal domain. Do this only for SSL as Varnish will handle | |
# for port 80. | |
RewriteCond %{HTTP_COOKIE} skipmobiledetection [NC] | |
RewriteCond %{HTTP_HOST} ^m\. [NC] | |
RewriteCond %{SERVER_PORT} =443 |
View my.cnf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# The MySQL database server configuration file. | |
# | |
# You can copy this to one of: | |
# - "/etc/mysql/my.cnf" to set global options, | |
# - "~/.my.cnf" to set user-specific options. | |
# | |
# One can use all long options that the program supports. | |
# Run program with --help to get a list of available options and with | |
# --print-defaults to see which it would actually understand and use. |
View default.vcl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
backend default { | |
.host = "127.0.0.1"; | |
.port = "8080"; | |
.connect_timeout = 600s; | |
.first_byte_timeout = 600s; | |
.between_bytes_timeout = 600s; | |
} | |
acl purge { | |
"localhost"; |
View gist:3974958
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Use this query when preparing to move cache tables into memcache bins | |
-- to estimate how big the bins should be (or how many will be necessary). | |
SELECT count(*) tables, | |
concat(round(sum(data_length)/(1024*1024),2),'M') data, | |
concat(round(sum(index_length)/(1024*1024),2),'M') idx, | |
concat(round(sum(data_length+index_length)/(1024*1024),2),'M') total_size | |
FROM information_schema.TABLES | |
WHERE table_schema LIKE '<<DRUPAL DATABASE NAME>>' | |
AND table_name like "cache%" | |
-- Exclude any cache tables you know won't be in memcache: |
View basicauthtest.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
vhosts=/etc/apache2/sites-enabled/* | |
for f in $vhosts | |
do | |
servername=`grep ServerName $f | sed 's/\s*ServerName\s*//g' - | head -n1` | |
for s in $servername | |
do | |
url="http://$s https://$s" | |
for protocol in $url |
View theme_D6MODULE_table_form.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Theme a series of form elements into a table (Drupal 6), with optional | |
* tabledrag.js support. | |
*/ | |
function theme_D6MODULE_admin_table_form($form) { | |
$header = array(); | |
$rows = array(); |
View gist:5706405
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ($order_id = db_result(db_query("SELECT order_id FROM {fundraiser_webform_order} WHERE sid = %d", $_GET['sid']))) { | |
$order = uc_order_load($order_id); | |
$order_total = isset($order->order_total) ? $order->order_total : 0; | |
} | |
?> |
NewerOlder