Skip to content

Instantly share code, notes, and snippets.

View pdrakeweb's full-sized avatar

Peter Drake pdrakeweb

View GitHub Profile
@pdrakeweb
pdrakeweb / ruby-require-bug.sh
Created August 25, 2015 19:55
Rubygems require bug
#!/usr/local/bin/ruby
loop do
require 'rubygems'
pid = Process.fork do
require 'net/ssh'
end
Process.wait
end
/usr/local/lib/ruby/gems/2.1.0/gems/json_pure-1.8.1/lib/json/common.rb:155:in `parse': 757: unexpected token at '{ (JSON::ParserError)
"Code" : "Success",
"LastUpdated" : "2015-04-23T20:12:37Z",
"Type" : "AWS-HMAC",
"AccessKeyId" : "...",
"SecretAccessKey" : "...",
"Token" : "...",
"Expiration" : "201'
from /usr/local/lib/ruby/gems/2.1.0/gems/json_pure-1.8.1/lib/json/common.rb:155:in `parse'
from /usr/local/lib/ruby/gems/2.1.0/gems/aws-sdk-v1-1.63.0/lib/aws/core/credential_providers.rb:430:in `get_credentials'
@pdrakeweb
pdrakeweb / directory-create.php
Last active August 29, 2015 14:05
Gluster 3.4.1 directory permissions bug
#!/usr/bin/env php
<?php
/**
* Usage:
*
* Execute this script simultaneously on two separate gluster clients and you
* will see errors. Set the $gluster_path variables below as needed for your
* environment. You may set $gluster_path to a non-gluster local path and then
* execute two copies of this on the same machine to prove that the problem does
* not occur with local filesystems.
#!/usr/bin/perl
use strict;
use warnings;
use Data::Dumper;
my $file = $ARGV[0] or die('Must pass an apache access logfile');
open IN, "<$file" or die("Can't open $file");
DO WTF YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Alexey Silin <pinkoblomingo@gmail.com>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WTF YOU WANT TO PUBLIC LICENSE
@pdrakeweb
pdrakeweb / symlink_test.php
Created November 7, 2013 01:09
Gluster v3.4.1 symlink bug
$("#formid input[type='radio']").click(function() {
var total = 0
$("#formid input[type='radio']:checked").each(function() {
total += $(this).val();
});
$('div.total').html(total);
});
diff --git a/includes/database/mysql/schema.inc b/includes/database/mysql/schema.inc
index 949cf4e..00de2a3 100644
--- a/includes/database/mysql/schema.inc
+++ b/includes/database/mysql/schema.inc
@@ -24,6 +24,13 @@ class DatabaseSchema_mysql extends DatabaseSchema {
const COMMENT_MAX_COLUMN = 255;
/**
+ * Field types which are considered large objects.
+ *
<?php
require_once 'vendor/autoload.php';
$routes = new \Symfony\Component\Routing\RouteCollection();
$routes->add('negotiation', new \Symfony\Component\Routing\Route(
'/negotiation.{_locale}.{_format}',
array('_controller' =>
function (\Symfony\Component\HttpFoundation\Request $request) {
return new \Symfony\Component\HttpFoundation\Response('fr|en route selected');
<?php
require_once 'vendor/autoload.php';
$routes = new \Symfony\Component\Routing\RouteCollection();
$routes->add('negotiation', new \Symfony\Component\Routing\Route(
'/negotiation.{_locale}.{_format}',
array('_controller' =>
function (\Symfony\Component\HttpFoundation\Request $request) {
return new \Symfony\Component\HttpFoundation\Response('French or English route');