Skip to content

Instantly share code, notes, and snippets.

Pádraig O'Sullivan posulliv

Block or report user

Report or block posulliv

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@posulliv
posulliv / geo.md
Created Mar 8, 2013
Simple walk through of Spatial features in Akiban and how to do simple nearest-neighbor query.
View geo.md

Enabling Akiban Geospatial Queries

The following needs to be in your server.properties file:

akserver.postgres.parserGeospatialIndexes=true

Table and Data

View gist:4271458
1) install drupal & apache & akiban
wget http://ftp.drupal.org/files/projects/drupal-7.17.tar.gz
tar zxvf drupal-7.17.tar.gz
sudo apt-get update
sudo apt-get install -y python-software-properties
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 0AA4244A
sudo add-apt-repository "deb http://software.akiban.com/apt-developer/ lucid main"
sudo apt-get update
sudo apt-get install -y apache2 php5-pgsql php5-gd libapache2-mod-php5 php-apc postgresql-client akiban-server
@posulliv
posulliv / gist:3231183
Created Aug 1, 2012
alter statements to create drupal foreign keys
View gist:3231183
-- required for foreign keys on block table (MySQL requirement)
create index module on block(module);
-- required so foreign keys can be created
alter table node_comment_statistics modify column last_comment_uid int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'The user ID of the latest author to post a comment on this node, from comment.uid.';
alter table block_custom modify column bid int(11) NOT NULL AUTO_INCREMENT COMMENT 'The block’s block.bid.';
alter table authmap modify column uid int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'User’s users.uid.';
alter table watchdog modify column uid int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'The users.uid of the user who triggered the event.';
alter table history modify nid int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'The node.nid that was read.';
alter table history modify uid int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'The users.uid that read the node nid.';
View gist:3013089
sudo apt-get install pgbouncer
# edit /etc/pgbouncer/pgbouncer.ini file
# edit /etc/default/pgbouncer file and set START=1
sudo service pgbouncer start
contents of /etc/pgbouncer/pgbouncer.ini file
[databases]
drupal = host=127.0.0.1 port=5432 dbname=drupal
View gist:3012400
1) install drupal & apache
wget http://ftp.drupal.org/files/projects/drupal-7.12.tar.gz
tar zxvf drupal-7.12.tar.gz
sudo apt-get install apache2 php5-pgsql php5-gd libapache2-mod-php5 php-apc
sudo mkdir /var/www/drupal
sudo mv drupal-7.12/* drupal-7.12/.htaccess /var/www/drupal
sudo cp /var/www/drupal/sites/default/default.settings.php /var/www/drupal/sites/default/settings.php
sudo chown www-data:www-data /var/www/drupal/sites/default/settings.php
sudo mkdir /var/www/drupal/sites/default/files
View drupal_6_patch
diff -rupN a/includes/database.inc b/includes/database.inc
--- a/includes/database.inc 2011-05-25 13:43:55.000000000 -0700
+++ b/includes/database.inc 2011-12-20 18:16:01.140029674 -0800
@@ -129,16 +129,17 @@ function db_set_active($name = 'default'
install_goto('install.php');
}
+ // Always set the type of the active database
+ if (is_array($db_url)) {
+ $connect_url = array_key_exists($name, $db_url) ? $db_url[$name] : $db_url['default'];
@posulliv
posulliv / gist:2691521
Created May 14, 2012
steps to set up AMI in same manner as was done for post
View gist:2691521
1) install drupal & apache
wget http://ftp.drupal.org/files/projects/drupal-7.12.tar.gz
tar zxvf drupal-7.12.tar.gz
sudo apt-get install apache2 php5-mysql php5-gd libapache2-mod-php5 php-apc php5-cli
sudo mkdir /var/www/drupal
sudo mv drupal-7.12/* drupal-7.12/.htaccess /var/www/drupal
sudo cp /var/www/drupal/sites/default/default.settings.php /var/www/drupal/sites/default/settings.php
sudo chown www-data:www-data /var/www/drupal/sites/default/settings.php
sudo mkdir /var/www/drupal/sites/default/files
@posulliv
posulliv / gist:1252049
Created Sep 29, 2011
Akiban Simple Simple OLB Tests
View gist:1252049
#!/usr/bin/env php
<?php
/**
* Basic tests for Akiban database.
* @author posulliva@akiban.com
* @package test/akiban
*/
require_once dirname(__FILE__)."/../bootstrap/unit.php";
require_once(SF_ROOT_DIR. '/lib/net/manhunt/search/SearchFactory.php');
View query.cpp
IndexedSlicesQuery query;
vector<string> column_names;
column_names.push_back("full_name");
column_names.push_back("birth_date");
column_names.push_back("state");
query.setColumns(column_names);
query.addGtExpression("birth_date", 1970);
query.addEqualsExpression("state", "UT");
query.setColumnFamily("users");
map<string, map<string, string> > res= c->getIndexedSlices(query);
View create_cass.cpp
cf= tr1::shared_ptr<CassandraFactory>(new CassandraFactory("localhost", 9160));
c= tr1::shared_ptr<Cassandra>(cf->create());
KeyspaceDefinition ks_def;
ks_def.setName("demo");
c->createKeyspace(ks_def);
ColumnFamilyDefinition cf_def;
cf_def.setName("users");
cf_def.setKeyspaceName(ks_def.getName());
ColumnDefinition name_col;
You can’t perform that action at this time.