Skip to content

Instantly share code, notes, and snippets.

<html>
<head>
<title>Test</title>
</head>
<body>
<form method="get" action="">
<?php
$data = "' onmouseover='alert(document.cookie);' foo=' ";
@tfountain
tfountain / gist:2983928
Created June 24, 2012 16:36
Percona repo
apt_repository "percona" do
uri "http://repo.percona.com/apt"
deb_src "http://repo.percona.com/apt"
distribution "lenny"
components ["main"]
keyserver "hkp://keys.gnupg.net"
key "1C4CBDCDCD2EFD2A"
end
@tfountain
tfountain / gist:2983930
Created June 24, 2012 16:36
Percona repo errors
Chef::Exceptions::ShellCommandFailed: apt_repository[percona] (percona-mysql::default line 13) had an error:
execute[install-key 1C4CBDCDCD2EFD2A] (/var/cache/chef/cookbooks/apt/providers/repository.rb line 23) had an
error: Expected process to exit with [0], but received '2'
---- Begin output of apt-key adv --keyserver hkp://keys.gnupg.net --recv 1C4CBDCDCD2EFD2A ----
STDOUT: Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /etc/apt/sec
ring.gpg --trustdb-name /etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/truste
d.gpg --keyserver hkp://keys.gnupg.net --recv 1C4CBDCDCD2EFD2A
gpgkeys: key 1C4CBDCDCD2EFD2A not found on keyserver
STDERR: gpg: requesting key CD2EFD2A from hkp server keys.gnupg.net
gpg: no valid OpenPGP data found.
@tfountain
tfountain / gist:2983966
Created June 24, 2012 16:54
Percona success
[Sun, 24 Jun 2012 12:39:56 -0400] INFO: Processing execute[install-key 1C4CBDCDCD2EFD2A] action run (/var/cache/chef/cookbooks/apt/providers/repository.rb line 23)
[Sun, 24 Jun 2012 12:39:56 -0400] INFO: execute[install-key 1C4CBDCDCD2EFD2A] sh(apt-key adv --keyserver hkp://keys.gnupg.net --recv 1C4CBDCDCD2EFD2A)
Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /etc/apt/secring.gpg --trustdb-name /etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyserver hkp://keys.gnupg.net --recv 1C4CBDCDCD2EFD2A
[Sun, 24 Jun 2012 12:39:56 -0400] INFO: execute[install-key 1C4CBDCDCD2EFD2A] ran successfully
[Sun, 24 Jun 2012 12:39:56 -0400] INFO: Processing file[/etc/apt/sources.list.d/percona-source.list] action create (/var/cache/chef/cookbooks/apt/providers/repository.rb line 84)
[Sun, 24 Jun 2012 12:39:56 -0400] INFO: Processing execute[install-key 1C4CBDCDCD2EFD2A] action nothing (/var/cache/chef/cookbooks/apt/providers/repository.rb lin
@tfountain
tfountain / Controller
Created February 26, 2014 12:57
Facebook SDK
public function someAction()
{
$facebook = $this->getServiceLocator()->get('Facebook');
}
<?php
namespace QDFileupload\View\Helper;
use Zend\View\Helper\AbstractHelper;
class QDFileuploadCollectionHelper extends AbstractHelper
{
protected $thingy;
@tfountain
tfountain / Module.php
Created July 31, 2014 20:44
ZF2 multi-tenant
public function onBootstrap(MvcEvent $e)
{
$eventManager = $e->getApplication()->getEventManager();
// load site
$eventManager->attach(MvcEvent::EVENT_ROUTE, function ($e) {
$serviceManager = $e->getApplication()->getServiceManager();
$request = $e->getRequest();
$siteMapper = $serviceManager->get('Application\Site\SiteMapper');
@tfountain
tfountain / local.php
Created April 25, 2015 14:58
ZF2 Show exceptions - config/autoload/local.php
<?php
return array(
'view_manager' => array(
'display_exceptions' => true
)
);
traceroute to 185.60.115.21 (185.60.115.21), 30 hops max, 60 byte packets
1 DD-WRT (192.168.2.1) 3.166 ms 3.146 ms 3.122 ms
2 losubs.subs.dsl7.wh-man.zen.net.uk (62.3.83.20) 18.818 ms 18.824 ms 18.822 ms
3 ae1-130.cr1.wh-man.zen.net.uk (62.3.86.49) 18.820 ms 18.816 ms 18.815 ms
4 ge-3-0-0-0.cr2.th-lon.zen.net.uk (62.3.80.45) 25.838 ms 25.841 ms 27.344 ms
5 ge-2-1-0.mpr1.lhr2.uk.above.net (195.66.224.76) 27.323 ms 27.328 ms 27.326 ms
6 ae10.mpr2.lhr2.uk.zip.zayo.com (64.125.31.194) 25.812 ms 27.101 ms 26.128 ms
7 ae27.cs1.lhr11.uk.eth.zayo.com (64.125.30.236) 92.371 ms 103.887 ms 104.762 ms
8 ae5.cs1.lga5.us.eth.zayo.com (64.125.29.126) 92.253 ms 92.261 ms 92.253 ms
9 ae27.cr1.lga5.us.zip.zayo.com (64.125.30.251) 93.779 ms 93.858 ms 93.855 ms